Showing posts with label Simulator. Show all posts
Showing posts with label Simulator. Show all posts

09 April 2007

Learn Embedded Linux with ARMulator

uClinux is an excellent way to study the embedded operating systems for an engineer, student, hobbyist, Linux-enthusiast. I am interested in Embedded Linux for ARM microcontroller. Before buying a new mcu evaluation board, there is a smart way to study the Embedded Linux. That is studying it with the emulator called ARMUlator.

I tested on Fedora Core 6 Linux with GCC 3.4.x (how to install gcc 3.4 for FC6).

What you get

Here are some files you can use to put together uClinux running in the GDB/ARMulator.

Building the Debugger/Emulator
 tar xvf gdb-5.0.tar.bz2
 gunzip gdb-5.0-uclinux-armulator-20060104.patch.gz
        patch -p0 < gdb-5.0-uclinux-armulator-20060104.patch
 cd gdb-5.0
        export CC=gcc34
 ./configure --target=arm-elf
 make
 make install

Running the precompiled binaries

The ARMulator expects the romfs to be in a file called "boot.rom". You must use the matching kernel/romfs combo's.
 gunzip romfs.2.4.x
 gunzip linux.2.4.x
 ln -s romfs.2.4.x boot.rom
 arm-elf-gdb linux-2.4.x
 ...
 gdb> target sim
 ...
 gdb> load
 ...
 gdb> run

21 November 2006

A Simulator for P89V51RD2

The Philips' P89V51RD2 is a 80c51 microcontroller which provides a set of powerful features:
  • Timer/Counter 2
  • PCA (Programmable Counter Array)
  • Watchdog timer
uCsim, the 8051 simulator for SDCC, supports various types of 8051 family and one of them is 89C51R. I think it close to the features of P89V51RD2 microcontroller as mentioned above.

To use, enter this commands:

$s51 -t 89c51r

which prompt you to uCsim command shell. You can view the special modules supported by uCsim by enter this in the uCsim shell:

0>conf
ucsim version 0.5.4
Type of microcontroller: 89C51R CMOS
Controller has 13 hardware element(s).
timer0[0]
timer1[1]
uart[0]
port[0]
port[1]
port[2]
port[3]
irq[0]
_51_dummy[0]
timer2[2]
wdt[0]
pca[0]
_89c51r_dummy[0]

Although this simulator is based on command line, it is free and powerful for the modern 8051 chips.

uCsim home: http://mazsola.iit.uni-miskolc.hu/%7Edrdani/embedded/s51/

10 November 2006

uCsim: the 8051 simulator for SDCC

uCsim is a microcontroller simulator for SDCC. It is free and opensource under GNU GPL. Currently it supports MCS51 family. AVR core, Z80, HC08 and XA are supported by UNIX version only.

For the 8051, the recognized types are: 51, 8051, 8751, C51, 80C51, 87C51, 31, 8031, C31, 80C31, 52, 8052, 8752, C52, 80C52, 87C52, 32, 8032, C32, 80C32, 51R, 51RA, 51RB, 51RC, C51R, C51RA, C51RB, C51RC, 89C51R, 251, C251, DS390, DS390F.

uCsim is available for two platforms: DOS (MCS51 only) and UNIX but DOS version is not supported any more. DOS version is not finished so I call it demo version and it is available in binary only. Limitations of DOS version are:
  • There is no built in help available;
  • Some of the utilities are not working, for example calculator, bit simulator;
  • Serial line works in mode 1 independently of mode bits.
If you are using the latest version of SDCC on Windows, uCsim is already in your hand (C:\Program Files\SDCC\bin). If you have not installed it yet, please see my installation guide.


Starting the Simulator

There are separate programs to simulate different microcontroller families:

MCS51 family is simulated by s51
AVR family is simulated by savr
Z80 processor is simulated by sz80
XA family is simulated by sxa
HC08 processor is simulated by shc08

The program can be started using following command:

C:\> s51 [input file]

Parameter is optional. If it specified it must be the name of an Intel hex file.

For more details, please see its documentation. This is an overview and I will write about this simulator later.