Skip to main content
Topic: Universal Digital Timer based on MSP430 (Read 3954 times) previous topic - next topic

Universal Digital Timer based on MSP430

I have an oven and a deep fryer at home. Both has the same type of digital timer in it. The timer has a two digit 7 segment display and two buttons with one drawback. It only beep when the time elapsed but unable to switch of the device.
I realized that I need a timer like this for various purposes with switching capability.
Here are the planed usage:

    -  Control the deep fryer above
    -    Small, desktop timer (it may requires LCD instead of LED display because of the battery operation)
    -    Control my (planed) UV lightbox what will used for PCB solder mask developing
    -    Soldering station watchdog (I always fear if once I will leave my soldering station switched on unattended. Therefore I'd like to have a watchdog what starts when I put the soldering iron back to the holder and switch of the entire station after five minutes)
The project will be based on an MSP430 value line MCU. Here are the design principles what I will follow:

    -    The connections of the MCU should fit in max 20 pins. This gives me the versatility to build the circuit with trough hole or SMD components.
    -    Use as few external components as possible. To be honest I don't like to use any external active components except the two transistors driving the display digits.
    -    Have an SMD design what fits under the display except the switches and breadboard compatitble.
    -    Have external user programing capability through computer interface (most probably UART)

The first two of the principles above also give me a challenge. Lets take the pin count and the desired functions:

    -    The use of the MCU itself: take 4 pins (VCC, GND, RST, TEST) these pins are needed all time
    -    Two digit 7-Segment display: 10 pins (7 Segment pin, 1 decimal point, 2 digit multiplex pin)
    -    External clock crystal: 2 pins
    -    PC communication: 2 pins (UART: TXD, RXD)
    -    Push buttons: 2 pins
    -    External trigger: 1 pin
    -    Switch the load: 1 pin
    -    Piezo Buzzer (beep at the end of time): 1 pin

Lets count: it makes total 4+10+2+2+2+1+1+1 = 23 pins Ooops!!!
So I've the following choices:

    -    Use some kind of GPIO expander (some I2C, SPI based or a simple shift register like 74HC595)
    -    Use a 7 Segment deccoder
    -    Use the pins smarter

Take the last one:

    -    We can't do anything with the MCU own pins. Period. 4 pin left
    -    Use the second digit driving transistor as an inverter (driven from the collector of the first transistor). -1 pin. Concept proved. 9 pins left
    -    Use internal DCO instead of the crystal. I don't like this concept, so the pins stay. 2 pins left
    -    PC communication. Unfortunately no tricks possible here. 2 pins left
    -    Push buttons. Multiplex the push buttons from the digit driver transistors and sense them with a single pin. Concept proved. 1 pin left.
    -    External trigger. No tricks here. 1 pin left.
    -    Switch the load. No tricks here. 1 pin left.
    -    Piezo Buzzer: I need only one of the decimal point of the display. What if I connect the buzzer instead of the second DP. Concept. If I can prove it: 0 pin left.

Lets count once more: 4+9+2+2+1+1+1+0  = 20 pin Done!!!

Things are done already:

    -    Schematics (the work of the buzzer must be proved, the final will be posted)
    -    Working circuit on breadboard
    -    Display multiplex code
    -    Debounced button driver
    -    The countdown timer (with button setup)

Things what ahead (not necessary in this order):

    -    Buzzer code (prove the concept above)
    -    Homebrew PCB
    -    Writing to the flash in runtime (required to store data came from the PC interface)
    -    Serial communication
    -    Character based Menu driven UI (inside the MCU)
    -    Serial Binary command set (for the desktop UI)
    -    Extending the timer code for the programmable functionality (like the watchdog)
    -    Desktop UI (most probably in C#)
    -    SMD design/PCB ordering

This is the my new project. Any comments suggestions feature requests are wellcome.

Re: Universal Digital Timer based on MSP430

Reply #1
Nice useful project!

I have a question: I am a PIC guy, and to program/debug a PIC you have "the ICSP" (pickit,etc), which uses 2 pins + power, reset, gnd.

How do you do that usually with MSP430s? I know there are more than one method:

-Sort of SWD with 2 wires
-bootstrap loader

what do you usually use, with what tools?

squalyl/seb from openmakersdaily

Re: Universal Digital Timer based on MSP430

Reply #2

With MSP430 I'm using the cheap development board called launchpad. It has TI's two wire protocol called Spy-By-Wire.
The connection looks like this:

LanuchPad        MSP430 InCircuit
VCC      ---        VCC
Test      ---      Test
RST      ---        RST (Connceted with 47k to VCC and 1nF to ground)
GND      ---      GND

Actually I built something like a "Booster Pack" for the Launchpad that has three block of connectors:
Power (VCC, GND)
Program (RST, Test, GND)

It was designed to fit into a DP7070 Sick of Beige enclosure together with the Lanunchpad (the MCU and the jumpers between the launchpad's programer/emulator side and the MCU side removed). This is the device what I use the program and debug my MSP430 projects (you can see this device on the right hand side of the photograph in the original post).
The toolchain what I'm actually using is Texas Instrument's Code Composer Studio v5.4 Free Edition installed on top of an existing Eclipse installation (I'm not using the standalone CCS because I've plans for various ARM Cortex-M0 based projects and I'd like to keep the development environment within a single eclipse installation)


Re: Universal Digital Timer based on MSP430

Reply #3

I know the launchpad, I understand how you are using that as a programming tool, thanks :)
squalyl/seb from openmakersdaily