Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

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

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top