ISP function in remote RS485 communication network
After the initial development of MCU application software is completed, the program is typically burned into the ROM or EPROM of the microcontroller using a programmer. This process requires removing the chip from the circuit board, which can be inconvenient during the development phase and also complicates future software updates for the product. With the emergence of newer generations of microcontrollers, those equipped with ISP (In-System Programming) capabilities have become increasingly popular among embedded system developers. The use of ISP has grown significantly due to its convenience and efficiency in programming and reprogramming devices without removing them from the board.
Philips' 89LPC932 is one of the early high-performance microcontrollers that introduced this feature. ISP allows a device on the board to be programmed directly with end-user code without the need to remove it. Additionally, once programmed, the device can be erased or reprogrammed using the same ISP functionality. This greatly simplifies the development and maintenance process, especially in environments where frequent updates are required.
To better understand how the ISP function works, we disassembled the Boot ROM source code (in machine code) of the 89LPC932 and converted it into an ASM file. By analyzing the data processing and communication control mechanisms, we were able to grasp the specific implementation method of the ISP function and adapt it for our own use. The ISP function was implemented within an RS485 communication network, ensuring stable operation under certain conditions.
**1. Analysis of some codes in the Boot ROM**
Here, only the communication part is briefly explained.
**1.1 Determination and verification of automatic baud rate**
The host computer sends an uppercase English character "U" to the lower computer at its own baud rate. The ASCII value of "U" is 55H, which in binary is "01010101B". This represents a sequence of "0" and "1" bits. When the lower computer receives this data, it calculates the time interval between two consecutive "1" bits, which allows it to determine the corresponding communication baud rate.
Below is the assembly language code used for this purpose:
```
EXECHO.
RET ; return
```
Once the baud rate is calculated, the serial port settings are adjusted. A byte is then sent and received, and the received value is compared with the ASCII code of "U". If they match, the program continues; otherwise, it loops and waits. Therefore, to ensure successful communication, the host must send at least two "U" characters to the lower computer.
Hdg And Painted Radiator,Weather Proof Hdg And Painted Radiator,Weather Proof Hdg Radiator With Coating,Leak Free Hdg And Painted Radiator
Shenyang Tiantong Electricity Co., Ltd. , https://www.ttradiator.com