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
 

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.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…