SP2328 serial port expansion special chip and its interface circuit with microcontroller

Publisher:BlissfulJourneyLatest update time:2006-06-22 Source: 中华电子网 Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

Abstract: This article introduces the functional characteristics of a new type of microcontroller serial port expansion chip and the application of the interface with the microcontroller.
Keywords: Single-chip microcomputer; Multi-serial port communication  
When designing a data acquisition circuit composed of multiple single-chip computers, multiple serial ports are generally used for data communication between each single-chip computer. In order to solve the problem of expanding multiple serial ports on a single-chip microcomputer, multiple AT89C2051 chips were mostly used to achieve multi-serial port communication. Each AT89C2051 is connected to the host computer through a parallel port, and then connected to the serial port of the lower computer through the serial port of AT89C2051. For this kind of circuit design, the microcontroller programming is more complicated, the debugging of the entire circuit is also more troublesome, and the reliability is not very high. A newly developed SP2328 serial port expansion chip solves the above problems very well.
SP2328 is a dedicated serial port expansion chip of Chengdu Shipu Technology Company. It can expand one serial port (UART) of ordinary microcontrollers (such as AT89C2051, AT89C51, etc.) into three serial ports. It mainly solves the problem of too few UART serial ports in most 8-bit, 16-bit and 32-bit microcontrollers, and expands the scope of use of microcontrollers. At the same time, the SP2328 serial port expansion dedicated chip also solves many complex serial port configuration problems when using dual serial port microcontrollers, which can greatly shorten the development cycle and reduce development and production costs.

Figure 1 DIP and SOIC package (left) Figure 2 SSOP package (right)

Functional features of SP2328
SP2328 has four UART serial ports, including one master serial port and three sub-serial ports. The master serial port and all sub-serial ports are in full-duplex working mode, and all serial ports are allowed to receive and send serial data at the same time. Serial port 0~serial port 2 are sub-serial ports, and the working rate of each sub-serial port is 75bps~4800bps. Serial port 3 is the master serial port, and its data transmission rate is 4 times that of the sub-serial port. After serial port 3 receives the serial data, the SP2328 chip sends the data through the corresponding sub-serial port according to the received address signal. After the sub-serial port receives the serial data, it sends the data through serial port 3 and gives the corresponding sub-serial port address. Setting the baud rate of serial port 0~serial port 2 is very simple and does not require software setting. Just change the frequency of the input clock. The baud rate is calculated according to the following formula:

K=2400*f(osc)/8.0(bps)

Among them, f(osc)<=16.0MHZ
The DC operating voltage of SP2328 is 2.4V~5.5V, the typical current is 3.7mA, and it has a power-saving mode.
Figure 1 and Figure 2 are the pin arrangement diagrams of the SP2328 chip.
ADRI0 and ADRI1 are the serial port address lines when serial port 3 receives downstream data. "00", "01" and "10" correspond to the addresses of serial port 0, serial port 1 and serial port 2 respectively; "11" is the address of serial port 3. When the host computer wants to send data to the lower computer connected to a certain sub-serial port, it must first set ADRI0 and ADRI1 to the responding address state, and then send the data to serial port 3.
ADRO0 and ADRO1 are the serial port address lines when serial port 3 sends upstream data. "00", "01" and "10" correspond to the addresses of serial port 0, serial port 1 and serial port 2 respectively. When the serial port of the host computer receives the data sent from serial port 3, it immediately reads the status of the address lines ADRO0 and ADRO1. Based on the status of the address lines ADRO0 and ADRO1, it can be determined which serial port the received data was uploaded from.

Figure 3 Interface circuit between SP2328 and microcontroller

Example of the interface between SP2328 and the microcontroller.
Figure 3 is the interface circuit between SP2328 and the microcontroller in the data acquisition circuit of the microcontroller. The serial port of AT89C51 is connected to the serial port 3 of SP2328. P1.0, P1.1, P1.2, and P1.3 are connected to ADRI0, ADRI1, ADRO0, and ADRO1 respectively, which are used to set and read the address of the sub-serial port. The three sub-serial ports are connected to the serial ports of three slave computers respectively. The baud rate of serial port 0, serial port 1 and serial port 2:
 K=(2400*16)/8=4800(bps)
The baud rate of serial port 3:
 K3=4*K=4*4800=19200(bps)
AT89C51 The baud rate of the serial port must also be set to 19200bps.
Since SP2328 automatically enters the working state after power on and does not need to be set by a program, it is relatively simple and convenient to write a serial port program.

Issues that need attention
: When selecting the crystal oscillator frequency, the baud rate of the microcontroller serial port must be strictly consistent with the baud rate of SP2328. The crystal oscillator frequency must be stable, otherwise it is easy for the data received by the SP2328 chip and the data sent out to be incorrect. of.
Since the speed of the main serial port 3 is 4 times that of other sub-serial ports, that is, the main serial port can send 4 bytes in the time it takes the sub-serial port to send one byte. Therefore, if the serial port 3 sends a byte to the sub-serial port, the serial port 3 does not send a byte to the other sub-serial ports. The sub-serial port sends another 4 bytes, and immediately sends data to the atomic serial port, the data of the sub-serial port will overflow. Therefore, more than 4 bytes must be added between them for delay (the master serial port sends data to other sub-serial ports, which is equivalent to a delay of one byte).
After the host computer receives the upstream data from the master serial port, it must read the address information of the upstream data in time (the address information of the upstream data can be maintained for 6 bits after the stop bit of the upstream data ends). This enables the host computer to accurately receive the serial data from the sub-serial port.
Before the host computer sends data to the master serial port, it must first send the address signal of the sub-serial port to SP2328.

Conclusion
: The SP2328 chip is used to expand the serial port of the microcontroller, which provides a good solution for the multi-serial communication of the microcontroller. Compared with solutions such as using dual serial port microcontrollers and using multiple pieces of AT89C2051 to expand serial ports, it has simple programming, high reliability and low cost.

References
1 Yu Yongquan. "Principles and Applications of Flash Microcontrollers". Beijing: Electronic Industry Press. 1997,10
2 SP2328 Data Application Manual. Chengdu Shipu Technology Co., Ltd. 


Reference address:SP2328 serial port expansion special chip and its interface circuit with microcontroller

Previous article:Implementation scheme of LIN protocol based on ordinary microcontroller
Next article:SP2328 serial port expansion special chip and its interface circuit with microcontroller

Latest Microcontroller Articles
  • Download from the Internet--ARM Getting Started Notes
    A brief introduction: From today on, the ARM notebook of the rookie is open, and it can be regarded as a place to store these notes. Why publish it? Maybe you are interested in it. In fact, the reason for these notes is ...
  • Learn ARM development(22)
    Turning off and on interrupts Interrupts are an efficient dialogue mechanism, but sometimes you don't want to interrupt the program while it is running. For example, when you are printing something, the program suddenly interrupts and another ...
  • Learn ARM development(21)
    First, declare the task pointer, because it will be used later. Task pointer volatile TASK_TCB* volatile g_pCurrentTask = NULL;volatile TASK_TCB* vol ...
  • Learn ARM development(20)
    With the previous Tick interrupt, the basic task switching conditions are ready. However, this "easterly" is also difficult to understand. Only through continuous practice can we understand it. ...
  • Learn ARM development(19)
    After many days of hard work, I finally got the interrupt working. But in order to allow RTOS to use timer interrupts, what kind of interrupts can be implemented in S3C44B0? There are two methods in S3C44B0. ...
  • Learn ARM development(14)
  • Learn ARM development(15)
  • Learn ARM development(16)
  • Learn ARM development(17)
Change More Related Popular Components

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号