Hi,

I did something similar last week, no problems, what compile line you
use?

Attached please find my sample code that blinks a LED and prints
"hello, world" through
UART port. Also attached is the Makefile, which should show you a
command line/options
that I used to compile this and make it work.



br Kusti


>>> alexsc...@gmail.com 20.1.2009 16:06 >>>
Hi!

I'm trying to use SDCC compiler to build firmware for Microchip
micro-controllers. I'm currently using PIC 18F4550.
I'm using piklab IDE to compile C source code and to program the chip
using ICD2 hardware.
I made a simply (and sample code) to test the SDCC compiler
integration
in Piklab IDE software, I'm working in Linux environment (Ubuntu);
although the hex file is created resulting from compilation, when I
program the chip nothing happens - the PIC 18F4550 does nothing!

The C code is:

/******************************************************************/
/*
*/
/* C code for PIC18F4550 that configures PORTA pins as outputs and
*/
/* puts high level on them
*/
/******************************************************************/

#include <pic18f4550.h>
#include <signal.h>
#include <pic18fregs.h>
#include <stdio.h>
#include "PIC18test.h"

code char at __CONFIG1H CONFIG1H = 0x01;
// _OSC_XT_1H & _FCMEN_OFF_1H & _IESO_OFF_1H;

void main(void) 
{
        // make all pins of port A as outputs
        TRISA = 0;
        // Configure LCD_PORT if in use
        TRISB = 0;
        // Configure LCD control pins
        TRISD = 0xF7;
        
        // Put all PORTA outputs to high
        PORTA = 0xff;

}


There's anything wrong in compilation? Can anyone help me?

Attachment: main.c
Description: Binary data

Attachment: Makefile
Description: Binary data

------------------------------------------------------------------------------
This SF.net email is sponsored by:
SourcForge Community
SourceForge wants to tell your story.
http://p.sf.net/sfu/sf-spreadtheword
_______________________________________________
Sdcc-user mailing list
Sdcc-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sdcc-user

Reply via email to