Deprecated: mysql_escape_string(): This function is deprecated; use mysql_real_escape_string() instead. in /home/monttyle/public_html/pic18f2550/phpstyle.php on line 59

Deprecated: mysql_escape_string(): This function is deprecated; use mysql_real_escape_string() instead. in /home/monttyle/public_html/pic18f2550/phpstyle.php on line 60

Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in /home/monttyle/public_html/pic18f2550/phpstyle.php on line 62
Programming the 18f2550
BurningSmell.org logo
RSS Links Projects 3D News

Programming the 18f2550

I've been suprised by the dearth of examples for programming Microchip PIC® processors in SDCC, given there's been continuous effort in improving it's support since about 2001 or so. As such, I am placing the things I've managed to create or find, here.

I originally started with the PIC16f628a, which is a nice and versatile 14-bit embedded processor with a lot of built-in goodies. If you haven't already, I strongly suggest you check out my PIC16f628a page first.

Recently I've started experimenting with the PIC18f2550 processor, which is very different for a number of reasons:

But it still shares the following abilities:

Example Circuit

Datasheet(pdf)

Example Source

Compiling and Linking Instructions

To turn a .c file into a .asm file:

sdcc -S -V -mpic16 -p18f2550 -D__18f2550 --use-non-free \
	file.c -o file.asm

To turn a .asm file into a .o file:

gpasm -c file.asm

To link multiple .o files into one .hex file:

gplink -m -s /usr/share/gputils/lkr/18f2550.lkr \
	-o output.hex /usr/share/sdcc/non-free/lib/pic16/libdev18f2550.lib \
	file1.o file2.o file3.o

To burn a .hex file to your PIC:

picprog --device=pic18f2550 --erase --burn \
	--pic-serial-port=/dev/ttyS0 --input-hexfile output.hex

picprog outputs many warnings about configuration registers for this processor, but this seems to be normal.

Other Notes

[Use Any Browser]
Contact
Linux User #348010