white-collar daily wear
WS2812S ON A 6502
WS2812S ON A 6502

WS2812S ON A 6502

We can still keep in mind when the WS2812 LED very first came into our consciousness, method back in the mists of time. The timing diagrams in the datasheet-of-questionable-veracity made it noise rather tricky, with tight timing tolerances as well as essentially a high-speed two-bit PWM data protocol at 500 kHz. It was a difficulty to bit-bang with an ATtiny85 back then, however there’s no method something as old as well as crusty as an Apple II would be as much as snuff, right?

[Anders Nielsen] took up the difficulty of getting the venerable 6502 processor to drive Neopixels as well as won! After all, if the chip is great sufficient for Bender as well as the Terminator T-800, it should be able to blink some colored LEDs, right? The trick sauce is shift registers!

Specifically, [Anders] abuses the 74LS165 parallel-in, serial-out shift register for his filthy work. instead of bit-banging the WS2812’s “long high is a 1, short high is a 0” signal directly, the very first few bits of the shift register are hard-wired to VCC as well as the last few to GND.

The bits in the middle determine if the pulse shifted out is long or short, as well as they’re set by the 6502, with a 6522 via chip, just like the Apple II would have. Clocking the data out of the shift register handles the timing-critical stuff. extremely clever!

Video below the break.

Leave a Reply

Your email address will not be published. Required fields are marked *