Hi Team,
I planning to use vibration motor with nrf52832.
vibration motor will give maximum buzz on 20.3KHz(50 duty cycle).
So my question is
- Can I achieve 20.3KHZ signal with PWM on nrf52832?
- Is there any example code for that?
Hi Team,
I planning to use vibration motor with nrf52832.
vibration motor will give maximum buzz on 20.3KHz(50 duty cycle).
So my question is
- Can I achieve 20.3KHZ signal with PWM on nrf52832?
- Is there any example code for that?
1/20300Hz = 49,26µs periods. At 16MHz a TIMER can count to 788 in 788*62,5ns = 49,25µs, giving a frequency of 20,305kHz If you need more precision you'll need to use the PWM peripheral.
Search devzone for PWM related questions and see the Timer Example and PWM Library Example, or PWM Driver Example.
The PWM Library Example uses a TIMER and GPIOTE to create an HW PWM.
1/20300Hz = 49,26µs periods. At 16MHz a TIMER can count to 788 in 788*62,5ns = 49,25µs, giving a frequency of 20,305kHz If you need more precision you'll need to use the PWM peripheral.
Search devzone for PWM related questions and see the Timer Example and PWM Library Example, or PWM Driver Example.
The PWM Library Example uses a TIMER and GPIOTE to create an HW PWM.