How to achieve 150 nanoseconds level of accuracy in K32W baremetal programming

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

How to achieve 150 nanoseconds level of accuracy in K32W baremetal programming

752 Views
sd05
Contributor III

Hello Community,

We are developing openthread device using K32W module and we have taken reference of openthread REED bare metal example.
We wanted to interface one 4x4 LED which will be controlled by single pin of K32W.  As per the datasheet the data transfer to RGB LED is based on single NZR communication mode. This 4x4 LED board need to be provided on-off pulse in nanoseconds duration. Following are the timings detail.

sd05_0-1641745115310.png

We tried few methods but unable to achieve required level of delay.
We tried configuring reload register of SysTick to give interrupt every microsecond but  after configuring reload register anything below 10microseconds causes the cli to block and no other task gets executed. K32W datasheet says RTC timer supports 1ms resolution only. As per our understanding CT32B0 and CT32B1 timer/counter can be used to generate 1 ns resolution. Can you guide us how we can use these timers or generate 1nanosecond timers in openthread REED bare metal example?

Datasheet of 4x4 RGB click module:https://download.mikroe.com/documents/datasheets/WS2812.pdf

Please guide what can be the best way to program/control led(s).

We also have requirement to dynamically change the led color.

thanks in advance!!

 

Labels (1)
0 Kudos
1 Reply

741 Views
bobpaddock
Senior Contributor III

What that chart is saying is there is a 600 ns tolerance, most likely across temperature, of a 800 kHz (1/1.25 us) signal.  It is not saying that a 6.667 MHz (1/150 ns) signal is needed.

Things are most likely not working because things are going to fast.

If your micro has a FlexIO module, which is a 32 bit shift-register, use that as the LED driver to further relax the software timing constraints.



See:

https://mcuoneclipse.com/2016/05/22/nxp-flexio-generator-for-the-ws2812b-led-stripe-protocol/

 

 

 

0 Kudos