UART communication of PIC32 microcontroller under MIPS architecture

Publisher:advancement4Latest update time:2010-08-14 Source: 单片机与嵌入式系统 Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

1 Introduction to PIC32 Series Microcontrollers

The PIC32 series of microcontrollers are high-performance 32-bit microcontrollers launched by Microchip Technology Inc. (Microchip Technology, USA). They are designed based on the MIPS32 architecture. The currently launched PIC32MX3XX branch is a general-purpose type, the PIC32MX4XX branch has USB functions, the PIC32MX5XX branch has USB and CAN functions, the PIC32MX6XX branch has USB and Ethernet functions, and the PICMX7XX branch has USB, CAN and Ethernet functions. The PIC32 series of microcontrollers adopts Harvard structure, with a 5-stage pipeline and a maximum operating frequency of 80 MHz; it has an efficient instruction architecture, high-performance hardware multiplier/accumulator and up to 8 groups of 32 core registers, which can achieve an operating speed of 1.56 DMIPS/MHz. In addition, the PIC32 system has a 64-byte cache for instruction and ROM data prefetch buffers, a 128-bit wide flash memory, which can shorten the instruction fetch time of a single instruction, and supports the MIPSl6e 16-bit instruction set architecture, which can reduce the code by up to 40%.

The PIC32 series of microcontrollers include expandable devices with flash memory ranging from 32 KB to 512 KB, on-chip RAM ranging from 8 KB to 128 KB, and pin-compatible with the 64/100-pin 16-bit microcontroller PIC24FJ-XXXGA series. The newly launched PIC32MX5XX/6XX/7XX provides XBGA packaging. In addition, the PIC32 series of microcontrollers has rich peripheral resources - 5 timers, 16-channel 10-bit A/D converters and communication interfaces, namely SPI, I2C, UART and PMP. At the same time, the PIC32 also has an integrated CRC calculation function and a DMA controller with mode-based transmission terminal selection function. In addition, the PIC32MX5/6/7 series includes 10/100 Mbps Ethernet, CAN2.0b controller, USB host/slave and OTG.

The PIC32 series of microcontrollers are not only faster and more powerful than PIC 8-bit and 16-bit microcontrollers, but also have certain advantages over ARM series 32-bit microcontrollers. Although the highest clock frequency of the MISP 4K that Microc-hip can choose is only 80 MHz, due to the simplicity of the MIPS core, many processor evaluation agencies have confirmed that the overall processing power of PIC32 is higher, and most of the instructions of PI-C32 are single-cycle instructions, which are faster than multi-cycle instructions. The PIC32 series of microcontrollers has up to 128 KB of RAM, which makes it more advantageous in data processing. Microchip also has a very unique advantage, that is, all of the company's 8, 16 and 32-bit devices are fully compatible. All of these full-series products use the same development tools, a single development environment, and the software library is also fully compatible, which is more convenient for customers. In addition, Ashling, Green Hills and Hi-Tech provide complete tool chain support, CM-X, Express Logic and others provide RTOS support, EasyGUI, Segger, RamTeX and Micrium and others provide drawing tool support. It is worth mentioning that Microchip has prepared a starter kit and sample source files for developers, and also provides free middleware modules such as USB, TCP/IP protocol stack, and Graphics and FATl6 file system development. The MPLAB C32 compiler of PIC32 includes a software peripheral function library compatible with 16-bit Microchip MCU to make it easier and faster to use peripheral modules. The block diagram of the PIC32 series microcontroller is shown in Figure 1.


Microchip integrated development tools support all PIC32 microcontrollers, including MPLAB integrated development environment (IDE), MPLAB C32 C compiler, MPLAB REAL ICE simulation system, MPLAB ICD2 online debugger and Explore 16 development board. PIC32 series microcontrollers require MPLAB IDE version 8.0 or above. The latest version is 8.43. The MPLAB IDE software can be downloaded for free from the official website of Microchip www. microchip. com. MPLAB ICD2 online debugger is a low-priced PIC development tool that can set a single breakpoint and has weak debugging capabilities. MPLAB ICD3 retains backward compatibility with Microchip RJ-11 interface, can easily connect to the target board, and quickly program the device; can have up to 1000 software breakpoints, 2 to 5.5 V operating voltage; can support low-voltage debugging with a minimum of 2.0 V, has high-speed programming capabilities, and is 5 to 15 times faster than MPLAB ICD2. The MPLAB REALICE simulation system can support standard and advanced debugging functions, such as complex breakpoints, application code tracing and data collection, code execution timing and real-time variable monitoring. The newly launched MPLAB PM3 universal device programmer supports programming of all PIC device products and the latest dsPIC30 series. However, the prices of MPLAB REAL ICE, ICD3 and PM3 are relatively expensive. Although ICD2 has limited functions, it is cheap and can realize programming simulation of the PIC32 series. The specific programmers, emulators, compilers supported by each model of PIC32 microcontroller and the PIC series models supported by each version of IDE can be viewed in Configure "Select device..." of MPLAB IDE (version 8.0 or above).

2 P1032 UART serial port programming

The following uses the UART serial port module as an example to describe the development process of PIC32. The circuit principle is shown in Figure 2. Considering the high prices of MPLAB ICD3 and MPLAB REAL ICE emulators, the MPLAB ICD2 with USB port is used (MPLAB IDE supports MPLAB ICD2 with USB port, but not ICD2 with serial port). This experiment uses the MAPLAB IDE8.33 integrated development environment and selects PIC32MX32-0F128H.


In PIC32 programming, the configuration word needs to be configured (mainly the system clock, peripheral clock, etc.). This work can be defined in the program, or the configuration word can be set through the menu Configure | Configuration Bits... in MPLAB IDE; at the same time, the compiler can be selected through Project | Select Language Toolsuite, and the chip model can be selected through Configure | Select Device. Since the MPLAB IDE8.33 integrated development environment program is only an upgrade and improvement of the previous version, developers who have used the MPLAB IDE development environment can easily and quickly master its usage. This experiment uses the MPLAB C32 compiler. Program 1 directly uses the software peripheral function library in the MPLAB C32 compiler to operate the UART; Program 2 uses read and write registers to operate the UART. The program implements the host computer sending data, and the PIC32 microcontroller returns to the host computer after receiving the data.

Reference address:UART communication of PIC32 microcontroller under MIPS architecture

Previous article:Design of the interface between intelligent LCD touch display terminal and single chip microcomputer
Next article:Design of single chip computer firmware upgrade system based on GPRS

Recommended ReadingLatest update time:2024-11-16 16:47

PIC burner-MPLAB IDE v8.70
The PIC programming program uses the official environment - MPLAB IDE v8.70: step: 1. Open MPLAB IDE v8.70 and import the HEX file firmware, as shown below: 2. Select the corresponding chip model, as shown below: 3. Select the chip configuration bit. If there is a configuration in the code, check it, as show
[Microcontroller]
PIC burner-MPLAB IDE v8.70
MPLAB C18 C Compiler Primer (Chinese)
MPLAB C18 C Compiler Getting Started describes how to install/uninstall MPLAB C18 and provides some examples of writing C code for PICmicro® microcontroller applications.
[Analog Electronics]
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号