likhin
Newbie level 3
Hi all,
I am new to micro-controller programming. So I decided to start with a led blink program. My chip is 16f876A. I wrote an LED blink program, and it compiled successfully generating an hex file. And this code is working perfectly on a PIC simulator, but when I burnt it to hardware, nothing seems to work.
My assumption is that, the crystal oscillator is not working. How can I check whether the oscillator is working or not( With out using a CRO)? I meant, by measuring the OSC1 and OSC2 pin voltages? I am getting a voltage less than Vdd at OSC2 pin. Is that normal? Any help from u guys will be highly appreciated, as I am desperate to see my led blinking by a pic:smile:
Extra info:
Crystal frequency: 5Mhz
Vdd: 3v
MCLR connected to VDD
compiler: CCS
code:
I am new to micro-controller programming. So I decided to start with a led blink program. My chip is 16f876A. I wrote an LED blink program, and it compiled successfully generating an hex file. And this code is working perfectly on a PIC simulator, but when I burnt it to hardware, nothing seems to work.
My assumption is that, the crystal oscillator is not working. How can I check whether the oscillator is working or not( With out using a CRO)? I meant, by measuring the OSC1 and OSC2 pin voltages? I am getting a voltage less than Vdd at OSC2 pin. Is that normal? Any help from u guys will be highly appreciated, as I am desperate to see my led blinking by a pic:smile:
Extra info:
Crystal frequency: 5Mhz
Vdd: 3v
MCLR connected to VDD
compiler: CCS
code:
Code:
#include <16f876A.h>
#fuses HS,NOWDT,NOPROTECT,NOLVP
#use delay (clock = 5000000)
void main()
{
while(true){
output_high(PIN_C0);// tried all ports
delay_ms(500);
output_low(PIN_C0);
delay_ms(500);
}
}