Interpretation of built-in routines of the nrf51 SDK

Source: Internet
Author: User

Simple PWM motor control example simple_pwm_motor_control_example

In fact, it is PWM to control the LED brightness.

1. First, set gpiote to a high level
2. Then set the compare0 and compare1 of the PPI timer timer2 to trigger gpiote flip.
3. Set the timer timer2 pre-division to 4 by clock 16 MHz per tick = 16000000/2 ^ 4 exactly for 1us
Set low point with cc0 as PWM to full PWM cycle CC2 enable compare2 interrupt compare1 reset for PWM High Point
The execution sequence should be cc0-> CC2-> cc0-> cc0 triggered interruption at the gap between CC2 and cc0, thus changing the PWM duty cycle.

Interpretation of built-in routines of the nrf51 SDK

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.