GBAmp3 Mod PCB Order Now
also available at retromodding.comand Deadpan Robot

Wednesday, January 12, 2011

TI LaunchPad project code name Duothermo

I selected some parts for this project. MCU is MSP430G2231 which have internal temperature sensor (MSP430G2211 does not have ADC). DS18B20 1-wire digital temperature sensor as secondary sensor. 74HC595 8-bit shift register to show digits on 7-segment leds with multiplexing. I desided to use 3 7-segment leds with decimal point. Actually I don't have 7-segment but I do have 14-segment leds, I'll just use them as 7-segment leds. 3 transistors to power and multiplex leds.

So I have to use 4 pins for shift register, 3 pins for led multiplexing, 1 for decimal point (but it can be instant on), 1 for negative temperature minus (this is would be a dot actually). 1 pin for 1-wire interface for DS18B20 sensor. So 9 pins at all. Full port 1 and 1 pin from port 2, so no external crystal. 1 spare pin, 2kb of flash.

I already wrote a driver for 74HC595 shift register and a function to read internal temperature in celcius, but without calibration. Temperature read is not that steady as I thought. It jumps a lot hi and low (from +39 to +28 just with one read) if ADC clock is set to ADC10OSC, but if clock selected as MCLK temperature read is pretty steady.

Here is a temperature read function:



It reads ADC10 value then converts it to 3 digit celcius value with decimal point. Temperature struct is for this 3 digit format.

Main problem now is to write 1-wire interface driver for DS18B20 sensor. My code already eat almost 1kb and I need 1-wire driver, segment multiplexing driver, temperature conversion for DS18B20. Another problem is that 1-wire interface needs correct timing and it's not as easy as 74HC595 spi interface. If I going to fail with Duo part of the project, I'll fallback to single termometer and maybe without DS18B20.

Full code is available as always: code.avrnoob.com

2 comments:

  1. Hi

    do you a schematic for this project

    Thanks

    ReplyDelete
    Replies
    1. Not really and this project is freezed. I'm working on another similar project using DS18B20 sensors and hopefully finish it soon and post some details.

      Delete