Other Parts Discussed in Thread: MSP-EXP430FR2433
Tool/software: Code Composer Studio
I have a very basic program that consists of an infinite loop that toggles an output pin. Within the loop I call an assembly language function. Every 38 mSec the processor seems to reset. The assembly language function consists of one instruction: RET.
If I remove the call to the function, the program operates as expected (no resets).
Pin P2.7 is set outside the loop and should remain high forever. Pin 2.3 is toggled in the loop. When the reset occurs, both pins appear to tri-state and slowly decay to zero. During the 38 mSec interval between resets the program seems to operate normally.
I am using CCS version 8, and the MSP-EXP430FR2433 development board.
I am new to the MSP430, so I'm sure I'm doing something silly, but have been unable to find it.
C code:
//----------------------------------------
// bug_hunt
// demonstrates processor reset problem
//----------------------------------------
#include <msp430.h>
extern void readXY(void);
/**
* main.c
*/
int main(void)
{
WDTCTL = WDTPW | WDTHOLD; // stop watchdog timer
P2DIR = 0x8C;
PM5CTL0_L &= ~LOCKLPM5;
P2OUT = 0x80; // Set P2.7 high, should remain high forever
while(1)
{
readXY();
P2OUT ^= 0x08; // toggle P2.3
}
return 0;
}
Assembly code:
;---------------------------------
; assembler functions for bug_hunt
; --------------------------------
.global readXY
readXY:
ret