PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Wed Mar 26, 2008 1:00 pm |
|
|
Try a more a more simple test program, as shown below.
I don't have 18F2550, but I do have an 18F4550. I don't have a 24 MHz
oscillator, but I do have a 25 MHz "can" oscillator. You didn't show your
fuses (the bootloader fuses), so I used the ones shown below. I tested
this program with vs. 4.057 on a PicDem2-Plus board. It worked OK.
If it doesn't work, I suspect some hardware problem. It could be
a missing MCLR pullup resistor (10K for ICD2, or 47K for ICD-U40),
or some of the Vdd and Vss pins may not be connected to the power
supply, or something wrong with the oscillator circuit. I also strongly
suspect the bootloader fuses are in "LVP" mode, or have the wrong
oscillator setting.
Code: | #include <18F4550.h>
#fuses EC_IO, NOWDT, PUT, BROWNOUT, NOLVP
#use delay(clock=25000000)
#use rs232(baud=9600, xmit=PIN_C6, rcv=PIN_C7, ERRORS)
#int_rda
void rx_isr()
{
char c;
c = getc();
putc(c);
}
//==========================
void main()
{
enable_interrupts(INT_RDA);
enable_interrupts(GLOBAL);
while(1);
} |
|
|