MCU download files: the difference between HEX files and BIN files

Publisher:JoyfulHeartedLatest update time:2017-11-11 Source: eefocusKeywords:MCU Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

After the MCU program is written, we have to download the program to the MCU memory, so that the MCU can execute commands according to the programmer's logic to realize the function. We have talked about several ways to download MCU before, such as ISP download and JTAG download. The most common format of the download file is hex file, which everyone knows. There is also a bin file which is the download file of the MCU. The following introduces the difference between these two formats.

HEX files and BIN files are two file formats we often encounter. Here is a brief introduction to the differences between these two file formats:

1. The hex file contains address information. When burning the program in ISP mode, we all have the following experience: 1) Select the microcontroller model; 2) Select the serial port number; 3) Set the baud rate (or default); 4) Select the file to download; 5) Click the download button to download. As shown in the figure below.

MCU download files: the difference between HEX files and BIN files [Reprinted]

After these steps, the program download is completed. In the above steps, we did not choose which memory of the microcontroller to download the program to, that is, there is no need to set the address. Because the information inside the HEX file already includes the address. When burning the BIN file, the user must specify the address information. The microcontroller downloads more hex files.

2. The BIN file format only includes the data itself, not the address

The bin file itself is just data and does not contain address information, so when downloading the bin file, you need to select the starting address and ending address of the memory, that is, download the bin file to the specified memory space. Usually, the chips that need to specify the program memory address are ARM chips and DSP chips.

3. The sizes of HEX files and BIN files are different

For bin files, the file size you see by right-clicking the file properties is the actual size of the data. For HEX files, the file size you see is not the actual size of the data. One reason is that HEX files use ASCII to represent data, and the other is that HEX files themselves include other additional information.


Keywords:MCU Reference address:MCU download files: the difference between HEX files and BIN files

Previous article:MCU Program: Actual size of HEX file
Next article:How to quickly master an MCU, you can start from these aspects

Recommended ReadingLatest update time:2024-11-16 13:42

51 single chip microcomputer to realize the water lamp
  Before implementing the running light, we need to mention that before writing the C51 code, you need to refer to the circuit diagram. Take the running light as an example. Let's look at Figure 2. The positive poles of the eight LEDs are connected to the +5V voltage through a bus. Looking at Figure 1 again, we can
[Microcontroller]
51 single chip microcomputer to realize the water lamp
High torque permanent magnet synchronous motor drive system based on STM32 microcontroller
0 Introduction The high-torque permanent magnet synchronous motor direct drive eliminates the disadvantages of low efficiency, frequent maintenance, large noise and rotational inertia caused by the mechanical structure by removing the complex mechanical transmission mechanism. It has a series of outstanding advantag
[Microcontroller]
High torque permanent magnet synchronous motor drive system based on STM32 microcontroller
Based on the AD conversion program of STC15w microcontroller series
The 15W series is the processor with the most available resources in the current 51 MCU. It can be used in general designs. This time, I will share a digital voltmeter using the AD conversion socket that comes with the MCU. The LCD1602 used for display The microcontroller source program is as follows: #include 15w.H
[Microcontroller]
8051 MCU (STC89C52) eight LED lights flashing
#include STC89C5xRC.h void delay() {     int i,j;     for(i=0;i 200;i++)           for(j=0;j =200;j++)           {                  ;           } } int main() {     while(1)     {         P2 = 0xff; //Eight lights off         delay();            P2 = 0; //Eight lights on         delay();     } }
[Microcontroller]
Sharing of PIC microcontroller programming experience
PIC microcontroller (Peripheral Interface Controller) is an integrated circuit (IC) used to develop and control peripheral devices. It is a CPU with decentralized (multi-tasking) functions. This content describes the learning of programming in PIC microcontrollers. 1. The basic format of PIC microcontroller program
[Microcontroller]
Sharing of PIC microcontroller programming experience
Design of intelligent photoelectric knob using single chip microcomputer as control core
    At present, when designing the control panel of the instrument, various buttons are mainly used to generate control signals by detecting whether the buttons are pressed. However, in some occasions where control signals need to be generated continuously, the use of buttons may bring inconvenience in operation. More
[Microcontroller]
Design of intelligent photoelectric knob using single chip microcomputer as control core
MCU C Language Tutorial: C51 Variables
The variable mentioned in class is a quantity whose value can change continuously during the execution of a program. To use a variable in a program, you must first use an identifier as the variable name and indicate the data type and storage mode used, so that the compiler system can allocate the corresponding stora
[Microcontroller]
Using MCU timer to realize signal sampling and PWM control
PWM control is widely used in various control systems, but the adjustment of pulse width is generally implemented by hardware. If a PWM controller is used or a PWM circuit is added to the system , the cost is high, the response speed is slow, and there are compatibility issues between the PWM controller and the system.
[Industrial Control]
Using MCU timer to realize signal sampling and PWM control
Latest Microcontroller Articles
  • Download from the Internet--ARM Getting Started Notes
    A brief introduction: From today on, the ARM notebook of the rookie is open, and it can be regarded as a place to store these notes. Why publish it? Maybe you are interested in it. In fact, the reason for these notes is ...
  • Learn ARM development(22)
    Turning off and on interrupts Interrupts are an efficient dialogue mechanism, but sometimes you don't want to interrupt the program while it is running. For example, when you are printing something, the program suddenly interrupts and another ...
  • Learn ARM development(21)
    First, declare the task pointer, because it will be used later. Task pointer volatile TASK_TCB* volatile g_pCurrentTask = NULL;volatile TASK_TCB* vol ...
  • Learn ARM development(20)
    With the previous Tick interrupt, the basic task switching conditions are ready. However, this "easterly" is also difficult to understand. Only through continuous practice can we understand it. ...
  • Learn ARM development(19)
    After many days of hard work, I finally got the interrupt working. But in order to allow RTOS to use timer interrupts, what kind of interrupts can be implemented in S3C44B0? There are two methods in S3C44B0. ...
  • Learn ARM development(14)
  • Learn ARM development(15)
  • Learn ARM development(16)
  • Learn ARM development(17)
Change More Related Popular Components

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号