So I'm testing an output in which my output pin triggers a couple of transistors to send 12v to a valve. I'm just testing simple code based off of the code examples, modified a bit:
#include <msp430.h>
int main(void)
{
WDTCTL = WDTPW+WDTHOLD; // Stop WDT
P8DIR |= BIT0; // P8.0 output
P8DIR |= BIT1; // P8.1 output
P8OUT = 0x00;
while(1)
{
P8OUT ^= BIT0; // Toggle P8.0
P8OUT ^= BIT1; // Toggle P8.1
__delay_cycles(750000); // Delay
P8OUT = 0x00;
__delay_cycles(5000000);
}
}
Since i only want to send a 750ms pulse to the solenoid i turn the bits high, then off, followed by a 5s delay.
That's fine and dandy; but when i download the program i get:
Thu Dec 13, 2012 16:44:57: Download complete.
Thu Dec 13, 2012 16:44:57: Loaded debugee: C:\Users\xx\Debug\Exe\Alann IO+.d43
Thu Dec 13, 2012 16:44:58: Target reset
Thu Dec 13, 2012 16:44:58: Failed to read one or more register values (busy).
Now when i run the program i have no breakpoints but it stops at
__delay_cycles(750000); // Delay
with the message
Thu Dec 13, 2012 16:49:11: Target execution stopped
Any clue why the IDE is not liking this code?