Free Electronic Circuits & 8085 projects

Electronic projects with circuit diagram and 8085 microprocessor projects.

Universal Asynchronous serial port expansion and application of the principle of the chip GM8123-25 circuit

Published on Oct 28 2010 // Micrcontroller circuits

Universal Asynchronous serial port expansion and application of the principle of the chip GM8123-25

Universal Asynchronous serial port expansion and application of the principle of the chip GM8123-25 1

   AbstractThis paper describes a new device GM8123/25 serial port expansion chip, chip using the serial port of the series expansion of the program is low cost, fast, simple control, etc., can be widely used in data acquisition, industrial control, serial communication needs of the occasion .

Comparison of similar programs

Serial port expansion now more common, there are two options, one with a hardware implementation, the use of serial expansion chip microcontroller or a dedicated serial port, serial port expansion options for TI and other chip companies have developed chips 16C554 series serial port expansion, the series chip function is extended through the parallel port serial port, more powerful features, communication speed is high, but the control complexity, while higher prices, the main applications is the PC serial port expansion products. In the SCM control only and does not require high baud rate communication systems, the use of 16C554 family of chips is not only costly but also caused a waste of resources. The existence of serial microcontroller also the shortcomings of the high price. Another serial port expansion scheme is implemented in software, shortcomings serial port software emulation are: First, the sampling frequency is low, generally only do 2 / BIT, this is difficult to guarantee the accuracy of the data; the second is not high baud rate communications, serial port software emulation can not be achieved generally higher than the 4800 bps baud rate.

Microelectronics Co., Ltd. Chengdu Guoteng launched GM8123/25 series expansion chip full hardware serial port expansion work to ensure the stability of the chip, the design can meet the highest baud rate of the general system requirements, while occupying less system resources, the use of method is simple, communication format can be set, the format is compatible with standard serial communication, use the chips to achieve a higher serial port expansion is cost-effective extension programs.

II. GM8123/25 Introduction

2.1 Features

* Write the control word using the chip to control the way
* Two modes, the user can flexibly choose their own system requirements
* The sub-baud rate serial port (unified regulator)
• Data frame size 10 or 11 optional
* Sub-serial number: 3 (GM8123) or 5 (GM8125)
• Data sampling rate 16 times / BIT, to ensure the accuracy and reliability of data sampling
* Single-channel mode, the maximum baud rate support for 20Mbps; multi-channel mode, the maximum baud rate 38400bps serial child
* Compatible with standard serial communication format
* Output baud rate error is less than 0.2%, the input baud rate is less than 2.8% error requirement
* Wide operating voltage: 2.3 ~ 6.7V
* Operating temperature range: -40 ? ~ 85 ?
* Job stability, strong anti-interference ability, in line with industrial standards

2.2 Functional Description

GM8123 scalable three standard serial, GM8125 can be extended five standard serial port, the chip can work through the software set the baud rate and data frame size. Chip serial port expansion via external pin selection mode: single mode and multi-channel operation. Single-channel mode, the maximum baud rate of serial child support 20Mbps; multi-channel mode, the maximum baud rate of serial child support 38400bps.

Single-channel mode, no need to set the communication format of the chip, sub-master serial port and baud rate the same work, a time when only a child and the mother of serial communication port, serial port from the address line of work sub-options. Single-channel mode is applicable to all communication from the machine and the communication process while not entirely controlled by the host system.

Multi-channel mode, allowing all children the same time with the parent serial communication port, mother to child serial port baud rate of 4 times (GM8123) / 6-fold (GM8125) to work when sending data from the address lines choose to send a child serial port, receiving can take the initiative to respond when the child serial data sent from the machine by the mother sent to the host serial port, while the address lines to return the child to receive the data port address, host to the child receiving the serial data sent by the state can be judged based on the address line from which data is sent from the machine. Multi-channel model so that each slave can be required to send timely response, even though both have sent all the requested from the machine, the data is not lost, basically the main control unit and peripheral communication in real time. Multi-channel mode for sending data to the host from the machine’s time is not controllable and there are real-time requirements of multi-machine communication systems. (For details, see Microelectronics Co., Ltd. Chengdu Guoteng’s GM8123/25 data sheet)

2.3 System Structure

Figure 1 is a block diagram of the system GM8123/25:

III. Application Notes

In the following example of a system with GM8125 The series chip serial port expansion method: a system in 5 of the slave serial communication with the host needed, 5 were from the local communication baud rate 19200bps, the host first to the All sends a byte of data from a control command from the machine from the machine and process the data received immediately after the return data to the host. According to system requirements to see, from the time machine to send data determined in accordance with its processing time, without host control, so GM8125 to work in multi-channel mode, which allows all sub serial port simultaneously. Figure 2 is a block diagram of microcontroller interface with GM8125, GM8125 as the host of the system by expanding the five serial 89C51.

GM8125 Pin Description:

RST: reset pin, active low. Default after reset the baud rate is the work of child serial 1200bps, data length is 11 bits (with parity bit);
MS: mode select pin, the control chip work in a multi-channel mode or single mode. Cater to multi-channel mode, read / write command word select pin;
SRADD0 ~ 2: to receive sub-serial address line;
STADD0 ~ 2: send the sub-serial address line;
RXD0, TXD0: Female Serial transmit / receive pins;
RXD1 ~ 5, TXD1 ~ 5: 1 to 5 sub-serial transmit / receive pins;

Here are the host to send and receive control procedures to C51 as an example:

# Include <reg51.h>
sbit MS = P3 ^ 6; / / GM8125 mode control
sbit RESET = P3 ^ 7; / / GM8125 reset pin control
unsigned char SendBuff [5] = {0xaa, 0x45, 0x67, 0xbc, 0xc9};
unsigned char ReceiveBuff0;
. . . . . .
unsigned char Contr_data;
unsigned char ADD;
unsigned char i = 0;
. . . . . .

void main (void)
TMOD = 0x20; / / specify the timer 1 is in Mode 2
IE = 0x90; / / open serial port interrupt
SCON = 0xc0; / / serial port operating in mode 3
TH1 = 0xf8; / / Load Timer 1 initial value, set the host baud rate is 7200bps work
TL1 = 0xf8;
PCON = 0x00;
. . . . . .
RESET = 0; / / reset the operation of the GM8125
Delay (); / / Delay routine
RESET = 1;
Delay ();

Contr_data = 0xfc; / / load command word initial
TR1 = 1; / / start timer 1
MS = 0; / / GM8125 work in the write command word mode
P0 = 0x00; / / set command word address GM8125
SBUF = Contr_data; / / set the serial baud rate for the sub-GM8125 19200bps, mother of the serial port baud rate is 115200bps
while (TI == 0);
TI = 0;
Delay ();
(Read the command word can be written to verify the results of the content is correct)

TR1 = 0; / / Timer 1 Stop
TH1 = 0xff; / / Load Timer 1 initial value, set the baud rate is the work of the master MCU 115200bps
TL1 = 0xff;
PCON = 0x80;
TR1 = 1; / / start timer 1

/ * Master MCU to send / receive procedure * /
ADD = 0x1f; / / send the address of sub-channel 1
P1 = ADD; / / sub-channel 1 sent select GM8125
SBUF = SendBuff [i];
while (TI == 0);
TI = 0;
i + +;

(In this way the serial port, respectively, send data to the 5 sub)

REN = 1;
(Waiting to receive treatment)

void CommReceive (void) interrupt 4
if (RI)
switch (P1 & 0x07) / / determine SRADD0 ~ 2 to receive data from the state to determine which sub serial port
case 0:
{ReceiveBuff0 = SBUF; / / read command word into ReceiveBuff0
case 1:
{ReceiveBuff1 = SBUF; / / sub-channel 1 to receive the data into ReceiveBuff1
. . . . . .
RI = 0;

The chip for single-channel model does not require the same from machine to work the system, the specific application method described here does, please refer to Guoteng Microelectronics Co., Ltd. released “GM812X Application Manual.”

IV. Conclusion

Using GM8123/25 for serial port expansion, has the following advantages:

1, simple control. The chip set works with software to minimize the line of control, the host does not require much system resources, while ensuring ease of use.

2, flexible application. The chip has two modes, a variety of the work of the baud rate, 10-bit or 11-bit data frame size options, the user may need the flexibility to choose their own system.

3, versatility. The chip design take into account all the needs of users, to ensure that the chip is universal, and is fully compatible with standard serial communication format, while providing a variety of optional settings, for most serial communication system.

4, baud rate of work. The sub-chip serial port baud rate in single channel mode support 20Mbps, multi-channel mode support 38400bps, the baud rate can meet the needs of the general serial communication.

5, stable performance. Hardware than the software implementation of serial port can guarantee the stability of serial communication, while 16 samples per bit to ensure the accuracy of the data.

6, the baud rate error. Output baud rate error is less than 0.2%, the input baud rate is less than 2.8% error requirement.

The inadequacies of the chip is: does not meet the requirements of ultra-low power applications; multi-channel mode, all sub-serial baud rate can only be set into a unified work of value, does not apply to the baud rate from the machine work is inconsistent and asked for the same time work system.

Figure 2 GM8125 block diagram of the hardware interface with microcontroller