As the name suggests, ICSP is a programming method, that is, a burning method. This method can be burned online, that is, it can be burned on the board without removing the chip. And this burning method uses serial data. Online burning is actually not news. The TI DSP that everyone is familiar with can always be burned using the JTAG port, which is the standard online burning.
ICSP of MC is very convenient to use. To use ICSP for programming, you only need to use 5 pins on the chip, including VDD VSS. These two power supplies must be supplied. Then there is the VPP programming voltage. This is certain. To program FLASH, of course, a higher voltage is required. Then there are the two input data and clock pins. Generally, they are RB6 and RB7 of PORTB port. Of course, for those chips that do not distinguish PORT but only GPIO, please refer to DATASHEET to find the corresponding ICSP port. In other words, in fact, there are only two pins related to programming data. It is a standard serial style, haha.
The official MICROCHIP did not say much about the principle, but only gave a Programming Specification for each chip. The above details the specific forms of each instruction for operating the storage space in the chip when the chip is connected via ICSP. From those documents, we can simply assume that in the PIC chip, in the programming mode, there is a "processing interface" between the FLASHROM and the external interface. The interface receives commands from the outside in a serial manner, performs the operations required by the external device after shift decoding, and then outputs the results in a serial manner if the results are required. Of course, in fact, this so-called interface may be just a circuit. But what is certain is that FLASH is not exposed to the outside and directly connected to the outside world, but must first be connected to the ICSP module before it can be connected to the outside world.
This has an advantage, which is the issue of encryption security. Because FLASHROM is not directly connected to the outside world, if the outside world wants to read the contents inside FLASHROM, it must normally go through the ICSP module. If the ICSP module detects that the encryption bit is set, it will refuse to execute the corresponding external read command and return all 0 values. But in fact, the data is not encrypted inside the chip, so normal program access will not be interfered with.
Haha, but actually, I think all current chips should be encrypted in this principle. Otherwise, it would be a bit difficult to let the software realize soft decryption and then execute it. . Then there are several disadvantages of chips encrypted in this principle. The first is that the data is not encrypted in FLASHROM. In other words, the security of the data depends entirely on the security of the ICSP module. If there is any inconsideration in the design of the ICSP module, then the program is basically equivalent to not being encrypted. . In fact, the ICSP module design of some old MICROCHIP products has problems. I have a decrypted 16F73 chip in my hand, and it is said that it only uses some very simple techniques to bypass ICSP encryption. . . In addition, because the data is not encrypted, physical decryption is still undefendable. As long as others can reach your FLASHROM area, your program will be cracked. There is no way to solve this problem. At present, all microcontrollers will have this problem. But it seems that TI's DSP has done a very good job in this area. According to predecessors: TI's DSP kernel is two-layer, the upper layer is the application and processing layer, and the lower layer is the FLASHROM layer. In this way, even if the core is taken out by physical method, it will be impossible to remove the upper layer and expose the lower layer of FLASHROM because the core is two layers. This greatly enhances the security of the chip. Of course, it also greatly increases the cost.
Another point to add is that the ICSP method is extremely simple to implement externally, as long as it can provide signals that fully comply with the Programming Specification. Therefore, you can see many kinds of homemade programmers on the Internet. They are no different from the original PICSTART+ in use - in fact, there are also homemade PICSTART+. . . - And when a new chip comes out, the programmer can be easily upgraded, just rewrite the code of the chip inside the programmer and add the programming command code of the new chip. The internal chip of the programmer. . is generally PIC. . . It can be upgraded by ICSP. . . Hmm. . Use ICSP to upgrade the PIC to support the ICSP of the new PIC. . Doesn't it sound like a tongue twister? Haha. .
So, how should ICSP be used specifically? Haha, this is a good question. First of all, we have to explain that, except for some very old products such as the 16C5X series, almost all MICROCHIP chips use ICSP technology. Moreover, as long as ICSP technology is used, ICSP must be used when burning. In other words: when burning the chip, although it seems that all 28pins or 40pins of the chip are placed on the chip holder of the burner, in fact, only those 5 pins are in effect. . . It's surprising, haha. Sometimes some things are so magical. Take a look at the schematic diagram of the homemade burner and you will understand~
Then, if we really use it on the board, we just need to bring out the 5 pins we need, and then we can use ICSP. However, there are of course some things that need to be paid attention to: First, the VPP pin, which is the MCLR pin of the chip, is usually pin 1, and there will be a voltage of about 13V during programming. Since this pin is generally connected to a 5V power supply circuit during design, it is necessary to ensure that the 13V voltage of the programming will not flow back to the 5V power supply circuit to cause damage. Moreover, according to the Programming Specification, the timing of adding voltage to VDD and VPP during programming needs to be guaranteed, so there should not be too much capacitive load on VPP to avoid causing the voltage rise time to be too slow and thus affecting the programming. On the other hand, the programmer will supply the chip with 5V power, so generally there is no need to power it externally. However, the power supply capacity of general programmers is limited, which is said to be at the level of a few mA. Even industrial-grade programmers such as PROMATE II that have their own dedicated ICSP port have an output current of only a few dozen mA. Therefore, if your board has a high working current, you need to power it yourself, or design the chip's power supply circuit to be isolable. When programming, disconnect the chip's VDD from the external power supply, and only supply the chip with power from the programmer. Then, as the ICSP data path, RB6 and RB7 should also be isolated from the external circuit when programming, to ensure that the clock and data transmitted on them are not distorted by external circuit interference. In addition, when using, you must ensure that your ICSP connection line and chip are directly connected, and there must be no one-way path components such as diodes, otherwise it will cause abnormal phenomena such as chip recognition.
On the other hand, for the connection of the programmer, a professional-grade programmer will provide an ICSP interface, which should be a 5-core cable that can be connected to the target board. If there is no such expensive professional programmer, and only a simple one, you can consider making a conversion cable yourself, which is a double-row pin connector with 28 or 40 pins on one end (for example, a 28pin or 40pin chip holder is a good choice), and then connect the corresponding pins of these pins to make a 5-core cable for use. This type of adapter cable should be especially noted: First, do not insert the double-row pin connector on the programmer in reverse when using it. . If it is inserted in reverse, it will definitely have no effect. . . Second, due to limited load capacity, it is recommended that the line length should not exceed 20cm.
Regarding the ICSP line, I may do some experiments in the near future, because the company's programmer is PICSTART, and I plan to use a SMD PIC, so ICSP is necessary. So a conversion line is necessary... If it is successfully realized, I will try to write down the production method and precautions. Hehe
Actually, ICSP feels like an integrated BOOTLOADER. It's just that ICSP is not needed in normal use, unlike BOOTLOADER, which needs to load external code into memory in normal use. And ICSP is still a little good for encryption. But it still seems a little fragile. Haha. But the newer the chip, the safer its ICSP module should be. You may also pay attention to it when choosing.
Finally, by the way, if you really think that ICSP is very fragile and can be cracked by non-physical means, then we can use a ruthless trick: the soul of ICSP lies in RB6 and RB7, so when designing a program, do not use these two pins in the program. Then, after the programming is completed, use methods such as increasing the current on these two pins to directly scrap the internal circuit, that is, burn these two pins directly. Then, congratulations, the FLASHROM of your chip should no longer be accessible using software methods, including you yourself can no longer burn it. This chip is currently a chip that cannot be accessed by the outside world and can only work on its own ~ hehe...
Previous article:PIC's program counter PC
Next article:Software and hardware design of an intrusion detection device
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
- Application of TI current detection device INA series in TWS battery box
- Now we need to produce a batch of calibration cards (EEPROM 24C128 + pull-up resistors for SCL and SDA signals, a total of three components...
- CAN (Controller Area Network) bus batch data transmission based on SAEJ1939 wireless communication data transmission protocol
- Power supply output power problem
- STM32MP157A-DK1 Evaluation (4) UART and SPI Device Access
- WLAN radio frequency and channels
- What kind of IoT card is reliable?
- Practical Tips | How to learn hardware design well? Experts teach you from theory to practice
- Overcoming the Design Challenges of Low Quiescent Current in Small Battery-Powered Devices
- Implementation of high-precision division in fixed-point DSP