From the Silicon Laboratories pagedownload SILICON LABS IDE. It is a classical design suite for 8051 chips requiring modest space on your windows computer. Look for the mcu_ide.exe installer file.
Download and install the limited Keil compiler and the Flash Programming Utilities programs. We are going to install the Keil compiler to generate programs for 8051 chips on your computer.
For more information, read the original AN104 Application Note from Silicon Laboratories. It was released in 2023 and is up to date.
Install Keil C51 CompilerDemo version of the professional software. Limits size of your code. Accept defaults.
Create a new project and save to a workspace in your documents folder. Choose helpful names for locations and workspace.
Choose any name you want. Make sure the program adds the file to the project.
Paste this code into the file. Save. An asterisk* shows whether the file is saved.
#include <REG51.h>
void DELAY(int count);
int main() {
while(1)
{ P1++; P2--; P3++; P0++; DELAY(30000);}}
void DELAY(int count)
{ int i; for(i=0; i<count; i++){ ; }}
The screen should look like this.
Silicon Laboratories IDE is ready for several toolchains. Go to Menu->Project->Toolchain Integration.
Use the pulldown menu to select Keil(read-only). It has old default applications and locations that we will change. Save as Keil_v5 for the new values.
Click Assembler Tab. Make sure Executable is C:\Keil_v5\C51\BIN\A51.EXE . Command line flags stay the same.
Browse lets you locate the assembler program. This folder contains the tools in the C51 suite.
Click Compiler Tab. Executable set to C:\Keil_v5\C51\BIN\c51.exe. Browse may be easier. Change the included header file to C:\Keil_v5\C51\INC.
These header files provide definitions of the chips and features. You can view and edit them with notepad. You can code for many different MCUs organized by manufacturer.
Click Linker Tab. Change Executable to C:\Keil_v5\C51\BIN\BL51.exe for our 8051 project. Command line flags remain the same.
Menu Project->Target Build Configuration to set up our output file.
Default is to build an OMF file which is an executable with debug information. We want a hex file output. Tick the Generate hex file box and confirm the Generation executable is C:\Keil_v5\C51\BIN\oh51.exe.
Menu Project->Build/Make Project. Rebuild Project to clean and build again.
The end of the build messages says we have generated a hex file that we can upload to a chip.
Read the Build message text generated during our compile. This is a successful build. You don't have to read all the output but it helps.
Our project folder has many new files, a hex is one of them. The files #1, #2, #3 are save files for edits.
This simulator runs blinky from our compiled executable. That is a good sign.
Perhaps you have a compatible flash programmer device? Silicon Laboratories Flash Utility works with serial interface and some USB programmers.
Comments
Please log in or sign up to comment.