Did you disable the watchdog timer in the configuration bits setup? I see no equivalent of clrwt (clear watchdog timer) in the program Either the watchdog must be disabled or serviced at less than its timeout interval, or the program (no program) will run, but keep resetting the micro at default WDT interval. On Sun, Jan 20, 2013 at 6:58 PM, Byron Jeff wro= te: > Took a quick look. It seems in BoostC that the interrupt handler > specifically needs to be a function named interrupt. > > www.sourceboost.com/Products/BoostC/Docs/boostc.pdf > > Page 64. > > Hope this helps. > > BAJ > > On Sun, Jan 20, 2013 at 11:31:17AM -0500, Byron Jeff wrote: > > Reposted with a [PIC] tag for more visibility. > > > > BAJ > > > > On Sun, Jan 20, 2013 at 07:45:15AM -0800, mircea2012 wrote: > > Hi all. > > I am new on this site and I have some questions about Pic > microcontrollers. > > First I am a beginner in Pic microcontroller. I bought a development > board > > from Matrix Multimedia, HP488, but I dont know why I fail with a smalle > > program. > > > > The program must flash a led with a delay (4 sec) using TMR0. > > So, from my calculations, using formula : > > Freq. out =3D Freq. osc / [prescaler * (256 - TMR0) * count] > > The prescaler is 1 : 256; TMR0 is 0, anf the frequency oscilator is 4Mh= z > > (osccon =3D 0b01100000) > > An instruction is executed in 4 clock cycles. So the frequency clock is > 4Mhz > > / 4 =3D 1Mhz. > > count =3D 61. > > I use sourceBoost IDE, and the compiler is BoostC. > > > > Look my code : > > > > #include > > unsigned int counter =3D 0; > > > > void Delay(void) > > { > > if(intcon & 2) // check if TMR0IF is set > > { > > clear_bit( intcon, 2 ); // if TMR0IF is set, clear this b= it > > counter =3D counter + 1; // increments the counter > > if(counter =3D=3D 61) > > { > > counter =3D 0; > > portb =3D ~portb; // flash the Led 0 of Port B > > } > > } > > } > > > > void main(void) > > { > > trisb =3D 0x00; // set all pins of Port B as > output > > portb =3D 0x01; // RB0 is high > > tmr0 =3D 0; // the value of TMR0 registe= r is > > zero. > > cmcon =3D 0x07; // comparators is off. > > option_reg =3D 0b00000111; // prescaler is assigned to = the > > WDT, prescaler 1:256 > > intcon =3D 0b10100000; // GIE - enable, TMR0IE - en= able > > while(1) > > { } > > } > > > > The program compiles fine, upload fine, but dont show me the led > flashing. > > What I am doing wrong ? Are there any configuration settings that I am > not > > aware of ? > > > > > > -- > > Byron A. Jeff > > Chair: Department of Computer Science and Information Technology > > College of Information and Mathematical Sciences > > Clayton State University > > http://faculty.clayton.edu/bjeff > > -- > > http://www.piclist.com PIC/SX FAQ & list archive > > View/change your membership options at > > http://mailman.mit.edu/mailman/listinfo/piclist > > -- > Byron A. Jeff > Chair: Department of Computer Science and Information Technology > College of Information and Mathematical Sciences > Clayton State University > http://faculty.clayton.edu/bjeff > -- > http://www.piclist.com PIC/SX FAQ & list archive > View/change your membership options at > http://mailman.mit.edu/mailman/listinfo/piclist > --=20 Perry Curling-Hope Research and Development --=20 http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist .