1 In-circuit serial programming
1.1 In-circuit serial programming interface
PIC microcontrollers with Flash memory generally have an online serial programming function, which only requires 5 wires to download the program to the Flash program memory of the microcontroller. The arrangement order of these 5 wires is MCLR/Vpp, Vdd, Vss, PD (or PGD) and PC (or PGC). Figure 1 is a diagram of the online serial programming interface of the PIC microcontroller.
Figure 1 PIC microcontroller online serial programming interface
1.2 Pin meaning
The specific meanings of the above five pins are: MCLR/Vpp - programming voltage (generally around 13 V for PIC microcontrollers); Vdd - programming power supply (5 V); Vss - ground; PD - programming data signal; PC - programming clock signal.
With this programming connection circuit, only appropriate programming hardware circuit and programming software are needed to realize online serial programming and debugging of the microcontroller.
2 Online Debugger
2.1 Connection between the online debugger and the target board
The first generation of online debugger launched by Microchip is named MPLAB ICD, which supports online debugging and burning of PIC16F87X series microcontrollers, and has reliable performance, simple and convenient use. Based on MPLAB ICD, Microchip launched the second generation of online debugger named MPLAB ICD2 (hereinafter referred to as ICD2), which supports online debugging and burning of the full series of PIC Flash memory microcontrollers, and even supports online debugging and burning of Microchip's 16-bit microcontroller dsPIC. The connection between ICD2 online debugger and target board is shown in Figure 2. String 5
Figure 2 only shows the connection between the three important signals of ICD2, MCLR/Vpp, PGD and PGC, and the target board. ICD2's Vdd and Vss are connected to the target board in the normal way. If there are AVdd (analog power) and AVss (analog ground) on the target board, AVdd and AVss must also be connected to their corresponding power and ground on the target board. No power and ground pins can be left hanging to ensure that ICD2 can work normally during debugging.
2.2Problems that may occur with PGC and PGD signals
① As can be seen from Figure 2, the PGC and PGD pins of ICD2 are already connected to 4.7 kΩ pull-down resistors. Therefore, when users design circuit boards, these two pins on the circuit board should not be connected to pull-down resistors to avoid causing incorrect electrical levels.
② PGC and PGD are signal pins. For these two pins, there must not be any capacitors or other capacitive devices connected between ICD2 and the target board, otherwise it will affect the transmission of serial data and clock signals. PGC and PGD signals are bidirectional transmission signals. There must not be any diodes or other components blocking signal transmission between ICD2 and the target board.
2.3 Reset
MCLR/Vpp is the ICD2 programming voltage pin. The voltage should be around 13 V during programming. Another function of this pin is reset. We know that any microcontroller can cause a reset when powered on or in some other special circumstances. The reset of the microcontroller, power supply and crystal oscillation are the three necessary conditions for the microcontroller to enter normal operation. Therefore, the following issues should be noted.
① Do not connect a large capacitor, otherwise Vdd (power supply voltage) cannot be established quickly, affecting the reset. String 5
② A reset resistor of less than 10 kΩ should be connected in series between the Vdd (power supply voltage) and MCLR/Vpp of the target board, so that the MCLR/Vpp pin of the target board can be pulled down normally during reset, and the programming voltage can be maintained at around 13 V during programming.
Figure 2 Connection between the in-circuit debugger and the target board
③ The reset resistor cannot be too large and must be less than 10 kΩ. According to the author's experience, for PIC16F87X series microcontrollers, normal reset can be achieved when the reset resistor is 10 kΩ or less; for PIC18FXX2 series microcontrollers, normal reset cannot be achieved when the reset resistor is 10 kΩ, and normal reset can be achieved by replacing it with a resistor of about 4.7 kΩ.
2.4 Application Practice
Due to the practicality and low price of ICD2, more and more users are using ICD2 online debugger. In the process of connecting ICD2 with the target board, it is very easy to have problems of one kind or another. For beginners and users who make their own target board, it is especially important to make a reliable connection between ICD2 and the target board. The so-called reliable connection means good contact. When making a target board, users should follow the descriptions in Sections 2.2 and 2.3 of this article. The target board produced can generally achieve normal connection with ICD2.
When the target board made by the user is connected to ICD2, if the connection fails, beginners, due to lack of practical experience, often cannot determine where the problem is, and even suspect that there is a problem with ICD2. At this time, you should first determine whether there is a problem with the target board. If there is no problem with the target board, you can only suspect that there is a problem with ICD2 itself or the connection between ICD2 and the computer.
String 1
Conclusion
This article focuses on the connection between the in-circuit debugger and the target board, reset, and solutions to problems that may arise. It has very strong practical and reference value and is hoped to attract the attention of readers who use in-circuit debuggers and save debugging time.
References
1 Wu Feng, Chen Xinjian. Introduction to PIC Microcontroller C Language Development. Beijing: Beijing University of Aeronautics and Astronautics Press, 2005
2 Zhang Mingfeng. Introduction and Practice of PIC Microcontroller. Beijing: Beijing University of Aeronautics and Astronautics Press, 2004
Chen Xinjian: Engineer, his main research direction is single chip microcomputer, hydraulic measurement automation and gate and dam safety monitoring automation.
Wu Feng: Senior Engineer, his main research direction is single chip microcomputer, hydraulic measurement automation and gate and pump station computer monitoring.
Previous article:Using BootLoader to Upgrade Online in PIC18 Microcontroller
Next article:Hot water controller based on PIC microcontroller
- Popular Resources
- Popular amplifiers
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
- I would like to ask you how to use timequest to analyze the delay time of the delay chain in FPGA.
- [Qinheng Trial] Experience of CH549 capacitive touch function
- Raspberry Pi PICO low-resolution thermal imager
- Why does the power consumption of stm32L0 increase after it enters STOP mode again after being woken up by an external interrupt in STOP mode?
- [TI millimeter wave radar evaluation]_4_boost board evaluation encountered problems 2
- Using registers to do STM8 UART1 error request help
- BearPi-HM Nano Development Board Review 0 Unboxing and Development Environment Setup
- Let's discuss how many people you think should be invited.
- Qinheng CH37X series interface chip application reference example
- I found another DK IOT STUDIO online IDE that runs RAPID IOT. I guess they are the same but distributed on different websites.