GrumpyOldPizza wrote:It's my understanding that for the M0 core in the nRF51 the Systick got not implemented. That would force you to use one of the RTC peripherals, clocked off 32768Hz. So a lot of the standard Cortex-M0 code will not work that easily. Bunch of details like this that derail you coming from other Cortex-M0 products.
Yes. Unfortunately it doesnt have systick
So the work around is to use a timer to generate these (which is one less timer that can be used for other purposes)
I think hardware PWM is limited to 3 pins, partially because of this and generally the lack of timers. So people have written a softPWM lib to partially get around the problem.
I'm currently trying to get a nRF51 watch to keep time using an interrupt every second, and this seems generally OK, but I the watch suddenly lost or gained a load of time after I left it running for about 8 hours.
Actually I want to run it from the 32khz crystal, as I want to run the whole device in its low power mode most of the time, and I think in that mode, it is actually running the whole processor from the 32khz crystal rather than the 16Mhz
Luckily most of the nRF51 devices I have, contain the 32Khz, as if they don't then keeping time is a pain, as it requires constant recalibration of the 32kHz RC Osc against the 16Mhz main system clock, which entails the MCU waking up to calibrate its self every few seconds. (though this setting can be changed to shorter or longer durations)