Showing posts with label sdcc. Show all posts
Showing posts with label sdcc. Show all posts

17 December 2006

Eclipse for SDCC

Although I use MIDE-51 as a major IDE, I still seek for the best (free) IDE for developing Microcontroller Programming. The combination of Eclipse, CDT and SDCC is an alternation tools for 8051 Microcontroller C Programming.

Eclipse is an open source community whose projects are focused on building an open development platform comprised of extensible frameworks, tools and runtimes for building, deploying and managing software across the lifecycle. Eclipse is used for Enterprise Development, Embedded and Device Development, Rich Client Platform, Application Frameworks and Language IDE.

The CDT is Eclipse's C/C++ Development Tooling project. It is an industrial strength C/C++ IDE that also serves as a platform for others to provide value added tooling for C/C++ developers.

The eclipseSDCC project aims to provide full support for the open source Small Device C Compiler (SDCC) from within the eclipse/CDT development environment. This allows embedded 'C' applications for 8051 and Z80 devices to be developed using the fully featured eclipse IDE. EclipseSDCC supports CDT managed make projects. In managed make projects CDT manages the build process by creating and maintaining the underlaying makefiles. CDT keeps track of source dependencies and can automatically rebuild the target when needed.

To install (for Windows)

  1. It requires Java Runtime Environment (JRE), I download only JRE not SDK and install it.
  2. Downlaod Eclipse SDK 3.2.1 for Windows (120 MB) and extract it to c:/eclipse. In the directory it contains eclipse.exe which is an executable.
  3. Download CDT 3.1.1 (September 29, 2006) and extract it c:/eclipse, this will prompt to replace plugins and features directory.
  4. If you have already installed SDCC for Window, skip this step. If you have no SDCC installed, read this first.
  5. Download eclipseSDCC-1.0.0, when you extract the file, it contains plugins and features directory. Copy the two direct to c:\eclipse.
Now the installation have been completed and you can find its manual in c:/eclipse/plugins/net.sourceforge.eclipsesdcc_1.0.0/help/index.html.

Eclipse for SDCC is quite large when compared it MIDE-51. However, you can manage project in Eclipse whereas MIDE-51 still have no this feature in the present version. Here is a screen shot, you should see this dialog.

Related Links

01 December 2006

What's coming up, MIDE-51?

MIDE-51, by Worapoht Kornkaewwattanakul, is an IDE for MCS-51 microcontroller. The toolchain supports by ASEM-51 assembler, SDCC : Small Device C Compiler, TS Controls 8051 Emulator and JSIM-51 Simulator (see installation guide).

The current version is 0.2.5.10. The author is working for next major version 0.3.0.0, which supports SDCC multiple files project style. Hopefully, he will finish this version soon.

26 November 2006

A Real-Time Operating System (RTOS) for the 8051

A real-time operating system (RTOS) is a class of operating system intended for real-time applications, including embedded systems (programmable thermostats, household appliance controllers, mobile telephones), industrial robots, spacecraft, industrial control (see SCADA), and scientific research equipment [wikipedia]. It is an advance topic in Microcontroller and Embedded Systems.

FreeRTOS.orgTM is a portable, open source, mini Real Time Kernel - a free to download RTOS. It have been ported to support several microcontroller architectures - ARM7, ARM CORTEX M3, 8051, AVR (MegaAVR), x86, PIC18, PIC24, dsPIC, HCS12, H8S, RDC, ColdFire. FreeRTOS is licensed under a modified GPL and can be used in commercial applications under this license.

For the 8051, this RTOS have been ported to Cygnal (Silicon Labs) 8051. This is the starting point for anyone who would like to study the Operating System and Embedded Design on 8051. The Cygnal port was developed on a C8051F120-TB prototyping board fitted with a 8051F120 microcontroller. The freeware SDCC compiler was used along with the Cygnal IDE.

Building and executing the RTOS demo application

After downloads the freeRTOS source file (.exe or .zip), I extract the file to C:\FreeRTOS. The demo application for Cygnal 8051 is located in C:\FreeRTOS\Demo\Cygnal. To compiler this demo, it is require SDCC (see how to install) and GNU make. For Gnu make, I download UnxUtils.zip then extract it to C:\UnxUtils and finally edit PATH to C:\UnxUtils\usr\local\wbin (see how to edit PATH on 2000 and XP). In DOS Command Shell, change directory (cd) to C:\FreeRTOS\Demo\Cygnal and type make, the final product is main.ihx which the demo real time application for Cygnal 8051. However. the size of this file is quiet big, 72k. I have succeed compiling with SDCC 2.5.x but failed for SDCC 2.6.x.

In the conclusion, The demo application of the opensource freeRTOS have been ported to Cygnal 8051 which contains the demonstration source code. This is an avenue to learn the Real Time Operating System for the others 8051 chip.

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/

15 November 2006

Installing SDCC on Fedora Core 6

I have upgraded my Linux to the latest version Fedora Core 6. This version come with linux kernel 2.6.18 and gcc v4.1.1. I don't hesitate to install the SDCC to work on it. After I downloaded the latest of SDCC source, sdcc-src-xxx-xxx.tar.bz2, I installed it with this command:
$tar -xvfz sdcc-src-xxx-xxx.tar.bz2
$cd sdcc
$./configure --prefix=/usr
$make
$make install
If it succeed, you should have these directories:
/usr/bin for execute files
/usr/share/sdcc/doc for documentation
/usr/share/sdcc/include for header files
/usr/share/sdcc/lib for libraries

I tested it with this simple code, I edited with gedit:

#include <8051.h>
void min() {
unsigned char var_1;
var_1 = 0xFF;
}

then saved it, let say test.c. To compile I use this command:
$sdcc test.c
and I found the test.ihx file in that directory which is the expected output.