Martin, Your code is for 8 bit parts you need to work with 16 bit values. like TRISB = 0x0000; PORTB = 0xFFFF; etc Andre -----Original Message----- From: piclist-bounces@mit.edu [mailto:piclist-bounces@mit.edu]On Behalf Of Martin Klingensmith Sent: Friday, February 23, 2007 8:19 AM 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? Thanks, -- Martin -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist