Serial port special usage
fma38
Posts: 42
Hello,
I'm trying to develop a new interface for an astronomic head, in order to turn it into a panoramic head (to take photos).
The original electronic is made of 2 parts: a remote control, and an internal electronic. 3 PIC 16F73 are used: 2 inside, and 1 in the remote. The com. is a strange RS232: TX/RX lines of all PICs are wired together; the com. is half duplex. I guess that the PICs have to switch on/off transmit/receive lines. There is also a CS\ signal, which goes low when the remote start talking. I'm learning the protocol, and I almost found all commands. But now, I need to make real tests, and I would like to drive the head, using a BS2px instead of the remote. And I need some advices to wire it.
On the head side (using the 2 PIC, one for each axis), the CS\ signal has a 10k pull-up resistor; on the remote side, the PIC uses an open-drain output, to pull it to ground when start talking. In fact, this PIC also starts by checking if the head is connected, by using this pin as input, checking the +5V voltage.
1) Is there a way to use a BS2 output in open-drain mode? Or do I need to add an external transistor?
2) May I connect TX and RX on the BS2, like in the PICs? Or do I need additional external circuit to protect these pins? Do I need to turn them on/off, depending on the sens of the transmission? Is there a risk?
The protocol looks like following: all commands from the remote start with ':', followed by a letter, followed by an optional value. Answer from the head starts with '=', followed by an optionnal value (depending of the command). Separator is 0x0d. The CS\ line is first set to low, just before the transmission begins. Ex:
CS goes low
remote sends ':L2' + 0x0D
head answers: '=' + 0x0D
CS goes high
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Fr
I'm trying to develop a new interface for an astronomic head, in order to turn it into a panoramic head (to take photos).
The original electronic is made of 2 parts: a remote control, and an internal electronic. 3 PIC 16F73 are used: 2 inside, and 1 in the remote. The com. is a strange RS232: TX/RX lines of all PICs are wired together; the com. is half duplex. I guess that the PICs have to switch on/off transmit/receive lines. There is also a CS\ signal, which goes low when the remote start talking. I'm learning the protocol, and I almost found all commands. But now, I need to make real tests, and I would like to drive the head, using a BS2px instead of the remote. And I need some advices to wire it.
On the head side (using the 2 PIC, one for each axis), the CS\ signal has a 10k pull-up resistor; on the remote side, the PIC uses an open-drain output, to pull it to ground when start talking. In fact, this PIC also starts by checking if the head is connected, by using this pin as input, checking the +5V voltage.
1) Is there a way to use a BS2 output in open-drain mode? Or do I need to add an external transistor?
2) May I connect TX and RX on the BS2, like in the PICs? Or do I need additional external circuit to protect these pins? Do I need to turn them on/off, depending on the sens of the transmission? Is there a risk?
The protocol looks like following: all commands from the remote start with ':', followed by a letter, followed by an optional value. Answer from the head starts with '=', followed by an optionnal value (depending of the command). Separator is 0x0d. The CS\ line is first set to low, just before the transmission begins. Ex:
CS goes low
remote sends ':L2' + 0x0D
head answers: '=' + 0x0D
CS goes high
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Fr
Comments
To be more specific, how BS2 lines used with SERIN/SEROUT work? When something is outputed with SEROUT, does the line goes back to input mode at the end of the transmission? Or does in remain at a specific level? What kind of ouput is it? TTL? Open-drain? other? Same question with SERIN...
Thanks,
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Fr
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
- Stephen
If you use the open-drain mode, the I/O pin goes to input mode when it sends one bits and is left that way at the end of the SEROUT statement. If you don't use open-drain mode, the I/O pin is actively driven to a logic high for one bits and is left that way (logic high) at the end of the SEROUT statement. This is called TTL mode because those are the voltage levels used.
SERIN changes the I/O pin to input mode and leaves it that way at the end of the statement.
Step 4: Select driven or open output (bit 15):
Driven = 0, Open = 32768
at SEROUT command page. But I'm not sure what it means...
About the schematics, I do not have them, as the head is a commercial product! I can only make reverse-engineering... What do you need to now, exactly?
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Fr
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Fr
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Fr