| ??? 07/05/05 11:09 Read: times |
#96588 - how to use RAM? |
hey It's me again
I need to find a way to load a text into the ram (in the future comming trough serial). I suppose this should be done with mov A, @R0 an vice versa but it doesn't really work It produces the X from the init procedure but then nothing... I really do not understand the ram thingy can you help me? the current code (yes I have a max232)
; serial communication
;set serial receive for 19200/8/n/1
#include 8051.H
.org 0000H
Main acall Init ; initialise
run acall TXT ; call send
sjmp run
.end
Init mov TMOD, #20h ; Timer 1 in Auto-reload mode
mov IE, #00h ; reset intterupts
mov PCON, #80h ; set SMOD for 19200 baud
mov SCON, #50h ; serial mode 1, REN=1
mov TH1, #253 ; load T1 for 19200 baud
mov R1, #00H ; reset car. index
mov R0, #00h
setb TR1 ; start timer
acall FILL_MEM
mov A, #'X'
acall SEND
ret ; return
TXT mov R0, #00h
TXT2 mov A, @R0 ; caracter index
jnz SND ; jump to morse convert if A is a caracter
ret
SND acall SEND
inc R0 ; inc car. pointer
sjmp TXT2
SEND clr TI ; Be sure the bit is initially clear
mov SBUF, A ; send character
jnb TI, $ ; Pause until the TI bit is set.
ret ; return
FILL_MEM
mov R0, #00h
mov @R0, #'A'
inc R0
mov @R0, #'B'
inc R0
mov @R0, #'C'
inc R0
mov @R0, #'D'
inc R0
mov @R0, #'E'
inc R0
mov @R0, #'F'
inc R0
mov @R0, #00h
ret
|
| Topic | Author | Date |
| how to use RAM? | 01/01/70 00:00 | |
| RAM | 01/01/70 00:00 | |
| Flaw | 01/01/70 00:00 | |
| why flaw? | 01/01/70 00:00 | |
| Register Banks Are Not in Bible :-o | 01/01/70 00:00 | |
| open up your eyes and let the sun shine | 01/01/70 00:00 | |
| Misunderstood | 01/01/70 00:00 | |
| If you want to state "wonder" SAY SO | 01/01/70 00:00 | |
| RAM area | 01/01/70 00:00 | |
| but how? | 01/01/70 00:00 | |
| Do it yourself | 01/01/70 00:00 | |
| I will do It myself | 01/01/70 00:00 | |
| upper RAM | 01/01/70 00:00 | |
| how can anyone help based on what you th | 01/01/70 00:00 | |
| register - RAM overlap | 01/01/70 00:00 | |
See Post By Andy below | 01/01/70 00:00 | |
| Not in the Tutorial?? :-0 | 01/01/70 00:00 |



