programming 16f877a in microc... what's with B0?

Status
Not open for further replies.

b_engine

Newbie level 1
Joined
May 17, 2011
Messages
1
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,287
Hi,
why is it difficult to use bin0 of all ports as a digital input in pic 16f877a
I tried this simple code and it doesn't work right :
Code:
void main() {
trisb.b0=1; trisd.b0=0;
portd.b0=0; portb.b0=0;
while(1){
portd.b0 = portb.b0;}}

but if i changed portb.b0 to portb.b1 it works fine , is there a different way to work with b0?
I'd be glad if someone can help.
 

hi b_engine

Code:
void main()
 {
  trisb.b0=1;          // set RB0 as input
  trisd.b0=0;          // set RD0 as Output
  portd.b0=0;         // clear portd bit 0 
  portb.b0=0;         // clear portb bit 0 

while(1)
 {
   portd.b0 = portb.b0;        
 }
}

This case I tried apply 5V by using active high to RB0
It's normally work!! PortD has Level high 5V make LED light!
 

Please i want to know how to write to microcontroller EEPROM.Any special tools to do this?
 

Status
Not open for further replies.

Similar threads

Cookies are required to use this site. You must accept them to continue using the site. Learn more…