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. >=20 > BAJ >=20 > 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 microcontroller= s. > First I am a beginner in Pic microcontroller. I bought a development boar= d > from Matrix Multimedia, HP488, but I dont know why I fail with a smalle > program. >=20 > The program must flash a led with a delay (4 sec) using TMR0. > So, from my calculations, using formula :=20 > Freq. out =3D Freq. osc / [prescaler * (256 - TMR0) * count] > The prescaler is 1 : 256; TMR0 is 0, anf the frequency oscilator is 4Mhz > (osccon =3D 0b01100000) > An instruction is executed in 4 clock cycles. So the frequency clock is 4= Mhz > / 4 =3D 1Mhz. > count =3D 61. > I use sourceBoost IDE, and the compiler is BoostC. >=20 > Look my code :=20 >=20 > #include=20 > unsigned int counter =3D 0;=20 >=20 > void Delay(void)=20 > { =20 > if(intcon & 2) // check if TMR0IF is set=20 > { =20 > clear_bit( intcon, 2 ); // if TMR0IF is set, clear this bit > counter =3D counter + 1; // increments the counter =20 > if(counter =3D=3D 61) =20 > { > counter =3D 0; > portb =3D ~portb; // flash the Led 0 of Port B > } > } =20 > } >=20 > void main(void)=20 > { =20 > trisb =3D 0x00; // set all pins of Port B as o= utput > portb =3D 0x01; // RB0 is high=20 > tmr0 =3D 0; // the value of TMR0 register = is > zero. > cmcon =3D 0x07; // comparators is off. > option_reg =3D 0b00000111; // prescaler is assigned to th= e > WDT, prescaler 1:256 > intcon =3D 0b10100000; // GIE - enable, TMR0IE - enab= le > while(1) > { }=20 > } >=20 > 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 no= t > aware of ? >=20 >=20 > --=20 > 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 > --=20 > http://www.piclist.com PIC/SX FAQ & list archive > View/change your membership options at > http://mailman.mit.edu/mailman/listinfo/piclist --=20 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 --=20 http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist .