Email: Password: Remember Me | Create Account (Free)

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
08/23/03 16:24
Read: times


 
#53172 - Receiving Problem
hi all

i've a task to receive bytes at Rx at different locations. Tx transmits byte after byte with 1 second delay between each transmission and Rx receives each one of them. so far so good. Rx only dumps the SBUF to the port.

Now i desire to store these received bytes at different locations. so R0 is taken and initialised to 30H. each time a byte is received, data in SBUF goes to @R0 and R0 is incremented. The byte counter is in Tx code so only 16 bytes are transferred.

CODE -

WAIT: SJMP WAIT

RECEIVE:
CLR RI

INC R0

MOV @R0,SBUF
MOV P0,@R0 ;VALUE AT R0 IS DISPLAYED
MOV P2,R0 ;ADDRESS OF R0 IS DISPLAYED

RETI

But this creates a problem. Both P0 and P2 continuosly displays some values after receiving the first byte. and keeps on doing the same until the last byte is received. The problem is with INC R0 statement.
Bcoz when i remove this line from code, the transmitter receives each byte at a gap of 1 sec(from Tx) at the same location as initialized.
So P0 displays 16 different bytes and P2 displays #30H (Initial Address).

What do i do to have these bytes stored at different locations. If R0 is incremented the ports keep on running and if not, then values can\'t be stored.




List of 3 messages in thread
TopicAuthorDate
Receiving Problem            01/01/70 00:00      
   RE: Receiving Problem            01/01/70 00:00      
      RE: Receiving Problem            01/01/70 00:00      

Back to Subject List