BasicMicro - Forums

www.basicmicro.com
It is currently Sun May 20, 2012 10:41 pm

All times are UTC - 8 hours [ DST ]




Post new topic Reply to topic  [ 1 post ] 
Author Message
 Post subject: Anyone have any experience with RCINT?
PostPosted: Tue Sep 08, 2009 11:05 am 
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


Top
  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 1 post ] 

All times are UTC - 8 hours [ DST ]


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group

phpBB SEO