Mithun_K_Das
Advanced Member level 3
- Joined
- Apr 24, 2010
- Messages
- 899
- Helped
- 24
- Reputation
- 48
- Reaction score
- 26
- Trophy points
- 1,318
- Location
- Dhaka, Bangladesh, Bangladesh
- Activity points
- 8,254
Problem with PIRTE of PIC16F877A
A very simple program works fine in proteus. But in real hardware it works differently.
This is a very simple code. It should work like, PIN2 of PORTE on then PIN1 and PIN0. Then turning off one by one again. It works in simulation. But in hardware only one PIN becoming ON.
A very simple program works fine in proteus. But in real hardware it works differently.
Code:
void main()
{
TRISE = 0x00;
ADCON1 = 0x07;//all digital
CMCON = 0x07;
while(1)
{
RE2_bit = 1;Delay_ms(1000);
RE1_bit = 1;Delay_ms(1000);
RE0_bit = 1;Delay_ms(1000);
RE2_bit = 0;Delay_ms(1000);
RE1_bit = 0;Delay_ms(1000);
RE0_bit = 0;Delay_ms(1000);
}
}
This is a very simple code. It should work like, PIN2 of PORTE on then PIN1 and PIN0. Then turning off one by one again. It works in simulation. But in hardware only one PIN becoming ON.