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.

Register Log in

Please Help ( about AVR Micro )

Status
Not open for further replies.

NTFS

Member level 3
Joined
Apr 6, 2004
Messages
67
Helped
1
Reputation
2
Reaction score
0
Trophy points
1,286
Activity points
576
Hi

What is different between PIND ($10) and PORTD ($12) in AT90S1200?

How can I read from and also write to port D?

Thanks in advance

NTFS.
 

Sceadwian

Full Member level 3
Joined
Sep 25, 2005
Messages
174
Helped
15
Reputation
30
Reaction score
0
Trophy points
1,296
Activity points
3,588
Be very careful remembering which to use under which conditions, as reading the wrong register is the cause of more than a few beginner program problems. PortD is primarily for controlling the port when it's configured as an output (DDRB == 1) As setting portb will change it from sourcing to sinking curent. When DDRD == 0 (set to input) portD controls weather or not the internal pullup resistors are enabled or not (1 == pullups on, 0 == pin is floating) PinD is a direct access register to the logic state of the pins. When DDRB is set to 0 you read the pin register to read the state of the pin. So remember, DDRD is for setting input/ouput PORTD is for setting I/O source/sink and individual pullups, and PIND will always return the current logic state of the port (mind you this can detect short circuits in or out of an I/O pin if the pin port is exactly opposite of what it's supposed to be)
 

    NTFS

    points: 2
    Helpful Answer Positive Rating
Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Top