Jump to content

Recommended Posts

Hi everyone,

it is probably a very stupid question.

But i'm simply trying to toggle a LED(P1.0)  by using the button S2(P1.1) which is on the launch pad of FR5969.


but it is not wotking at all...


#include <msp430.h>
void main(void)
WDTCTL = WDTPW + WDTHOLD; // Stop watchdog timer
P1DIR |= 0x01; // Set P1.0 to output direction
P1REN = 0x02; ?
P1OUT= 0x02; ?
P1IE |= 0x02; // P1.1 interrupt enabled
P1IES |= 0x02; // P1.1 Hi/lo edge
P1IFG &= ~0x02; // P1.1 IFG cleared
_BIS_SR(LPM3_bits + GIE); // Enter LPM4 w/interrupt
// Port 1 interrupt service routine
#pragma vector=PORT1_VECTOR
__interrupt void Port_1(void)
P1OUT ^= 0x01; // P1.0 = toggle
P1IFG &= ~0x02; // P1.4 IFG cleared
any suggestions?
Thanks in advance
Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...