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

MPS430F1121 I/O tips need.

Status
Not open for further replies.

ltg

Member level 4
Joined
Feb 24, 2002
Messages
76
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,286
Activity points
533
Hi,

I'm trying to learn me MPS430F1121 with IAR C-compiler. But I'm confused when I declera two pins as output and one as input. I think I don't understand P1DIR, P1SEL, P1IN, P1OUT.

Could some of you please show me how to declera two pins as output and one pin as input. When should I use P1SEL? Thank you very much!

Best Regards,
ltg
 

gorkin

Advanced Member level 1
Joined
Feb 27, 2002
Messages
422
Helped
13
Reputation
26
Reaction score
5
Trophy points
1,298
Location
brazil
Activity points
3,384
Hello brother! I will recommend your read more and more the processor datasheet.
P1DIR: This register is used for pin configurate (Input or Output) mode.
Example:
P1DIR = BIT0 + BIT1 + BIT2; // This pins are Output configurated,
// the rest are configurated Inputs .
P1SEL: Special Function Selection, this register is utilized with the other's processor features Ex: CApture and Compare, etc...
função especial

P1OUT: Configurate the output pin
Ex:
P1OUT = BIT0 // Turn-high P1.0

P1IFG: Congfiguration of the interrupt if desired
P1IE : Interrupt Enable

"And remember: IÂ&R-= is the best development tool"
If you have more dificult's, please ask-me
gorkin@bol.com.br
 

Status
Not open for further replies.
Toggle Sidebar

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Top