32 Shades Of Gray

The ATtiny85 is an incredible piece of engineering. In just eight pins, you get a microcontroller with just enough oomph to do some really heavy lifting. You get an Open Source toolchain, and if you’re really good, you can build your own programmer. It does have its limits though; there isn’t a whole lot of Flash, and of course you’re always going to need a few extra pins.

For his Hackaday Prize entry, [danjovic] is pushing whatever limits are left with the ‘tiny85. He’s using it as a test pattern generator, pushing out pixels to any old TV. The entire circuit is powered by a coin cell, and the entire thing fits in a Tic-Tac box.

The heart of the project, as you would expect, is a resistor ladder using all six available pins, using five for luminance and one for the sync. That is thirty-two shades of gray, if you’re keeping track. The trick is using the internal PLL and a bit of math to calculate the proper resistor values. The result is just a test pattern, yes, but [danjovic] managed to get a test pattern that has a resolution of 850 pixels across. That’s not bad by any measure.

Of course, if grayscale isn’t your thing, you can also use the ‘tiny85 to send Never The Same Color over the air or even push out the jams over a VGA port.

16 thoughts on “32 Shades Of Gray

    1. Thanks bty and article author Brian Benchoff,
      I’ve been reviewing the smallest silabs/cygnal 8051 based CPUs more recently especially since I almost dream in 8051 assembler ! Back in 1999 did a rs232 to Pocsag encoder to feed maxon vhf transmitters for local area paging with the then dip atmel at2051 with about 2k flash and 256 bytes ram.The simplest way to extend the internal ram for things like comms fifo queuing and store of keywords was to use Ramtron’s ferroelectric serial eeprom’s. These i2c rams most robust with 10M+ cycle write claim we didn’t get close to (1M spec would have been fine) and that was a long time ago now as rate of change accelerated.

      Fwiw. In the old days of Motorola’s HC705C8 one could use spare rom capacity to defray ram needs just a little by being crafty with ram data segmentation even nibble wise with exploiting rom lookup tables and shuttling registers. Of course a couple of earlier author’s routines had to be rewritten to make them match the model. This was only a fix to add more Pocsag functionality, not recommended as a design technique at day one.

      I wonder if others have done anything similar in last 20 odd years in matching smallest CPU with serial eeprom’s as ram extension with added benefit of some nonvolatile storage ? What would be a comparable mix these days ie any smallest 2-8k flash micro with matched i2c fast long life constant use serial eeprom (by write with reads no limit). I mean the eeprom’s duty cycle of order of only 2-10kbytes per sec write (max) each 5 sec average and spread over its entire address space too as in a fifo type arrangement, except for a ‘secure’ block of 1% total eg constants, signon, keyword log etc. Unfortunately a casual minimal search so far hasn’t found much comparable to the old 256K Ramtron’s with some 10M write cycle life at the low power iirc these had back then.

  1. Did you (Mr. Hackaday ‘editor’) even read the project page? He gave up on the attiny and is using an atmega. It is an understandable mistake, the layout of hackaday.io is so terrible that digging the actual project information out requires a fair bit of dedication…

      1. I think the main problem the project creator ran into was the internal rc oscillator in the tiny had far too much jitter so they needed to use an external crystal but on a tiny that would use up physical pins that are necessary for the R2R ladder. So even though the tiny is capable of working in the processing sense, it just didn’t have enough pins to operate reliably in the context of the project as intended.

  2. Sorry people, haven’t changed the lead picture yet. Nevertheless the same code that ran on Tiny85 runs now on the Mega328 just by redefining the PORT and DDR registers.
    I consider that the most important aspect of this project was to realize how ‘fast’ is the jitter of the Tiny85 internal oscillator, as this figure isn’t listed anywhere along its datasheet.
    Worth to mention the trick with the stereo jack to save battery and avoid the use of a power switch :)

  3. You’ve covered the works of [radical brad] and his adventures with attiny’s on this website before. I don’t quite see how doing a 32-level greyscale with an attiny is so hard, and certainly not so hard you have to use a mega!

Leave a Reply

Please be kind and respectful to help make the comments section excellent. (Comment Policy)

This site uses Akismet to reduce spam. Learn how your comment data is processed.