Quantcast
Channel: MSP430 Technical Forums
Viewing all articles
Browse latest Browse all 2077

Using P2_6 and P2_7 as inputs

$
0
0

G'day,

What nob thing am I doing with my 2553.

I always get a low input indicated on P2_6 and P2_7.

------------------------
void setup()
{
  Serial.begin(9600);
  Serial.println("G'Day XtalInputsBasic [");    //Testing P2_6 & P2_7
 
  P2SEL &= ~(BIT6|BIT7);
  pinMode(P2_6, INPUT);  //  have external 4K7 pullup
  pinMode(P2_7, INPUT);  //  have external 4K7 pullup
 }
 
void loop()
{
 if (P2_7 == HIGH)
    Serial.println ("P2_7 is HI");
  else
    Serial.println ("P2_7 is LO");
  
 if (P2_6 == HIGH)
    Serial.println ("P2_6 is HI");
  else
    Serial.println ("P2_6 is LO");
    
 Serial.println ();  
 delay(1000);
  
}

--------------

Tks


Viewing all articles
Browse latest Browse all 2077

Trending Articles