The SCM application system consists of hardware and software. The carrier of the software is the program memory of the hardware. The program memory uses read-only memory. This memory can still save the program after the power is turned off. After the system is powered on, the CPU can take out these instructions again. carried out. Once the information in the read-only memory (ROM) is written, it cannot be arbitrarily changed. In particular, new contents cannot be written during program running.
It is called read-only memory. Write information to ROM is called ROM programming. According to different programming methods,
Programming in the manufacturing process is implemented by a masking process and is therefore called a mask ROM. The chip has a simple memory structure and high integration, but due to the high masking cost, it is only suitable for mass production.
Programmable ROM (PROM).The chip is shipped without any program information and is written using a separate programmer. However, PROM can only be written once. After writing content, it cannot be modified.
EPROM.Erasing with ultraviolet light, programming with electrical signals. There is a circular window in the middle of the chip housing. When the window is irradiated with ultraviolet light, the original information can be erased. Using the programmer, the debugged program can be written.
E2PROM (EEPROM).Erase with electrical signals and program with electrical signals. Read and write operations on the E2PROM are almost no different from RAM memory, except that the write speed is slower, but information can still be saved after the power is turned off.
Flash ROM.Flash memory (abbreviated as flash memory) is an electronically erasable read-only memory developed on the basis of EPROM and E2PROM. The feature is that the data in its storage unit can be quickly modified online, the number of rewrites is 10,000 times (the ROM has the number of rewrites), the read/write speed is fast, the access time can reach 70ns, and the cost is much lower than that of the E2PROM. Replace E2PROM.
Note: For more information on the memory, please refer to the “Digital Technology Basics†(Fifth Edition) editor Kang Huaguang. Chapter VII, or Electrotechnics (Seventh Edition) (Volume 2) Editor-in-Chief Qin Chuanghuang Chapter 22.
Writer, burner, programmer, downloader, emulator, debugger
Microcontroller programmers (programmers, writers) are tools used to write program code into memory chips or microcontrollers. The programmer mainly modifies the program in the read-only memory. The programmer is usually connected with the computer and then used with the programming software. A typical programmer outline is shown below. The black one in the picture is the integrated circuit socket (also has the download programmer, does not need to take off the chip, involves ISP, ICP, behind introduce) ,Can pass the handle to be able to lock or release the integrated circuit chip placed in it. Locking during programming to ensure good contact and release after programming can replace the next chip.
When the chip is in a dual inline form, it can be programmed by directly inserting it on the carrier. However, if you encounter the various packaged chips shown in the figure below, how can you write it? One way is to use an adapter. The following figure shows the adapters used by various packaged chips.
The downloader (download line) is a tool for writing compiled machine code into the microcontroller. The program is compiled to generate the target code, and then downloaded to the ROM or Flash of the microcontroller through downloading the software and downloader. The downloader mainly controls the programming timing and so on.
Emulator (Debugger) refers to a set of dedicated hardware devices specially designed for debugging microcontroller software. The single-chip microcomputer is identical in structure with the PC, and also includes a basic unit such as a central processor, an input/output interface, and a memory. Therefore, the software structure of a device such as a PC is also similar. Because the MCU needs to debug the software during the software development process, observe the interim results and eliminate the problems in the software. However, due to the application occasions of the SCM, it does not have standard input/output devices and is limited by the storage space. It is also difficult to accommodate special software for debugging the program. Therefore, to debug the SCM software, it is necessary to use the SCM emulator. The MCU emulator has basic input and output devices and software that supports program debugging. This allows the MCU developer to input and modify the program through the MCU emulator, observe the program operation results and intermediate values, and detect and observe the hardware that is compatible with the MCU. , can greatly improve the efficiency and effectiveness of the microcontroller programming. (many emulators have the function of a downloader)
On-chip flash memory programmerFlash memory is an electrically erasable read-only memory. Its main feature is that it can store stored information for a long time without power, and can quickly modify the data in its memory unit online. Its online rewrite function makes it easier for the microcontroller to reprogram and cure the program. At present, many microcontrollers use Flash as on-chip program memory. When the on-chip flash memory meets the requirements, it is not necessary to extend the external program memory.
The following discusses how to write the program that has been debugged into the on-chip flash memory in the AT89S51 microcontroller.
On-chip 4KB flash memory features of AT89S51 microcontroller:
Rewritable life 10,000 times
Data retention time 10 years
Maximum read time 150ns, page programming time 10ns
Has 3 levels of encryption algorithm, making the decryption of AT89S series single-chip computer become impossible, the encryption of the program is greatly strengthened
When the AT89S51 is shipped from the factory, the flash memory is completely blank (each unit is FFH) and can be programmed directly. If it is not completely blank (there are FFHs ​​in the cell), the chip should be erased before writing the program. (Some microcontrollers will fix a bootloader code in the ROM before leaving the factory. Its role is to initialize and boot the system before starting the operating system, and to load the program we have downloaded in memory into RAM and return control to it. System is like a BIOS on a PC. ROM programming is not directly related to Bootloader.)
The on-chip flash memory has two types of chips: low voltage programming (Vpp=5V) and high voltage programming (Vpp=12V). Low-voltage programming can be used for in-circuit programming, and high-voltage programming is compatible with commonly used EPROM programmers. The programming mark of low voltage programming or high voltage programming is marked on the package surface of the AT89S51 chip. The programming voltage of different MCUs depends on the data sheet.
After the application is debugged in the PC with the in-circuit emulator and the user's target board, the debugged program code file (.HEX target file) in the PC must be written into the AT89S51 on-chip flash memory. At present, there are two main programming methods: one is to use a universal programmer and the other is to use a download programmer to program.
Universal ProgrammerUniversal programmers are programmers that can be used universally by different devices (such as different company productions, different architectures). It is a subcategory of the programmer's functional classification, in contrast to a dedicated programmer. In terms of hardware, the general-purpose programmer's pin driver uses a general-purpose structure with various functions. It only needs to update the software to support the new device, and has good flexibility to meet current and future device needs. Generally, each pin of the universal programmer locker can be used as a clock signal, a data bus, an address bus, a control bus, a ground wire, a power supply line, a VCCQ voltage, a VPP programming voltage, a dedicated pin for a bad pin contact measurement, and the like. Drive voltage can be adjusted from 1.8V-25.0V, at least 256 levels.
Download programmer (self-understanding)
Common download programmer
ISPro Download Programmer, ISP Programmer, ICP Programmer, ISP-ICP Programmer...
Several programming methodsICP (In Circuit Programing): In Circuit Programming (SCM can write programs, including bootloader)
ISP (In System Programing): In the system programming (MCU power-on plus crystal, bootloader boot, you can write to the application)
IAP (In ApplicaTIon Programing): In the application programming (in the normal operation of the microcontroller, the internal program rewrites the data locally to the microcontroller)
ICP, ISP, IAP detailsISP means that it can be programmed at the board level without removing the chip and putting it into the writer, ie not leaving the system. So it is called “in-system programmingâ€. It is the erasing and writing of the entire program. The microcontroller's internal flash memory is programmed through the microcontroller's dedicated serial programming interface. Even if the chip is soldered on the circuit board, the serial port can be programmed with the upper computer interface. (The chip generally cures the boot program for ISP upgrade)
The IAP is also programmed at the board level. The MCU acquires new code and reprograms a part of the program. The program can be used to change the program. Part of the program is modified to achieve the purpose of upgrading and eliminating bugs without affecting the rest of the system. During the programming process, the program can continue to run. In addition, the interface program is self-written, so that it can be remotely upgraded without affecting the application. The implementation of IAP is more flexible. Usually, the serial port of the microcontroller can be used to connect to the RS232 port of the computer, and the internal memory can be programmed through a specially designed firmware program. (Usually write a bootloader program yourself) (Note: Sometimes the difference between ISP/IAP is not so clear!)
ICP in circuit programming, ICP (In-circuit programmer), in the circuit programming method allows the use of commercial programmers to achieve programming and erase functions without removing the microcontroller from the system, can be completely completed by the microcontroller hardware, No external guide is required. (Baidu)
ISP, IAP applications1, ISP program upgrades need to be resolved on site, but it is better not to disassemble the machine.
2, IAP If there is a network management system, download everything with a network management, people do not have to run around.
There are currently two ways to implement in-circuit programming: In-System Programming (ISP) and In-Application Programming (IAP). The ISP generally programs the flash memory inside the microcontroller through a single-chip serial programming interface. The IAP technology maps the flash memory into two memory banks from the structure. When running a user program on a memory bank, the ISP can Another memory bank is reprogrammed and then transfers control from one bank to another. The implementation of ISP generally requires little external circuit-assisted implementation, and IAP implementation is more flexible. Usually, the serial port of the microcontroller can be used to connect to the RS232 port of the computer and the internal memory can be programmed through a specially designed firmware program. ISP and IAP are very similar, do not need to pull the chip out of the board, to achieve the purpose of using the PC-MCU programming interface (JTAG, serial port, twisted pair, SPI, etc.) to get the new version of the upgrade. In the MCU, a separate boot code is executed first. (The boot code is usually factory preset, or programmed using a programmer. Usually only 1k or 4k. SST usually occupies an independent block. Philips usually makes BootROM. The address is overlapped with other flashes to achieve the hidden effect.) Boot is responsible for controlling the program memory erasure and the code for programming the program memory (or the execution code provided by the processor), and then through some kind of communication with the PC computer ( For example, the ethernet port) will be the one specified by the user on the PC
PCB Spring Terminal Block Section
PCB Spring Terminal Block
It is a new type of terminal block with spring device, which has been widely used in the world's electrical and electronic engineering industry: lighting, elevator lifting control, instruments, power supply, chemistry and automobile power, etc.
Spring type terminal block
Spring type PCB terminal, the connection mode is divided into cage spring connection and butterfly spring connection, which is fast and convenient for wiring and improves the operation efficiency.
It can be used to connect all types of conductors with cross-section of 0.2mm to 16mm, with spacing of 2.5mm-15.0mm.
PCB Spring Terminal Block
ShenZhen Antenk Electronics Co,Ltd , https://www.pcbsocket.com