Font Size: a A A

MCU-based UART Design And Verification

Posted on:2021-01-15Degree:MasterType:Thesis
Country:ChinaCandidate:H H WangFull Text:PDF
GTID:2518306047986239Subject:Master of Engineering
Abstract/Summary:PDF Full Text Request
MCU is a micro chip that integrates a central processing unit,memory,and various I / O interfaces.It has strong versatility and widely used in many fields such as industrial control and automotive electronics.In recent years,with the rise of artificial intelligence,driverless and other fields,higher requirements have been placed on the development of MCU.As a serial communication device,UART is an important device for serial data communication in MCU and computer.UART can realize serial-parallel conversion of data.When receiving data,serial data is received bit by bit and converted into parallel data and stored in the buffer.When sending data,parallel data is converted into serial data and the start bit,stop bits and other flags are added and sent bit by bit.This design comes from the company’s MCU project during the internship.Design a UART communication module based on STM32 MCU to meet the full-duplex communication,configurable data word count,error check,interrupt generation and other communications at different baud rates claim.This design is based on the UART communication protocol and transmission principle.Based on the research on the working principle of the UART,the UART communication module is divided into functions,including register module,sending module,receiving module,baud rate generating module,and interrupt control.Design the UART according to the module.Based on the AMBA bus protocol and APB bus transmission timing,the interface between the UART and the APB bus is designed to enable it to perform data transmission with the APB bus.The receiving module and the transmitting module of the UART adopt the design method of the finite state machine to realize the correct reception and transmission of data,and at the same time,the problem of the cross-clock domain signal between the modules is solved;the baud rate generation module adopts the two-stage counting design method,to achieve the generation of multiple baud rates.Based on the correct design of the functions of each module and the correct connection of each module,the design of the UART communication module based on the MCU in accordance with the APB bus transmission protocol was realized.This design not only implements the most basic full-duplex communication function,but also implements functions such as programmable data bytes,receive error detection,silent mode wake-up,and multiple error interrupts,laying a solid foundation for subsequent verification work.Based on the completion of the UART design,the UVL verification methodologies are used to verify the RTL code.Based on the research of System Verilog language and UVM verification methodology,the overall structure of UVM verification platform and the design of each component module are carried out.The driver module in the UVM verification platform is designed based on the APB bus timing,so that when the driver is driven,it can send the excitation according to the APB bus transmission timing;use the System Verilog language to design the reference model module,so that it can achieve the design under test The same function is used as a reference for verification.Based on the correct establishment of the UART-oriented UVM verification platform,the design code is verified with reference to the function points of the design,and the coverage is collected.The design and verification results show that the UART communication module designed this time can correctly receive and send data,and the data word length can be configured according to requirements;correct operation and feedback can be performed on error conditions during reception;data transmission occurs When an error occurs,a corresponding interrupt signal can be generated according to the configuration requirements.The design requirements have been met to achieve the expected design goals.
Keywords/Search Tags:MCU, UART, APB bus, UVM
PDF Full Text Request
Related items