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

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
05/29/10 12:18
Read: times


 
#176294 - what is "other code" ?
Responding to: ???'s previous message
At the beginning of the loop I can't be sure what state everything is in, and other code may have been using the RS485 bus.
turn driver off and receiver on, because I'm not sure what state it's been left in
wait a moment for bus settling etc.

so far so good BUT:
WHAT DOES "other code" MEAN? are you using a RTOS?

do I need to read SBUF to make sure the chip is ready to receive the next byte?
no

do I need to clear RI here in case something has been received when I switched the receiver off and on again or by "other code"?
it would have vectored to your ISR if it was

jnb RI,$
clr RI
mov a,SBUF
wait half a bit-time plus a moment for settling
turn driver on and receiver off
wait a moment for settling
do I need to clear TI here, just to be sure?
mov SBUF,a
jnb TI,$
clr TI
wait 1 bit-time plus a moment more for bus settling etc.
turn driver off and receiver on
wait a moment for bus settling etc.

all in the ISR

"other code" which may receive and/or transmit via the RS485 port
what is "other code" ?

Yes, I know that the best way to do it is with interrupts! I will move on to that when I've got this working perfectly...
do not wait, do it NOW

Erik

List of 21 messages in thread
TopicAuthorDate
Receiving serial bytes on 80C320 UART            01/01/70 00:00      
   here            01/01/70 00:00      
      Thanks - excellent FAQ            01/01/70 00:00      
         "bible time"            01/01/70 00:00      
            Truly biblical!            01/01/70 00:00      
   My recommendation...            01/01/70 00:00      
      Useful ideas - but I don't want to change the hardware            01/01/70 00:00      
         You are absolutotally unconditionally confused            01/01/70 00:00      
            !RI or /RE            01/01/70 00:00      
               I'll re-answer the post above            01/01/70 00:00      
                  Use previous advice and keep receiver enabled            01/01/70 00:00      
                     This can't be right...            01/01/70 00:00      
                        How to get it working            01/01/70 00:00      
                        sometimes right, sometimes wrong            01/01/70 00:00      
                           e-mailed to Steve, Craig --- forum FYI            01/01/70 00:00      
                           We're getting there...            01/01/70 00:00      
                              I believe you are corect....            01/01/70 00:00      
                                 join the club            01/01/70 00:00      
                                    "No other way??"            01/01/70 00:00      
                                       in my (personal) opinion            01/01/70 00:00      
         what is "other code" ?            01/01/70 00:00      

Back to Subject List