I'm looking to add PWM functionality to my design to drive an LED. Examples exist for other devices, and those don't use the SoftDevice. Is there an example or some reference design for making the PWM module work with the nRF51822 and SD?
I'm looking to add PWM functionality to my design to drive an LED. Examples exist for other devices, and those don't use the SoftDevice. Is there an example or some reference design for making the PWM module work with the nRF51822 and SD?
Hi, I have the problem that my custom Timer controlled PWM has the same bug as yours had. I sometimes get inverted PWM output.
Could you point out what was necessary to circumvent this??
I try to update CC values for a timer at runtime by:
void setPw(uint8_t pw) {
gPulseW = pw;
uint8_t period = 8 * gPeriod;
NRF_TIMER0->CC[0] = pw;
NRF_TIMER0->CC[1] = period/2;
NRF_TIMER0->CC[2] = period/2+pw;
NRF_TIMER0->CC[3] = period;
}
I tried to stop and start again, reset EVENTS_COMPARE Register, ... I don't seem to find the bug ...
any help appreciated
Hi, I have the problem that my custom Timer controlled PWM has the same bug as yours had. I sometimes get inverted PWM output.
Could you point out what was necessary to circumvent this??
I try to update CC values for a timer at runtime by:
void setPw(uint8_t pw) {
gPulseW = pw;
uint8_t period = 8 * gPeriod;
NRF_TIMER0->CC[0] = pw;
NRF_TIMER0->CC[1] = period/2;
NRF_TIMER0->CC[2] = period/2+pw;
NRF_TIMER0->CC[3] = period;
}
I tried to stop and start again, reset EVENTS_COMPARE Register, ... I don't seem to find the bug ...
any help appreciated