[Home]Simplex, Duplex, And Serial

HomePage | RecentChanges | Preferences

Showing revision 4

Simplex Duplex Serial and a backward bit

The PIC microcontrollers have a UART with a TX and RX.

You can connect TX on one chip to RX on another chip.

I was reading about SIMPLEX and DUPLEX.

https://www.geeksforgeeks.org/computer-networks/difference-between-simplex-half-duplex-and-full-duplex-transmission-modes/

You can connect TX on one chip to RX on another chip.

This is SIMPLEX.

The TX transmits and RX receives.

If you had Chip A and Chip B you could wire:-

 A.TX to B.RX 
 B.TX to A.RX

The simple microcontrollers have a UART with a TX and RX. They support 5,7,8 and sometimes 9 bits.

 5 bits for BAUDOT
 7 bits + Parity
 8 bits
 9 bits , where the 9 bit indicates ADDRESS

The UART from 40 years ago did not support the 9 bit.

If you are sending 8 bit characters with the UART set to 8 bits, there is no spare bit for a second channel.

I had an idea. If RS-232 serial had an extra bit it could be used to handshake. This still needs A.TX and another input A.input.

You need at least a 2 layer protocol, with the lower layer managing the layer above.

HDLC used in ITU MTP Level 2 has the FIB and BIB bits.

 FIB - Forward Indicator Bit
 BIB - Backward  Indicator Bit

 FSN - forward sequence number
 BSN - backward sequence number

The FIB is toggled and the BIB is toggled to respond. This allows a ACK or NACK.

The toggle protocol is important. If you have a SET / RESET protocol then A needs to let B write access. B needs to assert a reset. If you toggle, the other end can delay responding

RS-232 has the extra wires

  DSR and  DTR to act as signals to say powered up   
  RTS, and CTS to say Request to Send and Clear to Send.

ASCII has control characters and XON and XOFF

Unfortunately UARTS do not have spare bits to carry a backward bit.

It would be possible to add extra bits to the Serial frame to carry the RTS and CTS signals.

The SLI telephone exchange had a protocol where the Peripheral Interface polled the cards, and the cards responded.

ITU MTP Level 2 HDLC has the FIB and BIB bits

I suppose you could use an escape

I suppose you could use 7 bits and re-purpose the Parity Bit

You could use 6 bits.

When I was exprimenting with PIC16F628 I used a HALF-DUPLEX circuit.

I could detect if the Serial lead was plugged in.

I could test if PA0 was pulled to the STOP level.

 ; SERIAL PORT CONTROL:
 ;
 ;	PORT A0 is Serial input
 ;	PORT A0 is serial output
 ;
 ;	usb gmus-03 USB Serial Adapter
 ;
 ;	TX  D9 Pin 3 -[4k7]-+-PA0
 ;	RX  D9 Pin 2 - - - -/ 
 ;	GND D9 Pin 5 - - - -  0V

Resetting the protocol

A SIMPLEX protocol that can be used is the timed reset protocol where inactivity on the TX signifies a reset.

Another example SIMPLEX protocol is the BREAK that forces a Over run error, as the expected stop bit is not seen.

Another SIMPLEX protocol that can reset is the one used on LCD displays where the interface is four bits but the commands are 8 bit. However the interface has an additional wire to signal data or command.

If the microcontroller has been reset, and the LCD display has not, the microcontroller has to flush out half sent commands.

Hitachi HD44780:-

 ;     wlcdCmd($33);     { force to 8 bit mode }
 ;     wlcdCmd($32);     { force to 4 bit mode }
 ;     wlcdCmd($28);	 { 4 bit, 2 line, 5x7 display }
 ;     wlcdCmd($01);     { Clear Display }
 ;     wlcdCmd($0F);     { $0F - Display On,CursorOn,Blink }
 ;     wlcdCmd($C9);     { set dd address }

ASCII Control


HomePage | RecentChanges | Preferences
This page is read-only | View other revisions | View current revision
Edited July 26, 2025 5:30 pm by dougrice.plus.com
Search:
home page