![]() There is an alternative set of functions for controlling PWM… To see the above PWM HAL Functions in action, check out the PWM Demo Source Code… The above PWM HAL Functions are defined here… BL602 Demo Firmware Binaries: customer_app.zip.More details)ĭownload the BL602 Demo Firmware Binaries… (The firmware was modified to run without a Device Tree. Now we’ll switch PineCone to the Modified PWM Demo from the BL602 IoT SDK. Let’s experiment with the RGB LED on PWM… 5 Control RGB LED with PWM Remember that we tweaked the spacing of the blinking to get many levels of brightness? The table says that GPIO 11, 17 and 14 may be mapped to PWM Channels 1, 2 and 4 (by calling the PWM HAL Functions). Let’s match the 3 GPIO Pins and 3 PWM Channels to the Pin Mapping Table: BL602 Reference Manual () Each PWM Channel will let us strobe the output on one pin. Here’s the schematic for PineCone’s RGB LED…ĬH1, CH2 and CH4 are PWM Channels. Thankfully we have Pulse Width Modulation (PWM)… Our BL602 Microcontroller (and many others) will happily strobe the LED pins for us, without coding any loops. No time for reading sensors or transmitting data! Not a good idea, because our microcontroller will become very busy blinking the LEDs. ![]() How shall we program the rapid blinking? Call the GPIO Functions in a loop? We’ll get many, many shades of grey! (>50 yes!)Īnd if we apply this nifty trick to each of the RGB LEDs, we’ll get our Full Colour RGB LED! Now what if we tweak the spacing between the On and Off parts (keeping the same blinking frequency)… This will let us switch each LED On and Off, nothing in between (no 50 shades of grey)…īut what if we strobe or blink the LEDs very quickly (a thousand times a second)…Īha! We’ll see something that’s neither On nor Off… It’s halfway between Light and Dark! GPIO Pins are binary (not analogue)… So are LEDs. Only 8 colours?! That’s not a Full Colour RGB LED! PineCone RGB LED Schematic 1 Control RGB LED with GPIOĪccording to the PineCone Schematics, the onboard RGB LED is connected to these GPIO Pins… “Quick Peek of PineCone BL602 RISC-V Evaluation Board”.If you’re new to PineCone BL602, check out my article… Through the Demo Firmware we shall learn to call BL602’s Hardware Abstraction Layer in C to perform GPIO and PWM Functions. We’ll do this with the GPIO and PWM Demo Firmware from the BL602 IoT SDK. Today we shall take control of PineCone’s Onboard RGB LED in two ways… PineCone BL602 RISC-V Evaluation Board connected to Pinebook Pro 9 Appendix: Fix BL602 Demo Firmware for macOS.4 From GPIO to Pulse Width Modulation (PWM).Control PineCone BL602 RGB LED with GPIO and PWM
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |