nRF51 SDK
|
Modules | |
main.c | |
PWM Analyzer Example Application main file. | |
This PWM Analyzer Example uses Timer 1 to read the duty cycle from an input pin and outputs it on the output port 1 with the duty cycle value from 0 to 255. Pin 0 (Button 0) is used as the input pin, and the output value is outputted to the LEDs. It uses the hardware delivered in the nRF51822 Development Kit.
The application starts with configuring the GPIOTE, setting inputs and outputs, enable interrupt on event, and configuring events to the input pin. The PPI peripheral is configured to capture the Timer 1 value into CC[0] and CC[1] registers at high-to-low and low-to-high transitions, respectively. Timer 1 is configured and enabled, and the GPIOTE interrupt is enabled.
Instructions on how to set up the nRFgo Motherboard: nRFgo Motherboard Setup (nRF6310).
LED assignments:
Button assignments:
The PWM Analyzer Example Application can be tested as follows: