This builds from the previous project:
TangNano 9K controlling multiple LED targets Part 1 of 3
NeoPixelThere is a lot of information on the web on the timing for NeoPixel, the focus will be on how to implement the timing using Verilog.
The Tang9K Nano will be configured to use the internal PLL to generate a 120Mhz clock. This clock will be used to create the proper timing required to generate the 1's and 0's for the neoPixel.
The sendPx.v file generates the sequence for one NeoPixel, the data length is 32 bits. The NeoPixel, has 4 colors Red, Green, Blue, and White. The Verilog code only creates the timing, it is up to the python script, neoTester.py to populate the proper color encoding.
/* 120_000_000 .008333 us = 10_000_000 */
// WS2812B timings
localparam T0H_count = 16'd48, // .4us
T1H_count = 16'd96, // .8us
T0L_count = 16'd102, // .85us
T1L_count = 16'd66, // .45us
GAP_count = 16'd15,
RESET = 16'd6600;// above 55usCreated a timing constants based on the 120Mhz, to generate a T0_H 48 counts running at 120Mhz generates a.4us.
sendPx.v uses an AXIS interface, to generate the timing for one neoPX. wb_neoPx.v is the wisbone interface.
WiringThe Tang9K Nano has 5v on pin 48. This is connected to the NeoPx 5v pin. The DI, is connected pin 57. See the pin file, for details. And connect the ground pins.
PythonThere is a neoTester.py. This sends the commands to the Wishbone neoPixel peripheral.





Comments