> -----Original Message----- > From: piclist-bounces@mit.edu [mailto:piclist-bounces@mit.edu]On Behalf > Of Martin Klingensmith > Sent: 23 February 2007 16:19 > To: piclist@mit.edu > Subject: [PIC] Unable to get C program to work > > > I'm trying to write an extremely simple program for a 30F3010 using the > Microchip C30 tool. This is my entire program: > > #include > > void init() > { > TRISB = 0x00; > > return; > } > > void delay() > { > int x=0; > for(x=0;x<10000;x++){} > return; > } > > int main (void) > { > init(); > while (1) > { > PORTB = 0xFF; > delay(); > PORTB = 0x00; > delay(); > } > return 0; > } > > I don't know how it could be much simpler. It compiles, I program > it with my > USBProg, and nothing happens. > I have set the oscillator to Internal RC - High Speed and the WDT > is off. I > attach an oscilloscope and it's dead as can be. I've tried clocking it > externally with a function generator and I get the same thing. Yesterday I > tried an 18F1220 with nearly the same exact program and the clock seems to > run for a few ms and then quit. I'm getting really frustrated > with how much > time I'm wasting trying to get my dev. tools to work. Do you have any > advice? for the 18F chip make sure low voltage program is disabled, i don't know if the 30F chips have that option but if they do you might want to check it for them too also note that if you set your configuration bits using the mplab gui rather than through code they will NOT be in the hex file the compiler generates. -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist