hi,
I want to use PPI function for timer trigger to PWM, but I noticed PWM doesn't have TASK_START register, please see the pictures.
how can I start PWM by timer?
thanks
hi,
I want to use PPI function for timer trigger to PWM, but I noticed PWM doesn't have TASK_START register, please see the pictures.
how can I start PWM by timer?
thanks
Hi,
As you can read in the PWM peripheral documentation, each PWM instance can set two separate sequences, SEQ[0] and SEQ[1]. These are started using TASKS_SEQSTART[0] and TASKS_SEQSTART[1]. See Figure 7 for a sequence diagram of the simplest PWM operation.
Best regards,
Jørgen
Hi,
As you can read in the PWM peripheral documentation, each PWM instance can set two separate sequences, SEQ[0] and SEQ[1]. These are started using TASKS_SEQSTART[0] and TASKS_SEQSTART[1]. See Figure 7 for a sequence diagram of the simplest PWM operation.
Best regards,
Jørgen
yes, but PPI only assigned one task, how can we assign two tasks(TASKS_SEQSTART[0],TASKS_SEQSTART[1]) by one PPI channel?
What are you trying to achieve? It is possible to assign a second task to be triggered by a PPI channel using the FORK, but I can't see why you would want to trigger both tasks at once. You can configure the PWM peripheral to play the sequences after each other by setting the LOOP and SEQ[n].CNT registers, see figure 6 and the code above in PWM peripheral documentation. If you want to trigger both SEQSTART tasks at different times, you need to use two separate PPI channels.
I only want to start two PWM synchronously, no delay time, so I will use PPI, and every PWM used complex playback function, SEQ[0] and SEQ[1] have data too.
So I want to know how to trigger PWM by PPI, but PWM doesn't have TASK_START register as TIMER, you said only start TASKS_SEQSTART[0] and TASKS_SEQSTART[1] for PWM, these two registers needn't start synchronously.
could you tell me how to trigger PWM by PPI?
You can't start both sequences at the same time. If you want to generate two separate PWM signals and need them to be synchronized, you can use two separate PWM instances and start each of them (through one of the TASKS_SEQSTART[n] registers) from a PPI channel with a fork. It is also possible to use two separate PPI channels and trigger them both from the same timer EVENT.
could you see my code? I write "NRF_PWM_TASK_SEQSTART0", it does not start. but I write "NRF_PWM_TASK_STOP", it can stop PWM normally. So I think the PWM start register is wrong. where should I change it.
Thanks
void timer0_event_handler(nrf_timer_event_t event_type, void* p_context) { nrf_drv_pwm_uninit(&m_pwm1); r0=1;r1=1;Count_Ring0=0,Count_Ring1=1; nrf_drv_pwm_uninit(&m_pwm0); t0=1;t1=1;Count_Tip0=0,Count_Tip1=1; }