Hello, my thesis work is based on LPC845 breakout board, i'm trying to generate a square signal on event match of the counter, because i need to understand well SCTimer, for more complex application later on my thesis.
I generated the code with config tool.
For the final application, my supervisor want to use a SCTimer with unified 32bit counter (as the reference paper), my problem is that the SCTimer goes well with configuration of two 16 bit counters, but when i switch to unified 32 bit counter, no output is produced.
I read the SCTimer cookbook, datasheet but i don't find anything that could help me to make it work.
Here the generated code:
const sctimer_config_t SCT0_initConfig =
{
.enableCounterUnify = true,
.clockMode = kSCTIMER_System_ClockMode,
.clockSelect = kSCTIMER_Clock_On_Rise_Input_0,
.enableBidirection_l = false,
.enableBidirection_h = false,
.prescale_l = 99U,
.prescale_h = 0U,
.outInitState = 0U,
.inputsync = 0U
};
uint32_t SCT0_event[1];
static void SCT0_init(void)
{
SCTIMER_Init(SCT0_PERIPHERAL, &SCT0_initConfig);
/* Initialization of state 0 */
SCTIMER_CreateAndScheduleEvent(SCT0_PERIPHERAL, kSCTIMER_MatchEventOnly, 100, kSCTIMER_Out_0, kSCTIMER_Counter_L, &SCT0_event[0]);
SCTIMER_SetupOutputToggleAction(SCT0_PERIPHERAL, kSCTIMER_Out_0, SCT0_event[0]);
SCTIMER_SetupCounterLimitAction(SCT0_PERIPHERAL, kSCTIMER_Counter_L, SCT0_event[0]);
SCTIMER_StartTimer(SCT0_PERIPHERAL, kSCTIMER_Counter_L);
}
Anyone who spot the errors or can just give me some hints to make it work properly? Thank you.
Hello,
How about refer to the simple PWM demo under SDK:
BR
Alice