After I got my FRDM-K82F broad I am keep thinking how to use FlexIO to made project easy.
Even though I read most of document about how to use FlexIO at CAMERA/I2C/I2S/IRDA/LCD/PWM/SPI/UART/STATE MACHINE. I still not understand how to setting FlexIO and I think the key point is it don't have graphical settings GUI.
Here I try my first project - using FlexIO to control WS2812B RBG LED. What is WS2812B? You can find it's datasheet here. As I know it is an RGB LED with IC embed. That can be control with only one wire and it can be serial connected mean only 3 wires are need power/gnd/dataout (if want feedback one datain more).
Why WS2812B? Because I saw this pdf. It's pretty cool send high speed signal to control WS2812B without core only peripheral. So I am thinking if it possible using FlexIO to do as it.
But yesterday before I sleep I thought of K82F only have 3.3V and WS2812B need 5V. I don't have ant level-shift IC at home means I can't finish this project this weekend. Luckily I have intel IOT start kits include stepper diver that I can use it to shift my signal. Finally I have finished hardware connect as below.
I use PTB2 the FXIO0_D2 as signal out connect it to ULN2003 in1 shift to 5V level and connect to first WS2812B data in pin then connect its data out to second WS2812B data in. It simple hardware.
Now I am start coding.
First, we must know WS2812B's communication.
Below show data send speed is 800KHz and control speed must bigger than 2.4MHz.
Below show data transmission method.
I follow SDK_2.0_FRDM-K82F-KSD driver_examples to try but it's not working. I need oscilloscope to fix it. I must to say FlexIO is hard with beginner!!!
Comments