In this section we will see how to write and execute programs for 8051 microcontroller using the Keil Software.
So, timer0 ISR function will be called again after 25% time, and then it will make PWM pin low and load a time of 75% in the timer0 registers. This cycle continuous forever. After loading new value in the timer0 registers and clearing the interrupt flag bit, timer0 starts again with the statement TR0 = 1.
Download Keil
Here is the download link of Keil. You can download it and install it very easily. We are using C51 version for 8051 devices.
Use Keil to write programs for 8051 Microcontroller
Start the Keil software. Go to the Project > New Project then choose a location to store your program, and give a name and Save.
Now in the next window select the device from different manufacturers. We are selecting Microchip, and then by expanding we are selecting AT89C51 device and click ok.
Now go to the New in the menu and select New. It will open a new editor to write code.
Go to the save option and save the program file with .c extension.
Write the code for 8051 Microcontroller. (Here we are using a code for blinking LED in 500 ms)
Now from the left panel, select Source Group 1, and Add Existing Files to Group ‘Source Group 1’. Then select the program (c file) then add and close .
Now go to the Project > Build Target to build the project. If there is some error the building will be failed, after correcting the errors it can be build.
Now click on the Target1 from the left panel and select Options for Target ‘Target1’. Then set the xtal (MHz) value to 11.0592. Check mark on the Use On Chip ROM. Then go to the output tab. In this tab check Create Hex File, and click OK. Then build it again.
By uploading this hex file into the 8051 microcontroller the program can be loaded into it. And it will work.
Here we have used the following code −
The connection is like below
This Project will show you how to Burn Hex File For Atmel Microcontroller using Arduino Uno.
11,234 views
2 comments
19 respects
Components and supplies
Necessary tools and machines
Soldering iron (generic)
Apps and online services
About this project
In this Tutorial I will show you how to Burn Your Hex File To AT89c52 using Arduino Uno in just few easy steps. For this we have to interface AT89c52 to Arduino Uno and give it led indications via interfacing LED to At89c52.
Step 1: Bill Of Materials
Arduino UNO
AT89C52 Microcontroller
10uF Capacitor
Jumper Wires
8.2kohm Resistor
510 ohm Capacitor
LED
12 MHz Crystal
2 x 33pF Capacitor
Step 2: Connecting Microcontroller
Connect the micro controller as mentioned below:
At89c52 Arduino Uno
Pin 6 Pin 5
Pin 7 Pin 4
Pin 8 Pin 3
Pin 9 Pin 2
Step 3: Crystal
Connect a Crystal across Pin 18 and 19 of Atmel and then connect two 33pf capacitors from pin 18 and 19 to Ground of Atmel. See Schematics Section For Full Circuit Diagram.
Step 4: VCC And GND
Connect 5v Pin of Arduino Uno to 40th pin of Atmel and GND pin to 20th Pin of Atmel.
Step 5: Interfacing LED
Interface LED with the help of Circuit Diagram provided in Schematics Section.
Step 6: Software
We need 8051 SPI Programmer to Burn Hex File To 89c52. The Link is Provided in Software Section. Upload Code provided to Arduino UNO and your Programmer is ready.