当前位置:网站首页>Programming features of ISP, IAP, ICP, JTAG and SWD

Programming features of ISP, IAP, ICP, JTAG and SWD

2022-07-07 10:11:00 m0_ fifty-nine million nine hundred and forty-nine thousand fou

  Electronic engineers all know , Semiconductor technology is developing rapidly , It has driven the continuous upgrading of various chip technologies . In terms of data storage , From the original mask ROM, To the present Flash technology , Continuous improvement of storage technology , The corresponding programming technology is also developing .

        I remember the older generation of engineers writing 51 When the single-chip microcomputer is used, it still uses a huge programmer to download the program , And it's disposable (OTP), Every time I carefully debug the code and then download it to see the effect . Now it is as simple as a serial port downloader to realize program download , There is basically no need to consider the problem of programming times , Compile and download updates whenever you have an idea .

  In the course of this development , Many programming techniques have also been born , such as ISP、IAP、ICP, And then there is JTAG Programming 、SWD Programming 、UART Programming and so on . Those who play SCM should be familiar with these words , But what's the difference between them ? First, let's look at their definitions :

        ISP:In System Programing, In system programming

        ICP:In Circuit Programing, In circuit programming

        IAP:In Application Programing, In application programming

        JTAG Programming : adopt JTAG Protocol programming

        SWD Programming : adopt SWD Protocol programming

        UART Programming : adopt UART Programming

        It looks like a mess , In fact, if the hierarchical relationship between them is clear, it will not be messy . Use a picture to visualize :

See from the graph ,ISP and ICP It's the technology at the top . It describes a programming structure , The protocol used 、 Communication port, etc , Different chips have different definitions .

        IAP In the second floor , Is a way of programming . The implementation method is to download a piece of executable code of the target chip to the chip through some communication protocol RAM And executed by the chip , The specific operation is realized by this code to achieve the purpose of programming . This method requires the chip to support the chip through a certain communication protocol RAM Read and write and be able to control its CPU. This is a programming method under the programming structure , image AK100Pro、SmartPRO 5000U-Plus Wait for the burner , All use this programming method .

        At the bottom is the hardware communication protocol ,UART It is the first serial communication technology used in single chip microcomputer .JTAG and SWD yes ARM After the rise of kernel chips , Gradually popular , These three technologies describe the communication protocol used by the hardware layer in the programming process , Are some of the lowest technical specifications .

        Use a table to compare the characteristics of these communication protocols :

Synthesize the above contents , as long as UART、JTAG、SWD These hardware communication protocols can ensure the standardization and stability of electrical connection , that ISP、IAP You can program the chip correctly .

Further analysis ISP and IAP Two concepts :

ISP:in system programming, The writer will code Burn in , however , The chip can be on the target board , No need to take it out , When designing the target board, the interface is designed on it , So called " In system programming ", I don't have to leave the system ;
IAP: in applicatin programming In application programming , There's the chip itself ( Or through peripheral chips ) You can use a series of operations to code write in , Like a support Iap The single chip computer of , Internal division 3 A program area ,1 It's the bootstrap area ,2 Run program area ,3 It's a download area , The chip receives the download command through the serial port , Enter the boot area and run the boot program , Under the bootloader, you will new code Download the content to the download area , After downloading and checking, copy the contents of the download area to 2 District , Run the reset program , be Iap complete ;

What is? ISP: 
Use a writer to write code Burn in , however , The chip can be on the target board , No need to take it out , When designing the target board Interface design on top , So called " In system programming ", I don't have to leave the system ; 
What is? IAP: 
In application programming , There's the chip itself ( Or through peripheral chips ) You can use a series of operations to code write in , Like a support Iap Of Single chip microcomputer , Internal division 3 A program area ,1 It's the bootstrap area ,2 Run program area ,3 It's a download area , The chip receives the download command through the serial port , Enter the boot area and run the boot program , Under the bootloader, you will new code Download the content to the download area , After downloading and checking, copy the contents of the download area to 2 District , Run the reset program , be Iap complete ;

applications : 
1,ISP Program upgrade needs to be solved on site , But it's better not to dismantle the machine ; 
2,IAP If there is a network management system , Download everything with the NMS , People don't have to run around , 
This may be their advantage or application

There are two ways to implement online programming : In system programming (ISP) And in application programming (IAP).ISP In general, it is through the special serial programming interface of the single-chip microcomputer to control the internal control of the single-chip microcomputer Flash Memory programming , and IAP Technology is structurally Flash Memory is mapped into two banks , When running a user program on a bank , You can reprogram another memory , And then move control from one storage to another .ISP In general, the implementation of this method needs few external circuits , and IAP The implementation of is more flexible , Usually, the serial port of single chip microcomputer can be used to connect to the computer RS232 mouth , The internal memory is programmed by a specially designed firmware program . ISP and IAP Very similar , There is no need to pull the chip out of the board , That's it PC-MCU Programming interface (JTAG、 A serial port 、 Twisted pair 、SPI etc. ) Fix the purpose of upgrading the new version .MCU Internally, an independent section is executed first Boot Code ( This paragraph Boot Codes are generally factory preset , Or burning with a programmer , Usually only 1k or 4k,SST It usually takes up a separate piece of Block,Philips Usually let BootROM Address and other Flash overlap , To achieve the hidden effect ),Boot Responsible for controlling erasure Program memory And code for programming program memory ( Or execution code provided outside the processor ), Then through some kind of communication with PC The way computers communicate ( Such as ,ether so ), Put a user specified in PC Compiled on MCU A runnable binary code file is programmed into MCU Program memory in .

ISP and IAP The biggest difference is : Who triggers .

ISP Yes 4 Trigger mode :
1. By external hardware circuit : Such as VDD Keep it high , to RST continuity 3 Pulse ;
2. Detection status bit : Such as ISPEN, by 0 when PC Pointer from 0000H Start execution ; by 1 when , adopt “ Guidance vector ” To calculate the “ISP Code ” The location of . This status bit will be detected after each reset ;
3. The abort controller signal triggers the chip to reset : The stop control symbol signal refers to a long signal on the receiving pin of the asynchronous serial port Low level up to one frame length , Here, the length of one frame is related to the working mode of asynchronous serial port .
4. Call directly ISP: User programs can also call , But it's dangerous .

4 The purpose of the two methods is the same —— Get into ISP Subroutines , such as Philips Ex factory ISP The subroutine is in 1E00H-1FFFH, As long as you can guide PC Pointer to 1E00H That's all right. .

And enter ISP The purpose of the code is : Get into BootROM.

IAP The trigger of is simpler , No external triggers . Through some indicator bits (SST by SC0/SC1、SFCF[1,0];Philips For a paragraph IAP Subroutines , Save in FF00H~FFFFH In the address space ), Reach and guide to BootROM Purpose .

All roads lead to Rome ,ISP、IAP Enter BootROM What resides inside Boot Code , That's the ultimate goal .

The last one : Parallel programming mode . Unwanted BootROM, Directly set multiple pins of the chip to make the chip recognize commands ( Such as : erase 、 write in 、 Validation etc. ), from P Oral address 、 data , You can write Flash

use LPC2000 Of IAP, Assign it yourself FLASH Space , To specify a BLOCK Used to store your data , And then through IAP Write operation . After every boot up , From this BLOCK Read your data

原网站

版权声明
本文为[m0_ fifty-nine million nine hundred and forty-nine thousand fou]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/188/202207070729211978.html