Hello,
I'm am seriously confused about the next thing.
On the MSP430F5529 Development board you can find different push buttons and LED.
Now i want to use the switch that is located at P1.7 (S1) to control the LED 3 at P8.3, but i just don't understand the adressing of the registers.
i understand the code if you would use P1.0 or P8.0 but i don't understand the Px.y how to get to the y ? This is probably very easy but i just can't figure it out.
Please somebody help me.
Nick
btw here is the code i made so far (it is only the blinking of the led at 8.3 because even that won't work )
#include <msp430f5529.h>
void main(void){ volatile unsigned int i,j;
WDTCTL = WDTPW+WDTHOLD; // Stop WDT P8DIR |= BIT8 | BIT3; // P8.3 set as output
while(1) // continuous loop { P8OUT ^= BIT3 ; // Toggle 8.3 for(i=5000;i>0;i--); // Delay { for(j=45000;j>0;j--); } }}
Hello again,
After looking up the schematics of the MSP430F5529 development board i found the mistake in SLAU330A Table 2. Push Buttons, Potentiometer, and LED Connections it says that LED3 is connected to P8.3 but it is actually connected to P8.2.
Maybe TI can change this ?
Greetz,
Nick Bosmans P8DIR |= BIT8 | BIT3; // P8.3 set as output
P8DIR |= BIT8 | BIT3; // P8.3 set as output
There is not BIT8 for the ports since the registers are byte sized; hence your code results in an overflow.
For any Px.y (Port x pin y) the prefix is Px and the bit is BITy. So to set P8.3 as output you only need
P8DIR |= BIT3;
Tony