TIL311 / INL0397-1 Hexadecimal Display
Controlling a Texas Instruments TIL311 / INL0397-1
The INL0397-1 datasheet (drop-in replacement for TIL311)
The TIL311 datasheet.
Brief introduction:

On this page you will find a few examples on how to control a TIL311 hexadecimal dot-LED-display. The TIL311 was developed in 1972 by Texas Instruments, it's a display with integral TTL logic, it has a 4-bit databus, so with only a few wires you're able to display all hexadecimal numbers (0 - F), which means also all decimal numbers (0 - 9) With a microcontroller attached to it you can display various things, like temperature (e.g. 2 displays), make a counter, an electronic dice, etc. Here a diagram on how to connect a TIL311 to a microcontroller.

Example 1: Single TIL311 direct to a microcontroller
Pin numbers:

PIN 1 LED SUPPLY VOLTAGE
PIN 2 LATCH DATA INPUT B
PIN 3 LATCH DATA INPUT A
PIN 4 LEFT DECIMAL POINT CATHODE
PIN 5 LATCH STROBE INPUT
PIN 6 OMITTED
PIN 7 COMMON GROUND
PIN 8 BLANKING INPUT
PIN 9 OMITTED
PIN 10 RIGHT DECIMAL POINT CATHODE
PIN 11 OMITTED
PIN 12 LATCH DATA INPUT D
PIN 13 LATCH DATA INPUT C
PIN 14 LOGIC SUPPLY VOLTAGE, Vcc
How to program an AVR:

To control the TIL311 you must set a 4-bit number (16 values -> 6=hex, 10=deci) on the inputs. In this example use the first nibble (nibble is half a byte, 1 byte = 8-bit) of PortB of the AT90S1200. If you want to display e.g. the number 8 on the display, you must set the bit on input D of the TIL311, D has the binairy weight 8 (D=8, 1000 binairy):

ldi display, 0x08
out PORTB, display

With only a few lines of assembly you can wake-up the TIL311. The next example is a decimal upcounter with two TIL311's.
Example 2: Two TIL311's directly connected to a AT90S1200
The story continues...

The sequence goes like: 00 -> 01 -> 02, etc. when reaching 10 the first nibble must go to zero, then the counting goes on like: 11 -> 12 -> 13, etc. First start the counting process:

inc display

At this moment the counter shows 01. Is the value 10? If so increment the second nibble, if not keep the first nibble counting up, like this:

cpi display, 0x0A
brne showCount

The second nibble is exactly the other way around:

cpi display, 0xA0
brne showCount

When reaching 99 you can return or show EE (overflow) simply like this:

ldi display, 0xEE.

Don't forget to use a delay else you won't see the counting:

out PORTB, display
ldi temp, 2
rcall longDelay
rjmp upCount
2 display Up counter:

In this example you see two TIL311's conencted to an AT90S1200 microcontroller, made an up-counter (00 - 99) The TIL311 is old technology, so eats a lot of current, 1 dot is 20mA, so the number 88 the current is at it's maximum, and is 28 x 20mA = 560mA, remember the displays after a few minutes become pretty warm. I used the portB of the 8-bit AVR, this makes the software pretty simple. Between setting the data on the inputs of the TIL311, use the blanking input, this makes the counting on the displays smooth. The next part shows an example how you can make the displays count up with assembly.