I have used SDCC for MCS-51
I wan't to try PIC16F877A
command:(use IDE Codeblocks)
sdcc --out-fmt-ihx -mpic14 -p16f877a -c led.c -o led.rel
sdcc --out-fmt-ihx -mpic14 -p16f877a -c main.c -o main.rel
sdcc -o main.hex --out-fmt-ihx -mpic14 -p16f877a led.rel main.rel
OK! Success Download the main.hex ,The LED is dodging...
but ! I wan't write a Makefile
Reference sdccman.pdf page 63
sdcc -mpic14 -p16f877a -c main.c (OK!)
sdcc -mpic14 -p16f877a -c led.c (OK!)
gplink -m -sp16f877a.lkr -o tt.hex led.o main.o (fail)
output:p16f877a.lkr: No such file or directory
Why? (my OS is WIN XP)
You either need to copy p16f877a.lkr to your project or leave out the -sp16f877a.lkr option; gplink should find its linker-script automatically. As a third option, you can pass the complete path (-s/path/to/p16f877a.lkr).
PS: You probably need to add pic16f877a.lib and libsdcc.lib as well. See the output of
sdcc -mpic14 -V main.o led.o
to find out how sdcc calls the linker.
sdcc -mpic14 -p16f877a -V -o main.hex main.o led.o > msg.txt
message: using default linker script "E:\aozima\SOFT\gputils\lkr\16f877a.lkr"
+ E:\aozima\SOFT\gputils\bin\gplink.exe -I"E:\aozima\SOFT\SDCC\bin\..\lib" -I"E:\aozima\SOFT\SDCC\bin\..\lib\pic" -w -r -o tt.hex main.o led.o libsdcc.lib pic16f877a.lib
I will write a wizard(MCS51 and PIC) for codeblocks!
Sign up for the SourceForge newsletter:
You seem to have CSS turned off.
Please don't fill out this field.