> > > Basically if you want any chance of making this work you will need to
> > > handle the ISR yourself and you need to flip the direction control
> > > (aka RTS) in the ISR. Note: You can NOT use the transmit interrupt to
> > > do the flipping because the TX ISR will happen when the last byte
> > > begins to shift out of the UART, not when it's finished shifting
> > > out!!  The way most people handle this is to listen to what you are
> > > transmitting, and flip when you receive your last byte.
> > >

When I did a multi-drop 485 I found it necessary to add lap and lead 
times. When the master spoke it remained in Tx for 3mS after the 
message, whilst slaves had start their transmission (i.e. At least go 
in TX) within that time frame, and not start pumping data until at 
least 3mS had passed from the reception of the last character. This 
eliminated false start bits being generating on a wide and noisy 
network during the interval when no-body was in Tx. Biasing can do 
this, but make the network more noise vulnerable.

In order to do this I used the Tx complete flag interrupt to trigger a 
timer, as the time required for the character to get out the  shift 
register is a baud dependent constant, and I had low IRQ latency. The 
'other' way of doing it (Rx ing characters) always requires a timer 
anyway, as a bus conflict or other conflict could prevent you from 
receiving all you transmit and thus a timeout is essential or the 
driver will remain fixed in transmission. I kinda figured that timing 
when the characters should have left before axeing the Tx enable is a 
more elegant solution than the RX charas/time-out solution.




--
To unsubscribe from this list, send a message to [EMAIL PROTECTED]
with the command "unsubscribe linux-embedded" in the message body.
For more information, see <http://waste.org/mail/linux-embedded>.

Reply via email to