i finally wrote my first program using the microc, i compiled it and programed it into the mic successfully, but when i insert the mic into my circuit it does not react. i have simulated the circuit in proteus and it works and i have also used the data sheet to see pin configuration. i am also positive that my practical connections are correct.
what can really cause the pic16f877a not to react
is it possible to program a bad pic
pls i need some practical considerations when connecting this pic. here is part of my code
what can really cause the pic16f877a not to react
is it possible to program a bad pic
pls i need some practical considerations when connecting this pic. here is part of my code
Code:
sbit LCD_RS at RB0_bit;
sbit LCD_EN at RB1_bit;
sbit LCD_D4 at RB2_bit;
sbit LCD_D5 at RB3_bit;
sbit LCD_D6 at RB4_bit;
sbit LCD_D7 at RB5_bit;
sbit LCD_RS_Direction at TRISB0_bit;
sbit LCD_EN_Direction at TRISB1_bit;
sbit LCD_D4_Direction at TRISB2_bit;
sbit LCD_D5_Direction at TRISB3_bit;
sbit LCD_D6_Direction at TRISB4_bit;
sbit LCD_D7_Direction at TRISB5_bit;
void main()
{
cmcon = 0;
TRISA = 0xFF;
TRISB = 0x00;
trisd = 0xff;
portc.f0 = 0;
portc.f3 = 0;
lcd_init();
lcd_cmd(_lcd_cursor_off);
lcd_cmd(_lcd_clear);
lcd_out(1,6,"||");
lcd_out(2,6,"||");
rb7_bit = 1;
while(1)
if(button(&portd,0,1,0))
{
if(button(&portd,1,1,0)) //overload test pin d2
{
lcd_out(1,1," ");//lcd display
}
else if(button(&portd,1,0,1))
{
lcd_out(1,1,"Schge"); //lcd out something
lcd_out(2,8," ");
}
if(button(&portd,3,1,0))
{
lcd_out(1,8," ");//lcd display
} // seat belt test pin d4
else if(button(&portd,3,0,1))
{
lcd_out(1,8,"Cture"); //lcd out something
lcd_out(2,8," ");
}
if(portd.f0 == 0 && portd.f1 == 0 && portd.f3==0)
{
portc.f0=0;
}
else
{
portc.f0=1;
}
if(portc.f0==0 && portc.f1==0)
{
lcd_out(2,8,"D-Acc");
portc.f2=0;
}
else
{
portc.f2=1;
}
}
else if(portd.f0==1)
{
portc.f0=0;
}
}
}