Hello,
i am working in real time with PIC18f452. i try this code but confusion is here on the output.
when i simulate this code in proteus then its shows all the blinking PINS of portb, but when i burn this code on PIC18f452 then RB0-RB4 blinking but RB5,RB6,RB7 not blinking...
what is its reason??? i also check the voltage these pins have 0 volt. please guide me in this way.
I also try this with
LATB= 0x55 ;
and
LATB= 0xAA;
Regards,
i am working in real time with PIC18f452. i try this code but confusion is here on the output.
Code:
#include<htc.h>
// PIC 18F452 fuse configuration:
// Config word 1 (Oscillator configuration)
// 40Mhz crystal input
__CONFIG(1, OSCSDIS & HSPLL);
// Config word 2
__CONFIG(2, BORDIS & PWRTDIS & WDTDIS);
// Config word 3
__CONFIG(3, CCP2RC1);
// Config word 4
__CONFIG(4, DEBUGEN & LVPEN & STVREN);
// Config word 5, 6 and 7 (protection configuration)
__CONFIG(5, UNPROTECT);
__CONFIG(6, WRTEN);
__CONFIG(7, TRU);
#define _XTAL_FREQ 40000000 //MHz
void delay_sec(unsigned char seconds) // This function provides delay in terms of seconds
{
unsigned char i,j;
for(i=0;i<seconds;i++)
for(j=0;j<100;j++)
__delay_ms(10);
}
void main()
{
TRISB = 0;
while(1)
{
PORTB = 0x55;
delay_sec(1); // delay of one second
PORTB = 0xAA;
delay_sec(1); // delay of one second
}
}
what is its reason??? i also check the voltage these pins have 0 volt. please guide me in this way.
I also try this with
LATB= 0x55 ;
and
LATB= 0xAA;
Regards,