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

why delay function disables interrupts?
Goto page Previous  1, 2
 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
mkuang



Joined: 14 Dec 2007
Posts: 257

View user's profile Send private message Send e-mail

PostPosted: Tue Jun 08, 2010 9:07 am     Reply with quote

Ken Johnson wrote:
delay_us(3500000/MODBUS_SERIAL_BAUD); //3.5 character delay
This is my longest delay routine in interrupt. it is 364uS (9600baud)

This bothers me . . .
3.5 characters at 9600 baud is 3.64 msec, not 364 usec

Mebbe I'm mis-understanding something here?


Ken


(1/9600)*3.5 = 3.64e-4s or 364us.
Ken Johnson



Joined: 23 Mar 2006
Posts: 197
Location: Lewisburg, WV

View user's profile Send private message

PostPosted: Wed Jun 09, 2010 1:31 pm     Reply with quote

Yes, but this is the bit-time, not the character time.

There are 10 bits per character (8 data, 1 start, 1 stop), so the char time is 1.04 msec; X 3.5 is 3.65 msec

Anyway, how is your project coming ?

Ken
tesla80



Joined: 23 May 2007
Posts: 81

View user's profile Send private message

PostPosted: Wed Jun 09, 2010 1:41 pm     Reply with quote

3500000/9600 = 364.5833333

I agree with the others too, but for now this is the best solution for me.
The slave answers master's request and delays in uart isr. The communication is not periodically.
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Goto page Previous  1, 2
Page 2 of 2

 
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