µC51

IndexReturn to index

Programming 80x51 family CPUs in µC51.

I used the program µC51 to program 80x51 family MPU controllers. The program is easy to use. Produces small code. Has a standard serial upload program to quickly run the program on the micro controller.

The main programs included in the µC51 package are:

FlashMon uploads the compiled source to the RAM or flash of the MPU.
JFE is the source editor and compiler of the ANSI-C source
MakeWiz makes a make file for the project

Compile awning.c:

This is how you can compile the awning.c program. First start the MakeWiz program. In the "General" tab we can make a new "make" file by clicking on "New *.mak file". Choose a file name. Click on "Open". Click on "Yes" when asked to make the file. Back in the "Generel" tab select "Write JFE-Workspace File", we need this file for compiling the program in the JFE program.

Next we move to the "Components" tab, here we can add all the header and source files that we need for the project. Next select the name of the target file. In the "C-Compiler" tab we can fill in how long the processor cycle is. A processor running at 1 Mhz has a cycle time of 12000 nS, because one instruction on the 80x31 microprocessor needs 12 cycles to execute. The cycle time is only needed when you want to use the _wait() macro. Select memory model small if the microprocessor doesn't have external RAM and we want to use the internal 128/256 bytes (woww!). Select large if you want to store everything in the external RAM. Storing variables in the internal RAM is faster and produces smaller code, but also reduces the room on the stack, which is also stored in the internal RAM.

In the "Linker" tab we can fill in the offset of our program. ROM address is where to compiled code goes to and the RAM is where the variables are stored. With FlashMon we can send the compiled code over the serial interface to the microcontroller and run it. In that case the code can be stored in the RAM too. For example, in a model with 32kb of RAM in the memory map starting at 0x8000 we can store the code at 0x8000 and the varibles at 0xf000, that leaves us 24kb for the program and 8 kb for the variables. Select the serial library you want to use.

Last in the "Misc" tab we can select *.hex if your programmer needs a hex file. Save and Exit the MakeWiz(ard)

Start the JFE program and select open a new workspace from the file menu. Open the awning.wsp file. It should now show the source. Click on the Make button next to all icons and the program will start to compile. After a second it will show that it compiled the program. The compiled files should be in the same directory where you opened the workspace file

Burn the hex file to a ROM or MPU and use the program. It is a simple as that. Good luck.

Self made 8032 board with 8x32 kb paged flash and 32 kb RAM from recycled components

MPU front

Back side of board, after 2 days of soldering

MPU back

The board is controling 64 leds and can be flashed directly from FlashMon. OS51 in flash page 7.

MPU complete

P.S. More information on how to use µC51 is included with the program. I wrote this to get you going quickly and to show how easy to use this program is.

IndexReturn to index

80x51
80x51
[ Join Now | Ring Hub | Random | << Prev | Next >> ]
Embedded Technology
Embedded Technology
[ Join Now | Ring Hub | Random | << Prev | Next >> ]

This site is brought to you by the "slug".