Write an application that interfaces with an input and/or output device

Fer à souder is French for "soldering iron". I learned this when I was looking for one in Quebec on a Sunday morning after my impromptu wirings got ripped.

My idea for this week was to write an application for controlling the charliplex LED matrix, which naturally required adding a serial connection to the basic charlieplex board. Unfortunately, I didn't have time to design and make a new board before I went away for Thanksgiving, so I had to improvise.

I picked the ATTiny44's PB0 and PB1 as my input and output pins, respectively, and soldered a couple of wires directly to them. I then soldered the other end to a 2x1 header, and connected it to an FTDI cable: PB0 to TX, PB1 to RX. This hack held on for four days and over 500 miles of driving before one of the wires got ripped. One-way communication was good enough, but when the other wire got disconnected a few hours later I had to fix it; hence the search for a soldering iron.

My Python application receives a character from the user and sends it to the board, which then displays that character on the LED matrix. This tutorial and Matt Keeter's code from last week were very helpful references.

The application communicates with the board using interrupts. After a few hours of futile attempts based on what I found in the datasheet and over the Internet, Toni referred me to Neil's interrupt handler sample from four weeks ago. After making a few changes, I got it to work with my configuration: PB0 listens on PCINT8; interrupt vector: PC1INT_vect; mask: PCMSK1.

Note that Neil's code is written for an ATTiny44 with a 20MHz crystal, but you can get it to work at 9600 baud without the crystal: in the C code, change bit_delay_time to 100; in the makefile, set F_CPU to 8000000.

My code is here.

  • 00
  • 01
  • 02
  • 03
  • 04
  • 05
  • 06
  • 07