Funny - I was going to ask the same thing, but since I'm a lurking/learning newbie I thought I just missed something. Where IS the clock set? Bryon "Vitaliy" Sent by: piclist-bounces@mit.edu 12/17/2008 01:24 PM Please respond to "Microcontroller discussion list - Public." To "Microcontroller discussion list - Public." cc Subject Re: [PIC] Blink LED for solarwind "Bob Blick" wrote: > Here's a program that you can test. I was unable to duplicate the same > conditions you have - the closest part I had to a 16F886 that was in DIP > package was a 16F884 so I used that. > > Also I used version 8.05pl2 of the HiTech compiler but the reason for > that would need to be in a different thread. > > The command line I used to compile was: > picc -16F884 -Zg9 -O blink.c > > Tie MCLR high, hook an LED through a 1k resistor to RC4, apply power and > it should blink about once per second. > > Give it a try and see if it works for you. > > Cheerful regards, > > Bob > > #include > __CONFIG(UNPROTECT & WDTDIS & LVPDIS & BOREN & PWRTEN & INTIO & > MCLRDIS); > __CONFIG(BORV21); > > void main(){ > unsigned int i = 0; > PORTA = 0; > PORTB = 0; > PORTC = 0; > PORTD = 0; > PORTE = 0; > TRISA = 0; // no inputs > TRISB = 0; > TRISC = 0; > TRISD = 0; > TRISE = 0; > ANSEL = 0; // no analog > ANSELH = 0; > > while(1){ > if(!--i){ > if (RC4){ > RC4 = 0; > } else { > RC4 = 1; > } > } > } > } > > Why "about once per second"? I don't see the clock specified anywhere. -- 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