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.
The 512 bytes of SRAM was probably a bigger challenge than the flash size for this project, of which the ATTiny85 has 8kB, which is actually huge imo.
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.
Only Ramtron seems not to exist anymore. 256kbit FRAM do, e.g. from Cypress.
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…
That caught my attention too.. the lede talks about using an ATtiny85, but the photo of the finished board shows a chip with a lot more than 8 pins.
The project page mentioned using ATMegaxx8 which matches with 28 pin DIP shown in the picture.
Yup, it’s an ATMEGA.
Only 6 pins are needed, so it might be possible to use a tiny85, but then you would need the reset as a pin which means a high voltage programmer. But a tiny817 could do the job.
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.
That’s precisely the point! Any AVR with 6 pins available (other than power and clock ) would do the job!
I wonder if using a EEPROM and shift register would allow for aomething other than a test screen.
It’s been invented already, and is called a ‘character generator’ :-)
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 :)
“21.4 Clock Characteristics” in the datasheet seems to indicate that when calibrated and at constant voltage and temperature the accuracy of the Internal RC Oscillator could be around +-1%.
http://ww1.microchip.com/downloads/en/DeviceDoc/Atmel-2586-AVR-8-bit-Microcontroller-ATtiny25-ATtiny45-ATtiny85_Datasheet.pdf
1% is just an accuracy figure. The datasheet tells nothing about internal oscillator/PLL stability.
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!
Important to not that there are 2 sizes of tic-tac boxes, the small and large one, which makes quite a difference