BS2 serial port with flow control?
Hey all, it's been a while since I've posted but this time I got a doozy of a question.
I'm working with the BS2 and a Seagate Dockstar using a Prolific PL2303 USB to serial adaptor and I've already tested that the BS2 is able to send and receive data with the Dockstar via the cable.
My issue is that of flow control. Using the BS2 as a platform, the device will be pretty simple codewise. The basic theory is that it will start off at a dead stop and upon receiving a control character "either f s r c w (Forward Stop Reverse clockWise Counterclockwise)" will then continue to carry out that command, e.g. if the BS2 gets "f" it will continue to move forward until a stop or other command is issued.
The problem is that if I put a "DEBUGIN" or SERIN command, the BS2 will jump forward then stop. If I implemented some kind of RTS/CTS handshake (through the use of a MAX232) would I then be able to signal the BS2 to read the serial port, only if there is a keystroke?
I am envisioning the following:
(CTS from BS2 low)
(RTS from DS low)
BS2 happily chugging forward.
Key entered on PC (through linux minicom which supports hardware flow control)
RTS on PC goes high, BS2 raises CTS then reads serial port for "s"
RTS on PC goes low
CTS on BS2 goes low
BS2 halts (the stop command has been received).
If the RTS never goes high, the last received command "F" forward should keep going without stopping to read the serial port.
Is something like this feasible? I would imagine that I would need to run the RTS and the CTS through the MAX232 to protect the BS2 from the +12V of the serial port, but before I go building a complete serial port for this (the RTS and the CTS lines are tied to reset on the BS2's serial programming port, making it not usable.) I want to know if it's possible to code flow control into a BS2 in order for this to happen.
I welcome your suggestions, Thank you!
PS Love the new forum look.
I'm working with the BS2 and a Seagate Dockstar using a Prolific PL2303 USB to serial adaptor and I've already tested that the BS2 is able to send and receive data with the Dockstar via the cable.
My issue is that of flow control. Using the BS2 as a platform, the device will be pretty simple codewise. The basic theory is that it will start off at a dead stop and upon receiving a control character "either f s r c w (Forward Stop Reverse clockWise Counterclockwise)" will then continue to carry out that command, e.g. if the BS2 gets "f" it will continue to move forward until a stop or other command is issued.
The problem is that if I put a "DEBUGIN" or SERIN command, the BS2 will jump forward then stop. If I implemented some kind of RTS/CTS handshake (through the use of a MAX232) would I then be able to signal the BS2 to read the serial port, only if there is a keystroke?
I am envisioning the following:
(CTS from BS2 low)
(RTS from DS low)
BS2 happily chugging forward.
Key entered on PC (through linux minicom which supports hardware flow control)
RTS on PC goes high, BS2 raises CTS then reads serial port for "s"
RTS on PC goes low
CTS on BS2 goes low
BS2 halts (the stop command has been received).
If the RTS never goes high, the last received command "F" forward should keep going without stopping to read the serial port.
Is something like this feasible? I would imagine that I would need to run the RTS and the CTS through the MAX232 to protect the BS2 from the +12V of the serial port, but before I go building a complete serial port for this (the RTS and the CTS lines are tied to reset on the BS2's serial programming port, making it not usable.) I want to know if it's possible to code flow control into a BS2 in order for this to happen.
I welcome your suggestions, Thank you!
PS Love the new forum look.
Comments
That's the thing. I haven't started code dev yet as I was looking to see if anyone else had done anything like this before.
I'd rather make an inquiry now than spend several weeks in development to find that it's not possible.
Thank you.
Just to make sure that I'm thinking right, the BS2 should be able to skip over the SERIN if the RTS (from the PC) is low?
The logic isn't a problem. Now I can start with coding knowing that what I'm doing is feasible.
Thank you so much for your help!