Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

SDCC compiler for 8051

Status
Not open for further replies.

vead

Full Member level 5
Full Member level 5
Joined
Nov 27, 2011
Messages
285
Helped
3
Reputation
6
Reaction score
3
Trophy points
1,298
Location
india
Activity points
3,815
I have installed SDCC Compiler for 8051 microcontroller on window's 10

Then

C:\Users\Embedded>sdcc -v
SDCC : mcs51/z80/z180/r2k/r3ka/gbz80/tlcs90/ds390/pic16/pic14/TININative/ds400/hc08/s08/stm8 3.6.0 #9615 (MINGW64)
published under GNU General Public License (GPL)

After That I wrote c code for led blink and saved desktop on folder LED

Desktop\LED<led.c

I want to run and debug code. How to run and debugg code
 

Open cmd.exe and navigate to led Folder. Type the following command to compile the C file.

sdcc led.c

If there are no errors ,the code will compile and generate several files.

the led.ihx is the hex file created by SDCC .

Now most of the hex file downloaders will not recognize the .ihx format.To convert the ihx format to hex format you have to use another program called packihx which will repackage ihx to hex format.

Now type the following commands to create the hex file .

packihx led.ihx > led.hex

After running this command you can see the new hex file (led.hex) inside your folder .Which you can then download into your 8051 microcontroller.

After you have generated your hex code using SDCC ,You can upload the code into your 8051 derivative.Uploading hex code is specific to the 8051 derivative you are using.

For debug check this link **broken link removed**
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top