View previous topic :: View next topic |
Author |
Message |
mkuang
Joined: 14 Dec 2007 Posts: 257
|
|
Posted: Tue Jun 08, 2010 9:07 am |
|
|
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
|
|
Posted: Wed Jun 09, 2010 1:31 pm |
|
|
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
|
|
Posted: Wed Jun 09, 2010 1:41 pm |
|
|
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. |
|
|
|