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
Hi
ReplyDeletedo you a schematic for this project
Thanks
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