1 Introduction
The advantages of DSP (digital signal processing) include processing complex operations, being particularly suitable for digital filtering, voice, video, image processing, communication, and high-speed real-time measurement and control systems. It has become an important device in modern information processing technology, greatly promoting academic research, product development, and application in various fields of signal processing and measurement and control. TI's TMS320LF2407 is a dedicated fixed-point DSP chip. Compared with previous products, the biggest difference is that it has a wealth of peripherals, such as SCI, SPI, EV, etc., and adds transaction management capabilities to the advantages of processing data.
The Serial Peripheral Interface (Serial Peripheral InteRFace) is a synchronous serial peripheral interface protocol proposed by Motorola. It is mainly used in EEPROM, FLASH, real-time clock, AD converter, and between digital processing and digital decoders. It includes master/slave modes, has the advantages of less I/O resource occupation, simple protocol implementation, fast transmission speed, ability to send and receive information at the same time, and support for most processor chips. It is a high-speed full-duplex, synchronous communication bus, and only occupies four wires on the chip pins, saving the chip pins. At the same time, it saves space and provides convenience for PCB layout. It is precisely because of this simple and easy-to-use feature that the TMS320LF2407 chip also integrates this communication protocol.
2 SPI interface structure and design principle
2.1 SPI interface structure
The SPI design mainly consists of two parts: microcontroller interface and SPI control interface. The microcontroller interface and SPI control interface are connected together through the three buses of control line, data line and address line. If there are more SPI interface modules outside, the SPI control interface can be used for software programming and setting to realize the expansion of external devices with SPI interface.
The master-slave controller used in TMS320LF2407 communicates. The master controller starts data transmission by outputting the SPICLK signal. For both the master and slave controllers, data is shifted out of the shift register at one edge of SPICLK and latched into the shift register at the opposite edge. If the CLOCK PHASE bit is 1, data transmission and transfer will occur half a cycle before the SPICLK jump. The master controller can start data transmission at any time because it controls the SPICLK signal. The software determines how the master controller detects when the slave controller is ready to send data to start SPI data transmission.
Figure 1 SPI internal structure
2.2 SPI Design Principles
SPI interface is a kind of synchronous serial bus, which can transmit data at high speed and reliably under the synchronous clock signal SCK. It is divided into two transmission modes: master and slave (MASTER/SLAVER). The sending bus in the master mode is the receiving bus in the slave mode: correspondingly, the sending bus in the slave mode is the receiving bus in the master mode. They can receive and send data at the same time. And the sending and receiving operations can be completed through interrupts or query methods.
2.2.1 Working clock
The clock polarity CPOL and the clock phase CPHA control the 4 different clock modes on the clock signal pin. After the device is enabled and activated, before data transmission or during the interval between two bytes of data, SCK is at an idle level. The clock polarity control bit can be used to select whether the idle level is 0 or 1: The clock phase control bit is used to select the sampling moment of the data receiving device. At this sampling moment, the online data must meet the two parameters of setup time and hold time at the same time, so the data sending device should move the data out to the data line in advance.
The four different clock modes can provide corresponding transmission protocols to complete data transmission according to the needs of peripherals. There is no priority between them. The master and slave devices on the SPI line must set matching transmission timing modes according to the specific situation. Only when the timing matches can data transmission proceed normally. If the settings do not match, the data receiver and sender may act on the same clock edge, resulting in data output failure.
Figure 2 is the data transmission timing when CPHA=0. It includes both CPOL=0 and CPOL=1. When CPOL=0, the data to be transmitted is sent at the rising edge without delay of the clock signal, and the data is received at the falling edge of the clock signal. When CPOL=1, the data is also transmitted without delay, but the difference is that the data is sent at the falling edge and received at the rising edge. Figure 3 is the data transmission timing when CPHA=1. It is similar to Figure 2, but the sampling time is delayed by half a cycle.
Figure 2 CPHA="0 is the SPI bus data transmission timing"
Figure 3 SPI bus data transmission timing when CPHA="1"
3 SPI Hardware Design
Registers play a decisive role in SPI. Whether in microcontroller interface or SPI control interface, registers are the main components in data transmission and control. The most basic and important unit of registers is the trigger. Only by improving the structure of the trigger can the performance of the entire SPI interface be improved.
Some serial interface designs use a B-structure trigger design, in which a simple MOS tube is used as a switch. Although MOS tubes have the advantages of low power consumption and small area, it is becoming increasingly difficult to increase the circuit operating frequency and switching speed. Moreover, if the input signal is not strong, signal backflow is likely to occur, which requires a higher voltage to control the switch. This is also not conducive to data transmission and reducing power consumption.
In order to solve the various problems caused by MOS tubes as switches, and to achieve high-speed information transmission in the TMS320LF2407 serial interface, this design comprehensively considers the influence of factors such as speed, working voltage, and noise tolerance. A novel trigger structure (Figure 4A) is adopted. Most of the interface circuits in this article use the circuit design of this trigger. The working voltage is reduced to 3.3V, which greatly reduces the overall power consumption; a three-state gate is used in the switch to effectively prevent signal backflow and achieve stable signal transmission; a feedback signal is added, and the required feedback signal can be input again when needed; at the same time, the switching rate is accelerated, and the load-carrying capacity is also enhanced.
Figure 4 Comparison of triggers A and B
4 RTL-level design
As the complexity of digital system design continues to increase, specifying effective design strategies in the early stages of design is crucial for the entire design. The behavioral description method is a description of the system mathematical model. It includes RTL, algorithm level, and system level descriptions. RTL refers to describing the digital circuit system by describing the flow of data between registers. It is a concept of data flow. Data processing between registers is completed by combinational logic. The RTL level is a higher level of abstraction in Verilog. At this level of abstraction, modules can be implemented according to the designed algorithm without considering the specific implementation details.
4.1 Register overall circuit design
The following is part of the Verilog HDL source code. It describes the function settings of the relevant registers during data transmission: first, the initial values of each register during reset, then the function design of the registers, and the design of the interrupt enable and flag bits generated during data transmission.
4.2 Overall Timing Simulation
Compile the above Verilog code and write the corresponding test code for verification. Figure 5 is the overall timing simulation waveform of the register write operation. It verifies that the above code is correct and feasible.
Figure 5 Overall timing simulation of write operation
5 Conclusion
The innovation of the author of this article is to improve the structure of the hardware trigger. The single MOS tube structure is replaced by a tri-state gate and a transmission gate. It is first applied to the serial peripheral interface of the TMS320LF2407 chip, reducing the operating voltage to 3.3V, speeding up data transmission, and providing corresponding feedback signals, further improving the trigger structure. At the same time, it has good portability. It is fully customizable, and this design runs reliably and achieves the expected effect.
Previous article:SOPC Implementation of Low Bit Rate Speech Coding MELP Vocoder
Next article:Design and implementation of high performance MCU based on H.323
- Popular Resources
- Popular amplifiers
- MATLAB and FPGA implementation of wireless communication
- Learn CPLD and Verilog HDL programming technology from scratch_Let beginners easily learn CPLD system design technology through practical methods
- Based on Altera FPGA devices & Verilog HDL language
- Become a design expert easily Verilog HDL examples and detailed explanations with source code
- Huawei's Strategic Department Director Gai Gang: The cumulative installed base of open source Euler operating system exceeds 10 million sets
- Analysis of the application of several common contact parts in high-voltage connectors of new energy vehicles
- Wiring harness durability test and contact voltage drop test method
- Sn-doped CuO nanostructure-based ethanol gas sensor for real-time drunk driving detection in vehicles
- Design considerations for automotive battery wiring harness
- Do you know all the various motors commonly used in automotive electronics?
- What are the functions of the Internet of Vehicles? What are the uses and benefits of the Internet of Vehicles?
- Power Inverter - A critical safety system for electric vehicles
- Analysis of the information security mechanism of AUTOSAR, the automotive embedded software framework
Professor at Beihang University, dedicated to promoting microcontrollers and embedded systems for over 20 years.
- Innolux's intelligent steer-by-wire solution makes cars smarter and safer
- 8051 MCU - Parity Check
- How to efficiently balance the sensitivity of tactile sensing interfaces
- What should I do if the servo motor shakes? What causes the servo motor to shake quickly?
- 【Brushless Motor】Analysis of three-phase BLDC motor and sharing of two popular development boards
- Midea Industrial Technology's subsidiaries Clou Electronics and Hekang New Energy jointly appeared at the Munich Battery Energy Storage Exhibition and Solar Energy Exhibition
- Guoxin Sichen | Application of ferroelectric memory PB85RS2MC in power battery management, with a capacity of 2M
- Analysis of common faults of frequency converter
- In a head-on competition with Qualcomm, what kind of cockpit products has Intel come up with?
- Dalian Rongke's all-vanadium liquid flow battery energy storage equipment industrialization project has entered the sprint stage before production
- Allegro MicroSystems Introduces Advanced Magnetic and Inductive Position Sensing Solutions at Electronica 2024
- Car key in the left hand, liveness detection radar in the right hand, UWB is imperative for cars!
- After a decade of rapid development, domestic CIS has entered the market
- Aegis Dagger Battery + Thor EM-i Super Hybrid, Geely New Energy has thrown out two "king bombs"
- A brief discussion on functional safety - fault, error, and failure
- In the smart car 2.0 cycle, these core industry chains are facing major opportunities!
- The United States and Japan are developing new batteries. CATL faces challenges? How should China's new energy battery industry respond?
- Murata launches high-precision 6-axis inertial sensor for automobiles
- Ford patents pre-charge alarm to help save costs and respond to emergencies
- New real-time microcontroller system from Texas Instruments enables smarter processing in automotive and industrial applications
- Automotive bus system
- On May 5th, celebrate the Dragon Boat Festival, row dragon boats and play drums
- How 5G will impact the Internet of Things
- Powering Alternative Transportation Using Industrial Battery Packs
- Verilog implements instrument display regulator
- EEWORLD University ---- Power Stage: High Performance Parameters and Selection of MOSFET and Gate Driver
- Help: The solenoid valve coil controlled by DC 24V is open
- 【GD32E231 DIY】Temperature and humidity collection
- Urgent help, AD17 via setting problem?
- Capacitor charging time, MOS gate drive, TL431 reference, op amp followed by ADC sampling, composite tube and complementary push-pull advantages and disadvantages