Other Parts Discussed in Thread: LP-MSPM0L1306,
I have problem with the main clock when I am running on 4MHz internall system oscillator and using Timer. It switch to 32 MHz, when timer interrupt is enabled. Bellow is complete description how I uncover the problem. Code below was tested with optimization level 0, ccs1250, mspm0_sdk_1_20_00_05, LP-MSPM0G3507, LP-MSPM0L1306. Behaviour of both development kits were identical. I haven't found how to continue with the 4 MHz clock.
I found this problem described in Errata - SYSOSC_ERR_01. The workaround doesn't help. I tested many Low Power Policy including STOP0 mode and SYSOSC FCL (SYSCFG > SYSOSC (Internal System Oscillator) > Enable Frequency Correction Loop) is disabled.
LP-MSPM0G3507:
Here is complete description where the problem occur. On empty project I made some changes.
SYSCFG:
- SYSCTL:
- Main Clock Divider = 4
- SYSOSC Frequency (Internall System Oscillator) = 4MHz
- Add SYSTICK:
- Initialize Period = true
- Period = 1000
- Enable SysTick Interrupt = true
- Enable SysTick And Start Counting = true
- Add GPIO:
- Group Name = GPIO_GRP_0
- Pin Name = PIN_0
- Assigned Port = PORTB
- Assigned Pin = 0
Main code:
#include "ti_msp_dl_config.h" int main(void) { SYSCFG_DL_init(); while (1) { __WFI(); } } void SysTick_Handler(void) { DL_GPIO_togglePins(GPIO_GRP_0_PORT, GPIO_GRP_0_PIN_0_PIN); }
Now the pin A0 toggle at pretiod 1ms. Then I add timer.
SYSCFG:
- Name = TIMER_0
- Desired Timer Period = 1 ms
- Start Timer = true
- Interrupts Configuration (Enable Interrupts) = Zero event
Added in the code:
void TIMG0_IRQHandler(void) { }
And now pin A0 toggle at pretiod 1/8 ms. The probles is in the function DL_TimerG_enableInterrupt(TIMER_0_INST , DL_TIMERG_INTERRUPT_ZERO_EVENT) in SYSCFG_DL_TIMER_0_init(), because it changes register SYSCTL_CLKSTATUS > SYSOSCFREQ from 01 - SYSOSC4M to 00 - SYSOSC32M.
LP-MSPM0L1306:
Identical result as abowe. On empty project I made some changes.
SYSCFG:
- SYSCTL:
- Main Clock Divider = 4
- SYSOSC Frequency (Internall System Oscillator) = 4MHz
- Add SYSTICK:
- Initialize Period = true
- Period = 1000
- Enable SysTick Interrupt = true
- Enable SysTick And Start Counting = true
- Add GPIO:
- Group Name = GPIO_GRP_0
- Pin Name = PIN_0
- Assigned Port = PORTA
- Assigned Pin = 0
Main code:
#include "ti_msp_dl_config.h" int main(void) { SYSCFG_DL_init(); while (1) { __WFI(); } } void SysTick_Handler(void) { DL_GPIO_togglePins(GPIO_GRP_0_PORT, GPIO_GRP_0_PIN_0_PIN); }
Now the pin A0 toggle at pretiod 1ms. Then I add timer.
SYSCFG:
- Name = TIMER_0
- Desired Timer Period = 1 ms
- Start Timer = true
- Interrupts Configuration (Enable Interrupts) = Zero event
Added in the code:
void TIMG0_IRQHandler(void) { }
And now pin A0 toggle at pretiod 1/8 ms. The probles is in the function DL_TimerG_enableInterrupt(TIMER_0_INST , DL_TIMERG_INTERRUPT_ZERO_EVENT) in SYSCFG_DL_TIMER_0_init(), because it changes register SYSCTL_CLKSTATUS > SYSOSCFREQ from 01 - SYSOSC4M to 00 - SYSOSC32M.