Tiny logic analyzer on Attiny2313

Sometimes in digital electronics you need to figure out how things communicate. Maybe you need to hack LCD, or capture data packets from unknown device. This is some sort of reverse engineering. To do this you definitely need a logic analyzer. As a hobbyists you might skip the buying option especially when you need it rarely. Joonas have been debugging his PS/2 keyboard project and decided to build a simple logic analyzer to ease the work.

avr logic analyzer

As base he’s chosen Attiny2313 microcontroller clocked at 20MHz. FT232RL USB to serial converter takes care of sending data to PC. Using fast serial mode it is possible to achieve 1Mbps baud. Attiny2313 has 8 port B pins that are used for 8 channels. For sake of speed microcontroller software simply sends port B values to USART using interrupt routine. On PC using terminal software like Putty the data can be captured and logged that are then plotted for analysis. Analyzer is capable to capture rates up to 100kHz. This is not very high but for slower signals might do the business.

The Definite header

It’s an advanced level programming header that could be placed OVER the AVR microcontroller to save space and to make fast and easy/plug ‘n play connections. The first prototype was developed for the Attiny2313 and did just that; it connected the programming header pins to the appropriate pins. This is the basic straddling header with a 6 pin header. The ‘definite’ straddling header was also developed, that also included some stuff that almost every AVR circuit needed and that was more or less ‘fool-proof’.


The definite header has decoupling capacitors of the required value so as to save the controller from large switching current. It also provides ease of accessibility to place a crystal of the highest frequency the specific AVR can handle on the board, including the SMT capacitors. For the ‘breadboard’ pins they have provided extra-long pin headers. These can be fed ‘through’ the board for included stability. There is also an extra pin next to the reset pin is on pin D0, so you it to add a Led there to make it easy to flash your first blink-led program to test your AVR programming chain (and/or the specific AVR). The only downside there is, that if you are going to use the serial on higher speeds, the Led could be bothersome.


Simple audio feature makes board game special

Board games are fun to play in group. No matter if you are a kid or adult, you can get involved pretty quickly. Makapuf with his son has been working on board game called goose board game. It is a game where you have to roll a dice and advance along the track where adventures and bonuses awaits. The design and rules were sons task while he took par of electronics. He wanted to make it interactive by playing sounds.

Any microcontroller is capable to generate sounds using PWM. Attiny2313 microcontroller seems to be perfect candidate to generate 8-bit 8kHz sampled sounds. Audio is sampled through NPN transistor which has a minimal RC filter to improve it. Of course microcontroller memory is way to small to store audio files, so he used AT45D 4Mb serial flash module. In order to store audio files in flash memory Makapuf build a simple file system to keep track of files. There is no way to store normal FAT file system as it requires much more SRAM that Attiny2313 has. To program dataflash memory he used simple Arduino sketch which takes advantage of dataflash library. This is only the basic setup. It can be improved in many ways by adding sensors, improving sound, giving more tricks and jokes. It’s up to you if this becomes more fun to make a game or play it.

Outside thermometer based on Attiny2313

Today modern cars are equipped with outside and inside thermometers. But some older ones are missing this feature. Sometimes it is good to know what temperature is outside while driving. You can stick one of those gadgets on your windshield. But why buy, if you are capable of building a decent thermometer using small micro. Check out this thermometer based on DS18S20. Attiny2313 microcontroller does the reading of temperature value and displays it on LCD.

attiny2313 DS18S20 thermometer

Since thermometer is gonna be used in the car. Special care is taken when designing power supply part. It’s a noisy environment where voltages can spike up to 40V. An LM2574 regulator is used with inductive and cap filtering to get stable 5V supply. Original design was intended to be used in Dacia Duster. Bright LCD nicely fits in free space on panel.