Basic KEIL Tutorial
Starting a new Assembler Project
1. Select New Project from the Project Menu.
2. Name the project ‘led’
3. Click on the Save Button.
4. The device window will be displayed.
5. Select the part you will be using to test with. For now we will use the ATMEL Microcontroller AT89C52
6. Double Click on ATMEL.
7. Scroll down and select AT89C52
8. Click OK
Creating Source File
1. Click File Menu and select New
2. A new window will open up in Keil IDE
3. Copy the example given below into the new window.
4. Click on File Menu and select Save As
5. Name the file as “led.asm”
6. Click the Save button
Adding File to the Project
1. Expand Target 1 in the Project Workspace
2. Double Click on Source Group File
3. A window will open
4. Give file name as “led.asm”
5. Click on Add button
Testing Program in Debugger
1. Click on Project Menu and select Rebuild All Target Files
2. In the Build Window it should report ' 0 Errors, 0 Warnings'
3. Click on Debug Menu and select Start/Stop Debug Seesion
4. Click on Debug menu and select Run
5. The Keil Debugger now should be running
6. Click on Peripherals menu and select I/O Ports, select Port 2
7. A new window pops up. This represents the port and pins.
8. To exit out click on Debug menu, select Stop Running, again click on Debug menu select Start/Stop
Accessing Internal RAM
1. Click on Debug Menu and select Start/Stop Debug Seesion
2. Click on View Menu and select Memory Window
3. A Memory Window with four memory tabs (Memory#1,#2,#3,#4) will open in the workarea
4. In the address bar type i:60h to access internal memory addrees 60h.
5. Memory address will change in the window to I:0x60 : 00 00 ……
6. Right Click on first memory address 00 and select Unsigned -> Char
7. Again, right click on the same and select Modify memory at I:0x60
8. Enter an 8 bit data
9. Press OK
Note: I represents internal memory, similarly X represents external memory and C represents code memory.