We consider this one of our most important projects, mostly because it's so badly documented. In order to do this, we grabbed bits and pieces from all over the web, and mashed them together into the semblance of a project. I guess I should explain what numitron tubes actually are, since I see I haven't said anything on the subject. Numitron Tubes (as seen below) are old (~70s) vacuum incandescent 7-segment display tubes. They are beautiful little displays, all glass and messy wires, with the incandescence adding a very steampunk feel to them. Anyways.
We are going to give you all of the shortcuts, so you won't actually have to learn any coding, but if you don't you suck. Everything taken from this project can be taken and applied to something else. Wiring the tubes will be difficult, so pay attention to that section. Enough blabbing, here we go. Here's a picture and a video for inspiration. There are two main aspects to this project: code and wiring.
Very easy, but if you screw up (which you probably will), the MSP won't work and you won't be able to figure out why and your code seems right and nothing works and agghhahg. But that's just you, we were fine.
First of all, you might want the datasheet for the MSP430g2553. That is the exact model we used, so if you are using it there won't be any problems. Any others, however, you will likely have to modify the code and possible the wiring to make it work.
Each number below corresponds to a certain pin output on the MSP, as seen in the table below. For the initial part of the numitron project, we are going to drive one numitron directly from the MSP. It is possible to drive two through transistors, but that will be covered later.
<box 30% left | Pin Layout> </box>
Your numitron might have different leads, different nc (not connected) leads, and a whole slew of other differences. If that is the case, use this diagram to find out how yours should be wired.
<box 20% right | Elements> </box>
Numitron # | MSP Pin |
---|---|
0 | P1.0 |
1 | P1.1 |
2 | P1.2 |
3 | P1.3 |
4 | P1.4 |
5 | P1.5 |
6 | P1.6 |
CG | GND |
Use this table to connect pins on the MSP to the numitron.
Assuming you got the wiring correct, and you have the MSP 430g2553, this simple counting code should work.
// Copyright 2012 Matthew Hiles #include <msp430g2553.h> #define pause for (i=0; i < 100; i++) wait(10000) void wait(int ticks) { TAR=0; while(TAR < ticks) _NOP(); } void main(void) { int i = 0; WDTCTL = WDTPW + WDTHOLD; // stop watchdog TACTL = TASSEL_2 | MC_2; // setup TXD and RXD P1SEL = 0; // all ports GPIO P1DIR = 0xFF; // all is output while(1) { // display a 0 P1OUT = (BIT0 + BIT1 + BIT2 + BIT3 + BIT5 + BIT6); pause; // display 1 P1OUT = (BIT0 + BIT1); pause; // display 2 P1OUT = (BIT0 + BIT2 + BIT4 + BIT5 + BIT6); pause; // display 3 P1OUT = (BIT0 + BIT1 + BIT2 + BIT4 + BIT5); pause; // display 4 P1OUT = (BIT0 + BIT1 + BIT3 + BIT4); pause; //display 5 P1OUT = (BIT1 + BIT2 + BIT3 + BIT4 + BIT5); pause; //display 6 P1OUT = (BIT1 + BIT2 + BIT3 + BIT4 + BIT5 + BIT6); pause; //display 7 P1OUT = (BIT0 + BIT1 + BIT2); pause; //display 8 P1OUT = 0xFF; pause; //display 9 P1OUT = 0xFF - BIT6; pause; } }