nRF51 SDK - S110 SoftDevice
|
The Motor Control Example project shows a PWM waveform generation where the timer resets after each full period. It generates a variable duty cycle pulse train on selected GPIO pin. By default the PWN waveform generation will have a duty cycle of 1/256. If Button 1 is pressed the duty cycle is set to 224/256. If only Button 0 is pressed duty cycle is set to 32/256. This example application could be controlling a step motor. It uses the hardware delivered in the nRF51822 Development Kit.
The application starts with configuring the GPIOTE by setting inputs and outputs, and setting channel 0 to toggle pin 8 (LED 0). The PPI peripheral is configured to toggle pin 8 (LED 0) on every Timer 2 COMPARE[0] and COMPARE[1] match. The Timer 2 is initialized and the interrupts are enabled.
Instructions on how to set up the nRFgo Motherboard: nRFgo Motherboard Setup (nRF6310).
LED assignments:
Buttons assignments:
The Motor Control Example Application can be tested as follows: