??? 05/29/10 11:35 Read: times |
#176287 - stick a state machine in the ISR Responding to: ???'s previous message |
Can you explain a bit more why including jnb RI,$ in the interrupt handler won't work? Actually this does work fine on port 0. I just can't get it to work on port 1. Since interrupts on the port are turned off within the interrupt handler, why can't I use this "wait for RI" approach?
when hanging in an ISR waiting for a character to receive you just HANG. Anything else in your code the main loop, other ISRs, ... all come to a complete stop. While this may work for 'experimenting' it is almost guaranteed to leave debris behind that will totally screw you up with a small nagging once a day failure when you have "cleaned it up" correcting your language" Actually this 'works' on port 0 maybe it SEEMS to I have seen waaaaaaaaay too many problems in final products stemming from 'experimenting' being done in a "it does not matter for the experiment" way. the only uses of RI, TI and SBUF in the ISR should be: jbc RI,received jbc TI,transmitted jmp exit received: ... no RI, NO TI possibly a mov SBUF, jmp exit transmitted: ... no RI, NO TI possibly a mov SBUF, exit: Erik |