FYI: 8051 assemblers / programming

Craig Pugsley c.pugsley at trl.oz.au
Fri Nov 18 00:56:17 GMT 1994


Hi there,

While I know I'm one of only a handfull (the only one?) on this list 
using an 8051 family processor, I thought I'd post this anyway:

*******************************************************************
A few weeks back I was asking about assemblers to suit the 8051
series of processors that worked on a PC, as I bought a CEIBO
DS750 development kit and it had no assembler with it.
(Well, it has an 'on-line' assembler to fix bugs etc, but this
is not suitable for writing code)
The DS750 kit is a development system for 8xC750, 8xC751, 8xC752
processors (x= eprom or OTP), which are an 'entry level' 8051
based microcontroller (which means it has on chip EPROM, RAM, a
timer, I/O ports - enough to make it a single chip micro), 
with a few extra useful functions (In this case A-D and PWM for the
87C752, an example of which is below).

In any case, after reading Russ Hersh's 8051 FAQ, I got the file
ML-ASM51.ZIP , which is a product of MetaLink corporation in the US.

I am not sure what the licensing arrangement with this product
is, as it had several warnings in the documentation files about
being copyright etc, but as it is available by FTP from multiple
sites I presume it is there for evaluation purposes only.
(IE you have to pay for it in some manner if you wish to continue
to use it)

I picked this one as it suits my current needs (Ie I didn't want
C source code that I had to compile for my PC blah blah blah,
just something that will turn machine code into hex)

This product will take a text file with assembler code mnemonics
(*.ASM), and produce a listing file with the mnemonics plus the
machine code (*.LST), as well as code for programming Eproms etc
(*.HEX)

These are the steps I followed to test it's working:

i/   I got the Philips application notes book which contained
     several code examples. I picked one which is to demonstrate
     the 5 channel A-D, PWM and emulated UART (Tx only) functions
     of the 87C752 (Eprom version supplied w/ceibo kit)

ii/  I copied a sample .asm file supplied with the compiler and
     deleted all of the code, with the exception of the initial
     assembler directives (which are to set up options such as
     printing of errors, etc.) About the only thing I had to
     change here was to include a 'descriptor file' for the'752

iii/ I typed in all of the code as listed in the book into the file.

iv/  I ran ASM51.EXE (the compiler which is contained in ML-ASM51.ZIP)
     and it asked me for the name of the file I wanted to compile
     (which was TEST.ASM)

v/   After fixing 1 or 2 minor spelling mistakes in the code
     that I made, the file compiled properly, creating TEST.LST
     and TEST.HEX

vi/  I plugged in the DS750 (To power and the PC com port), inserted the
    87C752 in the ZIF socket, selected program from one of the menus,
     and it asked me for the name of the file (which was TEST.HEX).
     The Ceibo DS750 automatically detects what type of processor you
     have put into it, and proceeded to program the device.

vii/ I lashed up (on a breadboard) a curcuit to test it. This
     program does an A-D conversion on all of the A-D inputs,
     and outputs in Hex form the readings to the RS232 'pin',
     as well as controlling the PWM so it matches the voltage
     present on A-D port0.

viii/End result: The curcuit worked, as expected, first time.
     The numbers appearing on the terminal represented the voltage
     on each of the ADC pins, and the PWM pin (when connected to
     a voltmeter) showed the same voltage as the applied voltage on
     ADC pin 0.

Conclusion: It was a lot easier to do than I thought it would be!

If someone showed me how to do all this it would have taken about
10 minutes instead of several hours.

Craig.
pugsley at trl.oz.au



More information about the Diy_efi mailing list