8051 development on Fedora

Monday, September 6th, 2010 | Fedora, FOSS, Tutorial

First install sdcc

#yum install sdcc

Next is a small example to blink a LED connected to P1.7


#include <8051.h>
void main(void)
{
int i=1;
P1=0; /* P1.7 used as LED output */
while(1)
{
P1_7=!(P1_7); /* toggle P1.7*/

for(i=1;i<25000;i++);
/* for delay */

}
}

Compile it and get the hex file from intel hex

$sdcc-sdcc blink.c
$ sdcc-packihx blink.ihx > blink.hex

Now you can upload the hex to the programmer :D /me is also just starting up.

Tags: , ,

2 Comments to 8051 development on Fedora

[...] This post was mentioned on Twitter by Planet Fedora, Zuissi. Zuissi said: Fedora: Kushal Das: 8051 development on Fedora: First install sdcc #yum install sdcc Next is a small example to bl… http://bit.ly/9QiOf3 [...]

Onkar
September 9, 2010

I wonder how hard it is to write a Intel .hex file. GNUSim8085 project has received a feature request about that. Even if I could write the code I have no idea how to test it on an actual 8085 kit. :-(

Leave a comment

Search

Archives

Categories