Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronic 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.
 

boyguitar1

Member level 1
Joined
Nov 8, 2010
Messages
33
Helped
12
Reputation
24
Reaction score
12
Trophy points
1,288
Activity points
1,486
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!
 

ibitechs2005

Member level 3
Joined
Mar 25, 2009
Messages
56
Helped
2
Reputation
4
Reaction score
1
Trophy points
1,288
Location
Nigeria
Activity points
1,567
Please i want to know how to write to microcontroller EEPROM.Any special tools to do this?
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Top