RS232 application
Posted: Sun Apr 05, 2009 3:41 pm
Hi,
Not entirely Flowcode, but there's so much intellect gathered here so here goes:
I have an application to interface a PIC through its UART to a component that has a bi-directional data i/o line. So, if I want to send data to the device I need to set a pin to make its data line an input; if I want to read from the device I need to clear that pin to make the data line an output. The device does implement RS232 protocol complete with internal baud rate generator.
So, I was planning to use a small ic switch to switch either the PIC TX or RX line to the bi-directional data line and toggle the switch with the same signal that toggles the data line between input and output. In flowcode I then have to bit-bang that switch control line before each serial send or serial receive macro call.
Would this work you think? Or would that interfere with the asynchronous send/receive which is not under program control?
Thanks,
Jan Didden
Not entirely Flowcode, but there's so much intellect gathered here so here goes:
I have an application to interface a PIC through its UART to a component that has a bi-directional data i/o line. So, if I want to send data to the device I need to set a pin to make its data line an input; if I want to read from the device I need to clear that pin to make the data line an output. The device does implement RS232 protocol complete with internal baud rate generator.
So, I was planning to use a small ic switch to switch either the PIC TX or RX line to the bi-directional data line and toggle the switch with the same signal that toggles the data line between input and output. In flowcode I then have to bit-bang that switch control line before each serial send or serial receive macro call.
Would this work you think? Or would that interfere with the asynchronous send/receive which is not under program control?
Thanks,
Jan Didden