Making a 7 segment display driver out of an MSP430

It's sunday afternoon, snowing, and I want a simple project to kill time with. It will be documented here.

These drivers are nothing new, and preprogramed chips like this exist. However, I don't have any of them. I do have lots of MSP430s, though! This code can be useful for driving 7segment displays and numitrons alike.

So, to get started, here's a table showing what pins are used to activate what. These drivers typically use four bits of input (1, 2, 4, 8, and all off) for a maximum of 16 values. This allows for the characters 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, and F. Basically, everything needed for hex. Convenient, right?

I'll be using an MSP430g2553, with pins P2.0-3 as my inputs and P1.0-6 as my outputs. A-G here represent both pins P1.0-6 and the corresponding segments of the display.

Character BIT2.0 (1) BIT2.1 (2) BIT2.2 (4) BIT2.3 (8) a b c d e f g
0 H H H H on on on on on on off
1 L H H H off on on off off off off
2 H L H H on on off on on off on
3 L L H H on on on on off off on
4 HHLHoffononoffoffonon
5LHLHonoffononoffonon
6HLLHoffoffononononon
7LLLHonononoffoffoffoff
8HHHLononononononon
9LHHLonononoffoffonon
AHLLH
BHLHH
CHHLL
DLHLL
E
F
msp7seg.txt · Last modified: 2024/11/14 02:30 by 127.0.0.1
Driven by DokuWiki Recent changes RSS feed Valid CSS Valid XHTML 1.0