I am a complete noob in programming a PIC microcontroller and I have been trying to get the most basic of the tasks (flashing an LED) done.
I am using MPLAB v8.73 with HiTech C Compiler and a PIC16F877A
I found an circuit online (http://justanotherlanguage.org/sites/default/files/blink_a_led_circuit.jpg) and built the circuit with a few modifications in the component values.
The code is as follows:
The code builds successfully but does not blink the LED Maybe there is a problem with the circuit but I wanted to be sure about the code first.
Thanks
I am using MPLAB v8.73 with HiTech C Compiler and a PIC16F877A
I found an circuit online (http://justanotherlanguage.org/sites/default/files/blink_a_led_circuit.jpg) and built the circuit with a few modifications in the component values.
The code is as follows:
Rich (BB code):
#include<pic.h>
#define _XTAL_FREQ 20000000
void main()
{
TRISB=0;
for (;;)
{
RB0=1;
__delay_ms(250);
RB0=0;
__delay_ms(250);
}
}
Thanks