This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
Part Number: MSP432P401R
Hi all,
I've purchase a new MSP432 Red version launchpad from TI. Currently, I have 2 MSP432 launchpads, one is Black version (old version) and the other is the new one. With the same code, the Back version work well but not for the Red version.
In the User guide of the Red version, it said that there is no change of functionality. The changes is only the hardware of the launchpad (change position of buttons, JTAG). Therefore, my code should work correctly on the Red version but it does not.
Is any one here has the same problem? If so, could you please share me the solution for this situation?
Thanks in advance guys.
Hau Le.
Hi Atmit,
Thank you so much for your information. Curently I'm using the latest version of MSP432 SDK for my project with MAP prefix in function calls. I'v tried to factory reset the launchpad but the code still doesn't work on it.
In additional, I'm using the latest CCSv8.
Do you have any other suggestion?
Best regards,
Hi Amit,
Here is the simple test code. Red LED and RGB Blue LED will be toggle periodically by using timer interrupt. I use the latest SimpleLink MSP432 SDK and no external device are required.
#include <stdint.h> #include <stdbool.h> #include <ti/devices/msp432p4xx/driverlib/driverlib.h> void Clock_Init(void); void GPIO_Init(void); static uint8_t count = 0; static bool select; uint16_t iii = 0; /* * Main function */ int main(void) { /* Halt the watch dog timer*/ MAP_WDT_A_holdTimer(); /* Disable master interrupt */ MAP_Interrupt_disableMaster(); /* Enable FPU with lazy stacking enabled for floating point operations in ISRs */ MAP_FPU_enableModule(); MAP_FPU_enableLazyStacking(); /* Initialize system clock and GPIO pins */ Clock_Init(); GPIO_Init(); /* Enable sleeping on ISR exits and enables master interrupt */ MAP_Interrupt_enableSleepOnIsrExit(); MAP_Interrupt_enableMaster(); /* Red LED */ MAP_GPIO_setAsOutputPin(GPIO_PORT_P1, GPIO_PIN0); MAP_GPIO_setOutputLowOnPin(GPIO_PORT_P1, GPIO_PIN0); /* RGB Blue LED */ MAP_GPIO_setAsOutputPin(GPIO_PORT_P2, GPIO_PIN2); MAP_GPIO_setOutputLowOnPin(GPIO_PORT_P2, GPIO_PIN2); const Timer_A_UpModeConfig upModeConfig_A3 = { TIMER_A_CLOCKSOURCE_ACLK, TIMER_A_CLOCKSOURCE_DIVIDER_1, 0x07FF, TIMER_A_TAIE_INTERRUPT_DISABLE, TIMER_A_CCIE_CCR0_INTERRUPT_ENABLE, TIMER_A_DO_CLEAR }; /* Configure timer A3 in up mode */ MAP_Timer_A_configureUpMode(TIMER_A3_BASE, &upModeConfig_A3); MAP_Interrupt_enableInterrupt(INT_TA3_0); MAP_Timer_A_clearTimer(TIMER_A3_BASE); MAP_Timer_A_startCounter(TIMER_A3_BASE, TIMER_A_UP_MODE); while (1) { /* This peace of code cannot run if I put it here */ if (select) { MAP_GPIO_toggleOutputOnPin(GPIO_PORT_P1, GPIO_PIN0); MAP_GPIO_setOutputLowOnPin(GPIO_PORT_P2, GPIO_PIN2); } else { MAP_GPIO_toggleOutputOnPin(GPIO_PORT_P2, GPIO_PIN2); MAP_GPIO_setOutputLowOnPin(GPIO_PORT_P1, GPIO_PIN0); } MAP_PCM_gotoLPM0(); } } void TA3_0_IRQHandler(void) { /* Clear timer A3 capture compare interrupt flag */ MAP_Timer_A_clearCaptureCompareInterrupt(TIMER_A3_BASE, TIMER_A_CAPTURECOMPARE_REGISTER_0); if (count++ == 8) { select = !select; count = 0; } /* This peace of code can run normally if I un-comment it */ // if (select) // { // MAP_GPIO_toggleOutputOnPin(GPIO_PORT_P1, GPIO_PIN0); // MAP_GPIO_setOutputLowOnPin(GPIO_PORT_P2, GPIO_PIN2); // } // else // { // MAP_GPIO_toggleOutputOnPin(GPIO_PORT_P2, GPIO_PIN2); // MAP_GPIO_setOutputLowOnPin(GPIO_PORT_P1, GPIO_PIN0); // } } /* * Initialize clock signals */ void Clock_Init(void) { /* Sets operation voltage to Vcore1 and use DC-DC converter */ MAP_PCM_setCoreVoltageLevel(PCM_VCORE1); MAP_PCM_setPowerState(PCM_AM_DCDC_VCORE1); /* Sets wait state */ MAP_FlashCtl_setWaitState(FLASH_BANK0, 2); MAP_FlashCtl_setWaitState(FLASH_BANK1, 2); /* Set DCO centered frequency to 48MHz */ MAP_CS_setDCOCenteredFrequency(CS_DCO_FREQUENCY_48); /* Initializing clock signals */ MAP_CS_initClockSignal(CS_MCLK, CS_DCOCLK_SELECT, CS_CLOCK_DIVIDER_1 ); MAP_CS_initClockSignal(CS_HSMCLK, CS_DCOCLK_SELECT, CS_CLOCK_DIVIDER_1 ); MAP_CS_initClockSignal(CS_ACLK, CS_REFOCLK_SELECT, CS_CLOCK_DIVIDER_1); } /* * Initialize GPIOs */ void GPIO_Init(void) { MAP_GPIO_setAsOutputPin(GPIO_PORT_P1, PIN_ALL16); MAP_GPIO_setOutputLowOnPin(GPIO_PORT_P1, PIN_ALL16); MAP_GPIO_setAsOutputPin(GPIO_PORT_P2, PIN_ALL16); MAP_GPIO_setOutputLowOnPin(GPIO_PORT_P2, PIN_ALL16); MAP_GPIO_setAsOutputPin(GPIO_PORT_P3, PIN_ALL16); MAP_GPIO_setOutputLowOnPin(GPIO_PORT_P3, PIN_ALL16); MAP_GPIO_setAsOutputPin(GPIO_PORT_P4, PIN_ALL16); MAP_GPIO_setOutputLowOnPin(GPIO_PORT_P4, PIN_ALL16); MAP_GPIO_setAsOutputPin(GPIO_PORT_P5, PIN_ALL16); MAP_GPIO_setOutputLowOnPin(GPIO_PORT_P5, PIN_ALL16); MAP_GPIO_setAsOutputPin(GPIO_PORT_P6, PIN_ALL16); MAP_GPIO_setOutputLowOnPin(GPIO_PORT_P6, PIN_ALL16); MAP_GPIO_setAsOutputPin(GPIO_PORT_P7, PIN_ALL16); MAP_GPIO_setOutputLowOnPin(GPIO_PORT_P7, PIN_ALL16); MAP_GPIO_setAsOutputPin(GPIO_PORT_P8, PIN_ALL16); MAP_GPIO_setOutputLowOnPin(GPIO_PORT_P8, PIN_ALL16); MAP_GPIO_setAsOutputPin(GPIO_PORT_P9, PIN_ALL16); MAP_GPIO_setOutputLowOnPin(GPIO_PORT_P9, PIN_ALL16); MAP_GPIO_setAsOutputPin(GPIO_PORT_P10, PIN_ALL16); MAP_GPIO_setOutputLowOnPin(GPIO_PORT_P10, PIN_ALL16); }
Thank you so much.
Hi Keith,
Thanks for your information. I've change the var "collect" to be volatile but nothing change. But I've found the reason for my issue. As you mentioned before, the issue may come from sleep. I've modified my code from
MAP_Interrupt_enableSleepOnIsrExit();
to
MAP_Interrupt_disableSleepOnIsrExit();
the code is now run correctly. Thank you so much for your support.
"the code is now run correctly."
that's an interesting fix.
So you have to enable sleep on exit to run on the old chip, and you have to disable it to run on the new chip?
**Attention** This is a public forum