I want to test code whether it will work or not in PIC like simulating the codes....
so, i am using MAP LAB for converting HEX file, i have listen of Proteus ISI but it is not free so can i test the code by any other mean(Software).
I have programmed the PIC 16F877A with this code:
and PIC was connected as per schematic using 4Mhz the problem is that the LED was not blinking as the output from port B is zero all the time, why??
Code:
#include <htc.h>
__CONFIG(LVP_OFF & BOREN_OFF & PWRTE_ON & WDTE_OFF & FOSC_XT);
#define _XTAL_FREQ 4000000
void main (void)
{
TRISB=0b00000000;//all pins set as ouput
PORTB=0;
while (1)
{//endless loop
PORTB = !PORTB;
__delay_ms(1000);
}
}
There is nothing wrong with the code.... I cant tell from your photo if the chip is wired correctly... The wiring is available on Nigel's site... Hardware section...
All the tutorials that I produced were tested to be working... Both simulation and on Nigel's hardware ( otherwise there would be no point posting it )
So I know the code works...
Have you got a scope? to check your oscillator is running?