I wasn't able to figure out what the problem is, and I've been at it for a week now :(
I believe that everything is working the way it should. I put a breakpoint on the init() function call and inside of the function itself, but it is clear that it is going into that code because I can see the buck voltage toggling on and off, which is what I do in my init(); function. I also swapped P1DIR and P1OUT with no luck :( if someone could look at my code and figure out the issue, that would be really great:
int main(void)
{
WDTCTL = WDTPW + WDTHOLD; // Stop watchdog timer
// CODE NEEDED TO SET UP USI SPI MASTER MODE
DCOCTL = CALDCO_1MHZ;
P1OUT |= CS;
P1DIR |= CS; // Set P1.2 to output direction
P1DIR = 0xFF; // Unused pins as outputs
P2OUT = 0;
P2DIR = 0xFF;
USICTL0 |= USIPE5+USIPE6+USIPE7+USIMST + USIOE; // Port, SPI master
USICTL1 |= USIIE; // Counter interrupt, flag remains set
USICKCTL = USIDIV_0 + USISSEL_2;
USICTL1 |= USICKPH;
USICNT |= USI16B;
USICTL0 &= ~USISWRST;
_enable_interrupts();
// EXTRA CODE TO ALLOW GPIO PINS TO BE USED
P1IE |= EN_0; // GPIO pin
_bis_SR_register(LPM0_bits + GIE);
one_second_delay(); // one of my functions to act as a NOP in this case.
init(); // CODE KEEPS GETTING HERE AND STARTS RUNNING THIS FUNCTION
}
I put everything into my main function just to make it clear with everything being initialized and called on in one place. If anyone sees any unnecessary lines, let me know and I can eliminate them and first see if my original init(); still works on its own, and then check to see if it fixed the current problem. Any help would be greatly appreciated!
Thanks,
Matt