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 CCS Technical Support

#use RS232 and Timer0

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







#use RS232 and Timer0
PostPosted: Fri Sep 04, 2009 12:15 am     Reply with quote

May I use a timer0 interrupt and a software RS232 ?
In another way does the software RS232 use the timer0 ?
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Fri Sep 04, 2009 12:31 am     Reply with quote

Quote:
May I use a timer0 interrupt and a software RS232 ?

The timer interrupt will interfere with the bit timing of the software UART.
Use the DISABLE_INTS parameter in the #use rs232() statement to
prevent this.
http://www.ccsinfo.com/forum/viewtopic.php?t=36570


Quote:
In another way does the software RS232 use the timer0 ?

No. It uses software timing loops to create the time delays for the bits.
The CCS software UART code uses method #3 of making a software
UART, as listed on this page:
http://www.8052.com/faqs.phtml?FAQ=124758
hmn44
Guest







PostPosted: Fri Sep 04, 2009 12:48 am     Reply with quote

Once more read the manual first ! many thanks
John P



Joined: 17 Sep 2003
Posts: 331

View user's profile Send private message

PostPosted: Fri Sep 04, 2009 9:23 am     Reply with quote

Method 2 on the list is perfectly usable, and it lets you keep your timer running all the time (if you need that) and doesn't hog the processor. But if the timer is running that way, there will be "glitches" in its operation at the start of a received byte. And, it involves some non-trivial programming where having an oscilloscope to check timing can be helpful.
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