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.

[Moved] ATMEGA 8515 Port Pins Read

Status
Not open for further replies.

Vindy789

Newbie level 3
Joined
Nov 30, 2011
Messages
3
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,299
Dear all,

Started a new project using ATMEGA 8515. Here the 4 Switching Signals are the Inputs to the Controller Port Pins i.e. PortB (Pins 1-4). If any Switch is Pressed then an 5V DC supply is passing to the connected Pin. So here i need a help that how to read or compare the Port B pins status. Please help me on this with the Source code.

Thanks in Advance.
 
Last edited:

Hi
To Read pins in AVR you can use PINX--- where x may be A,B,C or D etc. this is for hole PORT read...
you can read individually by using
Code:
PINB0 // for 1st pin in port b 
PINB1 // for 2nd pin in port b
also
for check the status of the pin you can use
Code:
if(bit_is_set(PORTB,0)) 
{

}

Hope this will help

Ismail
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top