|
Rather than waiting for a character to appear or testing often for the presence of a character, I'd like to use RCINT to call a line-input routine only on arrival of a character in a serial stream. Here's how I think it would be done:
init: DIR13=1 ' RS485 Enable output DIR14=0 ' RS485 Rec. Data input DIR15=1 ' RS485 TX Data output low P13 ' enable RS485 to rcv. ENABLEHSERIAL ' enable the hardware serial port SETHSERIAL H1200 ' set hardware serial port for 1200 baud oninterrupt RCINT, serisr ' link interrupt to service routine main: enable RCINT ' enable the interrupt SEROUT S_OUT,I1200,["doin' stuff",10,13] ' print routine progress message pause 2000 ' do regular stuff here goto main ' do it again serisr: disable RCINT 'disable further ints on incoming data SEROUT S_OUT,I1200,["interrupt!",10,13] ' print notification that interrupt has occurred resume ' pick up routine work where we left off
..... but this doesn't work. I was wondering if anyone out there has ever gotten RCINT to work on an ATOM 24 and can tell me where I'm going wrong. I'm running the new Studio IDE. BTW, I have written a separate program to demonstrate that data is incoming to the dedicated hardware serial input port.
Thanks,
Rusty
|