Is there a way to drive WS2811 led's with ZBasic ?
I have used APA102 led's that don't require strict timing , but these are hard to source ...
WS2811 needs a timing resolution of 0.25us ...
Even OutputCapture on a ZX24x/u can't handle this fast transitions ..?
WS2811
Re: WS2811
That's true. It might be possible to bit-bang the protocol but the RTC interrupts (and others) may interfere with the timing. Certainly you'd have to have interrupts disabled for the duration of a transmission sequence.kurakaira wrote:Even OutputCapture on a ZX24x/u can't handle this fast transitions ..?
I haven't worked out how long that might be but, generally speaking, if interrupts are disabled for more than 1-1/2 times the period of the RTC interrupt then interrupts will be missed. For the 14.7MHz devices the RTC interrupt period is 0.977 mS. That would mean that the maximum number of bits that could be transmitted would be about 1200. That may be enough to accomplish what you need.
There is an article on instructables.com showing how to bit-bang the data transmission for an Arduino device. The author uses assembly language in order to precisely control the timing of the sequence of changes of an output pin. The code could be used, with few changes, on a native mode mega-based ZX device.
https://www.instructables.com/Bitbangin ... f-WS2811-/
There are references in that article to work done by Adafruit and PJRC. If you can find that code you may well be able to adapt it to a ZX.
- Don Kinzer