I have a FT232RL chip. I am using it for usb to RS232 protocol conversion which i need to convert the data and use it further.
The "data set" (the device on the other side, like a modem, in my case a MAX485 IC) that i am using cannot be configured. All i can give it is a control signal to read or write. So its not very useful.
My application requires me to be able to set that to "write mode" when i am sending data and then AS SOON AS I AM DONE SENDING, i need to be able to set it to "read mode" to receive the response signal it generates.
Note: The control signal is a simple HIGH or LOW The data can be a few bytes
I think one way to do this is to be able to read how much data is there in the RS232 transmit buffer. As soon as that becomes "0", all data will have been transmitted and i can set the control pin to "read mode"
Another way to do it is using FLOW CONTROL
I wish to explain my understanding of flow control before stating my problem for clarity purpose:
(1) I send the data via Python to the ftdi via usb
(2) The ftdi needs write a HIGH on the DTR line
(3) On receiving a HIGH on the DSR line, it needs to start transmitting(this is assuming i have disabled rts/cts flow control settings)
(4) Once it is done transmitting, it needs to write a LOW on the DTR line marking end of transmission
The problem is that i cant get the DTR line to turn ON and OFF as expected STEP (2) does not happen
import serial
ser = serial.Serial("com1") # initialised port as ser
ser.dsrdtr = True # set dsrdtr mode
ser.write("blah blah") # sent a command
I even tried the following:
ser.setDTR(True) # write a HIGH on DTR
ser.setDTR(False) # write a LOW on DTR
This still doesnt solve my complete problem.
Please advice
EDIT: I need to mention that the FT232RL i am using is on a breakout board by nex-robotics and the pins that i have access to are: 3.3V, 5V, CD, RXD, TXD, DTR, GND, DSR, RTS, CTS and RI and ofcourse a usb port to connect it to my laptop
EDIT2: Can I use Mprog 3.5 or a similar software to flash an EEPROM which can support what i wish to do? If yes, How?