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!
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