FullDuplexSerial - txbuffer empty?
heliboy
Posts: 18
How can I tell when the txbuffer is empty in FullDuplexSerial ? I need to reverse a half-duplex 485 chip, but I need to hold the direction pin high until the TX buffer is empty. A fixed timeout does not seem to be reliable.
Thanks
Thanks
Comments
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
My Prop Info&Apps: ·http://www.rayslogic.com/propeller/propeller.htm
RS485 does not require a separate TX and RX line so it saves pins if you tie the TX and RX of the RS485 chip together and the /RE and TE together and just use 2 Prop I/Os.
(P.S. This can't be used with the standard serial objects of course. The PASM level stuff in my driver also asserts, holds and times out the TE line automatically)
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
*Peter*
Post Edited (Peter Jakacki) : 12/15/2009 11:36:07 PM GMT
The driver has a "change baud rate" function that waits until the tx buffer is empty and the last character is sent before it changes the buad rate. So you could just change the buad rate to the same baud rate and this will force you to wait till everything is sent before the function returns.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Nyamekye,
Thanks.
Ok, there's no problem with the speed as I have some objects running at 1M baud plus. I will try and tidy it up, test it out, and post it today.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
*Peter*
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
*Peter*