Parallel-Serial Converter - RS Components International

advertisement
Parallel-Serial Converter
Introduction:
A simple circuit that converts 7 parallel data bits into one serial data stream. The circuit without
any microcontroller is able to send seven states of a switch as one serial data stream. This serial
data can be read by any serial port. The circuit has two separate inputs one can be connected
to the PC serial port and other can be connected via MCU for further processing, thus to avoid
more wires from switches at remote places from processing unit. The circuit can be used in
similar places to convert parallel 7 bit data to one serial data signal.
The operating voltage of this circuit 5V and is designed using flip-flops, 555 timer IC and a serial
out shift resistor IC along with a few passive components.
Hardware:
K1 – Connector for 7 bit input and strobe input along with VCC and ground connection.
K2 – Power supply connector for 5V input.
K3 – Output connector for connecting MCU serial input.
K4 – Output connector for connecting circuit to PC.
Circuit description:
An input of a positive pulse on the strobe pin of IC3d (pin 11 of IC7474N which is a flip flop). A
’0’ level at pin 8 of this flip flop acts as a ‘load’ signal for pin 1 of IC2c(IC74165N)which is a serial
out shift register IC that takes in 7 bit parallel data and latches this data to the output when it
gets a low on its trigger pin(pin1). The parallel to serial conversion at IC2 takes place when a
square wave is applied to pin 2
The frequency (baud rate) is determined by the circuitry built around IC1 (IC555). The frequency
is set using the potentiometer P1. The baud rate can be checked with a digital frequency meter
connected to pin 3 of the 555 timer IC.
The clock output of the timer is also connected to the clock input of IC3c. The latter receives the
bits from IC2c to its data input. The serial signal appears at pin 5 of this flip flop and the output
is subsequently sent to T1. Also connected to pin 1 of IC3c is another RC combination acting as
a ‘power- on reset’ for IC3c. This flip-flop ensures that the start bit is always the same width as
the other bits in the signal.
The parallel – serial conversion starts with the aid of IC3d. The positive edge of the strobe signal
loads the shift register through the action of IC3d; the load pulse is extremely short, due to the
feedback from pin 9 of IC2c to the clear input of IC3d.
The output of the circuit delivers a serial signal with one start bit, seven data bits and a stop bit
value between two characters. Since the clock signal is always present, the circuitry keeps
sending the stop bit until the next character appears. Transistor T2 is added to the circuit in
order to invert the serial output signal to be fed to the MCU so that the start bit can be
detected directly by the MCU from the circuit input without connecting MAX232 IC between
the converter and MCU RX pin.
The frequency of the converter circuit depends on the frequency output of IC 555 which is
determined by the value of resistors R1 and R2 along with capacitor C1
The value of capacitor C1 is calculated using the formulae given below:
Baudrate = 1.44 / ((R1 + 2(R2 +P1)) * C1)
9600 = 1.44/((4.7k + 2*(30k))*C1)
C1 = 1.44 / (9600 * ((4.7k + 2*(30k)))
C1 = 2.3nf
So we use 2.2nf since 2.3nf is not easily available which gives a frequency of 10110 which is
then adjusted using the trimmer P1
Testing procedure:
With PC
 Connect the data pins to switch or logic input via connector K1.
 Connect PC TX connector K4 pin1 to the RX pin of DB9 connector and Ground pin no. 2
of connector K4 to ground of DB9 connector from PC. (Refer schematic)
 Power up the board through connector K2 with 5 V supply.
 Connect the frequency meter to pin3 of IC1 NE555 and vary the P1 to set the baud rate.
(set to 9600Hz)
 Open the Hyper Terminal from windows and set the baud rate to 9600 and start it.
 Give a high to low pulse on the pin 8 of connector K1 as strobe input to latch the data to
be sent serially.
 You can observe the serial data on Hyper Terminal.
 If not then try to adjust the pot P1 till valid data is received on the PC.
 If no frequency meter is available then adjust the trimmer pot P1 to 25K approx. (mid
value of potentiometer)
 Adjust the Potentiometer P1 until valid data is received on the PC
With MCU (tested with Arduino) board
 Connect the data pins to switch or logic input via connector K1.
 Connect MCU TX connector K3 pin1 to the RX pin of MCU/Arduino Board and Ground
pin 2 of connector K3 to ground of testing board (Ardunio Board). (Refer schematic)
 Arduino board should be programed with the testing software.
 Power up the board through connector K2 with 5 V supply.
 Connect the Arduino board to PC.
 Connect the frequency meter to pin no 3 of IC1 NE555 and vary the P1 to set the baud
rate. (set to 9600Hz)
 Open the Hyper Terminal from windows and do the configuration for 9600 baud rate
connection and start it.





Give a high to low pulse on the pin no. 8 of connector K1 as strobe input to latch the
data to be sent serially.
You can observe the serial data on Hyper Terminal.
If not then try to adjust the P1 till valid data is received on the PC.
If no frequency meter is available then adjust the trimmer pot P1 to 25K approx. (mid
value of potentiometer)
Adjust the Potentiometer P1 until valid data is received on the PC
Download