|
5 | 5 |
|
6 | 6 | An embedded-hal driver for ws2812 leds using spi as the timing provider.
|
7 | 7 |
|
| 8 | + |
| 9 | + |
8 | 10 | It provides two variants:
|
9 | 11 | - The normal usage
|
10 | 12 |
|
11 | 13 | Your spi peripheral has to run betwee 2MHz and 3.8MHz & the SPI data is created on-the-fly.
|
12 |
| - This means that your core has to be reasonably fast (~48 MHz). |
| 14 | + This means that your core has to be reasonably fast (48 MHz should suffice). |
13 | 15 | - Prerendered
|
14 | 16 |
|
15 |
| - If your core is too slow or your SPI peripheral has a different frequency, you |
| 17 | + If your core is too slow (for example, the AVR family), you |
16 | 18 | may want to use this. It creates all the data beforehand & then sends it. This
|
17 | 19 | means that you have to provide a data array that's large enough for all the
|
18 | 20 | spi data.
|
19 | 21 |
|
20 | 22 | ## It doesn't work!!!
|
21 | 23 | - Do you use the normal variant? Does your spi run at the right frequency?
|
22 | 24 |
|
23 |
| - Lots of embeded devices don't support this, so you may need to look at your |
24 |
| - hal implementation and at your data sheet. If you use the prerendered version, |
25 |
| - you should also verify that the spi frequency matches the requirements. |
| 25 | + Your CPU might be too slow, but this can also depend on the HAL implementation |
| 26 | + & your Iterator chain. Using the `prerendered` variant might help. For many |
| 27 | + SPI peripherals, the clock generations is way less sophisticated than e.g. |
| 28 | + the UART peripheral. You should verify it runs at an acceptable frequency, by |
| 29 | + either studying the datasheet & the hal code or using a logic analyzer. An |
| 30 | + fx2 based one, commonly available under $10 works great for this. |
26 | 31 | - If the first led is always on, no matter what data you put in, your spi is
|
27 | 32 | probably not setting the mosi line to low on idle (You can check with a multimeter).
|
28 | 33 | It may also be a timing issue with the first bit being sent, this is the case
|
|
0 commit comments