Other Parts Discussed in Thread: MSP430F2012
I am having problems getting pull-ups to show up on a MPS430-2012 part port P1.2...5. This on the small TI Thumbnail shaped board that comes with their USB Stick EZ430.
I have designed a proto PCB 9 (1 3/4" x 2 3/4") with 5 and 3.3 volt regulators and level switching output drivers(with LEDs for debug). A 14 pin header at one end allow the small TI board to hang out plugged into the USB Debugger. There are connectors for Inputs, Outputs, and power. A 4 bit dip switch for inputs is on P1.2...5.
I had 10 PCBs made, seemed like a neat idea, of course long before the Launch Pad was introduced! I have several Thumbnail TI boards that go with the USB FET Debugger. They are 3 for $10. I think mine all have the 2012 part?
I have set P1DIR (C3) and P1REN (3C) for outputs on B7,B6,B1B0 and pulled up inputs on P12..5. The switch inputs are not pulled high when I measure them (with the dip switch off of course).
An external 1K pullup added works. Debugger works fine, I can see P1DIR and P1REN are correct in the register window when I single step.
Other than setting the direction and resistor enable registers, am I missing something. I have read the data sheets and the IO section on the how to program these registers.
I have checked and rechecked things, I got to be missing something?
Thanks for any help!
MIke
I made the code from an example for flashing the LED on P1.1 on the Thumbnail PCB:
No Pullup action? Otherwise everything seems fine?
int main(void)
{
WDTCTL = WDTPW + WDTHOLD; // Stop watchdog timer
P1SEL = 0;
P2SEL = 0;
P1DIR = 0xc3; // Set P1.6..7 & 0..1 to output direction
P1OUT = 0;
P1REN = 0x3c; // 3C? Pull-Ups-Downs, Inputs on P1.5...2
volatile unsigned int i; // volatile to prevent optimization
unsigned char switchdata = 0;
for (;;)
{
switchdata = ~P1IN; //Dip switches pull to ground, pullups necessary
__no_operation();
// switchdata = 0x04; //debug
if (switchdata & 0x04) // Port1.2 - & is Bitwise AND
P1OUT |= 0x40; // Turn On P1.6
else
P1OUT &= ~0x40; // Turn Off P1.6
if (switchdata & 0x08) // Port1.3 - & is Bitwise AND
P1OUT |= 0x80; // Turn On P1.7
else
P1OUT &= ~0x80; // Turn Off P1.7
P1OUT ^= 0x01; // Toggle P1.0 using exclusive-OR
i = 40000; // SW Delay
do i--;
while (i != 0);
}
}
