CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to support@ccsinfo.com

RS232 en interruption

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
Alexou
Guest







RS232 en interruption
PostPosted: Thu May 26, 2005 8:06 am     Reply with quote

Hello, how I can send data by the RS232 and at the same time make treatments by interruption which arrives all the 50µs???? Thank you

Alexis
Ttelmah
Guest







PostPosted: Thu May 26, 2005 8:50 am     Reply with quote

Send data, no problem, just use putc, and printf.
For receive, provided you can poll kbhit at a short enough interval, again no problem.
If you want to _receive_ RS232, and use the RS232 interrupts, the 'answer' will depend on the speed of your chip, and it's abilities. With a 18 family chip at 40MHz, you can use an interrupt at 50uSec, on the 'fast' interrupt, and if you keep the handler simple, and save as few registers as possible, the total time needed for this handler can be as low as 1-2uSec. As such, the normal interrupts, will hardly be affected at all. If you put the 50uSec event on the normal interrupts instead, the overhead will shoot up to perhaps 10uSec. Still possible, but remember that now there will also be this much 'jitter' in when the 50uSec interrupt will be handled.
If instead you want to do this on a 16 family at perhaps 20MHz, this starts to become hard, with it still being 'possible', but perhaps requiring your own int_global handler, which checks for the 50uSec event, after only saving the minimum registers, and then branches to a special handler, before handling the other events.

Best Wishes
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
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 vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group