Here is an up-to-date version of the clock-thermometer firmware: Thermometer4_-_LCD.c
Because of school I did not have much time to make improvements.
Showing posts with label avr. Show all posts
Showing posts with label avr. Show all posts
Sunday, May 15, 2011
New firmware for the thermometer
Labels:
avr,
clock,
code,
programming,
software,
thermometer,
update
Tuesday, February 22, 2011
Some current and finished projects...
Last month i rewrote my bool solver from scratch. This time i wrote it in pure C - without C++ elements. It has almost all functions of the old version plus some new ones, but the new program is much shorter. Documentation and comments are in german... thats why i do not upload it.
Because the old firmware (version 4) of the AtTiny clock was pretty ugly, i rewrote and changed many parts of the firmware. The new version has the number 5. The new code runs like a charm and as a bonus it eliminates the problems i had with the buttons (it was not a hardware problem).
Release will be soon. Only a calibration function for the quartz is still missing. ^.^°
And one last thing: i disassembled my old Acer travelmate 220 notbook and under the sticker of an IC i found an Atmel AtTiny25 as part of the charging circuit. It communicates directly with the laptop battery through TWI/I²C. The foto was made with my Canon EO350 / Digital Rebel XT / Kiss Digital N with an hand hold lens in retro position - the IC was so damn small:
Because the old firmware (version 4) of the AtTiny clock was pretty ugly, i rewrote and changed many parts of the firmware. The new version has the number 5. The new code runs like a charm and as a bonus it eliminates the problems i had with the buttons (it was not a hardware problem).
Release will be soon. Only a calibration function for the quartz is still missing. ^.^°
And one last thing: i disassembled my old Acer travelmate 220 notbook and under the sticker of an IC i found an Atmel AtTiny25 as part of the charging circuit. It communicates directly with the laptop battery through TWI/I²C. The foto was made with my Canon EO350 / Digital Rebel XT / Kiss Digital N with an hand hold lens in retro position - the IC was so damn small:
Labels:
acer,
attiny,
avr,
bool solver,
boolean,
c++,
camera,
canon,
clock,
firmware,
foto,
laptop,
programming,
software,
thermometer
Sunday, February 13, 2011
UART - Video
In this small video, you can see a simple counter made with my UART board. The program for counting up the LEDs is running on a PC. The µC only communicates with the PC and is responsive to his commands.
Sunday, January 2, 2011
UART toy - version 1.2
I made some modifications for the RS-232 Testboard.
Now the baud rate can be changed and the parity check can be enabled. Tons of other modifications, a new exciting sample program and lots of bug fixes were made too.
You can download the whole package (AVR source code, PC source code + libraries, drawing and the command list) here:
project.zip
Now the baud rate can be changed and the parity check can be enabled. Tons of other modifications, a new exciting sample program and lots of bug fixes were made too.
You can download the whole package (AVR source code, PC source code + libraries, drawing and the command list) here:
project.zip
Tuesday, December 28, 2010
UART toy - additional comments...
I forgot to mention, that the Linux program must be executed as root. Otherwise it will not work, because it needs low level access to the serial port.
And the program must be compiled with optimization turned on.
The correct preprocessor command for GCC under Linux is "__linux__" - with two underscores and in small letters.
All commands in the instruction set are stated as ASCII characters. The return values and the parameters are in hex.
If someone got the circuit to work with Windows XP, please inform me. ;)
And the program must be compiled with optimization turned on.
The correct preprocessor command for GCC under Linux is "__linux__" - with two underscores and in small letters.
All commands in the instruction set are stated as ASCII characters. The return values and the parameters are in hex.
If someone got the circuit to work with Windows XP, please inform me. ;)
Labels:
atmega,
avr,
gcc,
linux,
microcontroller,
programming,
rs232,
testboard,
uart,
windows
Monday, December 27, 2010
UART toy - part 4
And here is a list with the instruction set plus a short list of error codes for the AVR part:
http://sites.google.com/site/species0x2118/commands.pdf?attredirects=0&d=1
Enjoy. ^.^
http://sites.google.com/site/species0x2118/commands.pdf?attredirects=0&d=1
Enjoy. ^.^
UART toy - part 3
And another part (not the last one) of my UART series.
Here is a piece of code for the PC to establish a connection to the RS232 testboard and to communicate with it..
http://sites.google.com/site/species0x2118/testboard.zip
It is just an example how to interface with the board and not a complete library. The example application sets the outputs, reads in the inputs, reads the analog input and calculates the voltage on that pin. Everything with hardware handshake.
But you need the right cable for the handshake. Otherwise change the "true" in the uartSend commands to "false" and delete the handshake activation.
The software is tested under DOS with TurboC and under Ubuntu Linux with GCC. The source compiles with Open Watcom too - but the Watcom binary is not tested under DOS yet.
I changed the compiler preprocessor macros for the recognition of operating systems and compilers several times - but did not test every combination with every operatin system and every compiler. Perhaps you need to figure out the correct setup for your system (or just delete the stuff you do not need).
It took me several hours to figure out, that linux needs an activated FIFO control register. Otherwise the data transmission will fail in 99% of the cases.
Here is a piece of code for the PC to establish a connection to the RS232 testboard and to communicate with it..
http://sites.google.com/site/species0x2118/testboard.zip
It is just an example how to interface with the board and not a complete library. The example application sets the outputs, reads in the inputs, reads the analog input and calculates the voltage on that pin. Everything with hardware handshake.
But you need the right cable for the handshake. Otherwise change the "true" in the uartSend commands to "false" and delete the handshake activation.
The software is tested under DOS with TurboC and under Ubuntu Linux with GCC. The source compiles with Open Watcom too - but the Watcom binary is not tested under DOS yet.
I changed the compiler preprocessor macros for the recognition of operating systems and compilers several times - but did not test every combination with every operatin system and every compiler. Perhaps you need to figure out the correct setup for your system (or just delete the stuff you do not need).
It took me several hours to figure out, that linux needs an activated FIFO control register. Otherwise the data transmission will fail in 99% of the cases.
Sunday, December 26, 2010
UART toy - part 2
Here is the code for the AVR as well as some pictures.
The C code: RS232_Testboard.zip
The code is public domain.
I am using Peter Fleury's AVR UART library for this project.
The first picture shows a test application, written on an 80286 with Borland TurboC that communicates with the RS232 testboard:
The second picture shows the circuit itself:
The C code: RS232_Testboard.zip
The code is public domain.
I am using Peter Fleury's AVR UART library for this project.
The first picture shows a test application, written on an 80286 with Borland TurboC that communicates with the RS232 testboard:
The second picture shows the circuit itself:
New self made toy for UART programming
I have had very few time over the last weeks, so all hobby projects were paused in this time.
But now i have some spare time again - thx to Xmas and holidays!
The current theme in the technical engineering school i visit is "UART register programming". Sounds great, right? Just good enough for an nerd like me.
Sadly we only "program" the UART on paper... sounds sick - right? I was very unsatisfied with this fact and so i designed a small circuit arround an AVR. Now i am able to test the UART programming on the PC side. I learned much by this project.
The features of the board:
First the circuit diagram:
But now i have some spare time again - thx to Xmas and holidays!
The current theme in the technical engineering school i visit is "UART register programming". Sounds great, right? Just good enough for an nerd like me.
Sadly we only "program" the UART on paper... sounds sick - right? I was very unsatisfied with this fact and so i designed a small circuit arround an AVR. Now i am able to test the UART programming on the PC side. I learned much by this project.
The features of the board:
- Serial communication using RS232, 9600 baud, 8 data bits, no parity, 1 stop bit.
- 5 digital outputs (connected to LEDs)
- 6 digital inputs
- 1 analog input (8 bit ADC, Umax = 2,56 V)
- 10 build in commands
- hardware handshake can be activated
- 4 free ports on the AVR
First the circuit diagram:
Tuesday, July 13, 2010
Latest work...
... currently i am working on a capacitive pipe brake or water detector.
We had too many pipe breaks in the cellar.
Ok - in fact it is almost finished, i only lost a bit of my passion.
The circuit needs very few power (7µA @5V) and has a low part count. It could run several years with two AA batteries.
After endless frustrating hours coding an debugging with WinAVR and AVR Studio in the past, i gave mikroPascal a try in this project. And so far it works great.
We had too many pipe breaks in the cellar.
Ok - in fact it is almost finished, i only lost a bit of my passion.
The circuit needs very few power (7µA @5V) and has a low part count. It could run several years with two AA batteries.
After endless frustrating hours coding an debugging with WinAVR and AVR Studio in the past, i gave mikroPascal a try in this project. And so far it works great.
Gameport to PS/2 converter - the build
Some weeks ago i soldered my gameport 2 PS/2 converter on a breadboard.
Oh yeah - i am beginning to hate breadboards...
It took more time than thought, but i finished it and the circuit worked. At least with my trusty old 80286 computer. With my new one it did not - the circuit was blocking my keyboard as soon as i pressed a button on the gamepad. So it is only a 50% success.
Works on my old computer, but not on my new one.
With an logic analyzer it would be a piece of cake to make it work...
I modified the plan a bit. You should keep in mind that the connection to the connector pins on the male and the female ps/2 connector must to be mirrored.
For the female ps/2 connector i cannibalised an old industry pc motherboard.
For the male part i stripped away the cable from an old keyboard. It is good to have a lot of trash at home. ; )
The gameport connector was bought.
Monday, April 5, 2010
Some new stuff
Today i have a bunch of new stuff. First of all: i made a six channel logic analyzer. The hardware was designed in about five minutes. The software in perhaps six minutes...
Here is the code:
Unfortunatly i have no software for the data analysis. I saved the data with HTERM as text file so far.

And it worked. With my old self made power supply it was a joy to play with the truck. ; )
And finally if finished the case for my thermometer. I found some transparent plasic in the cellar. Now only a calibration function for the clock is left.
Here is the code:
#includeYou need the UART library from Peter Fleury (http://jump.to/fleury).<avr/io.h>
#include<avr/interrupt.h>
#include "uart.h"
#ifndef F_CPU
#define F_CPU 11059200
#endif
#define UART_BAUD_RATE 115200
int main(void)
{
uart_init( UART_BAUD_SELECT(UART_BAUD_RATE,F_CPU) );
sei();
uart_puts("Starting low cost logic analyzer.\n");
while (1)
{
uart_putc( PINB + '0' );
uart_putc( '\r' );
}
}
Unfortunatly i have no software for the data analysis. I saved the data with HTERM as text file so far.
Next project was the modification of my good old LEGO Technic truck.
He needs a huge amount of AA batteries - more than i had. But i wanted to make it work

And it worked. With my old self made power supply it was a joy to play with the truck. ; )
And finally if finished the case for my thermometer. I found some transparent plasic in the cellar. Now only a calibration function for the clock is left.Tuesday, February 23, 2010
Clock - some hints and thoughts
I have reprogrammed the clock-thermometer the first time after soldering it to the breadboard.
In the circuit diagram you can throw away jmp3 and jmp4 and replace them with a common jumper on the mass of D2 and R7.
Because my wall power supply not only outputs 9 V DC but also ~13 V AC, i decided to power the circuit with rechargeable batteries (4*1,2 V).
I thought it could help to change the following line:
Where ADC_BITS is defined as 10 and VREF as 1100 (mV).
Indeed the code size shrinked from 3132 bytes to 3060 bytes, but the temperature was calculated wrong. The thermometer displayed a negative temperature, although my room was warm.
When i changed the code to:
The filesize was 3132 bytes again.
As you can see: the AVR GCC port isn't as stupid as you (or me) think. ;)
Happy soldering!
In the circuit diagram you can throw away jmp3 and jmp4 and replace them with a common jumper on the mass of D2 and R7.
Because my wall power supply not only outputs 9 V DC but also ~13 V AC, i decided to power the circuit with rechargeable batteries (4*1,2 V).
I thought it could help to change the following line:
degree = (degree * VREF) >> ADC_BITS;to:
degree = ((degree * 1024) + (degree * 64) + (degree * 8) + (degree * 4)) >> ADC_BITS;
Where ADC_BITS is defined as 10 and VREF as 1100 (mV).
Indeed the code size shrinked from 3132 bytes to 3060 bytes, but the temperature was calculated wrong. The thermometer displayed a negative temperature, although my room was warm.
When i changed the code to:
degree = ((degree * 1024L) + (degree * 64L) + (degree * 8L) + (degree * 4L)) >> ADC_BITS;
The filesize was 3132 bytes again.
As you can see: the AVR GCC port isn't as stupid as you (or me) think. ;)
Happy soldering!
Subscribe to:
Posts (Atom)







