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.
Showing posts with label atmel. Show all posts
Showing posts with label atmel. Show all posts
Sunday, February 13, 2011
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.
Saturday, April 24, 2010
Thermometer version 5
I added backlight functionality to my thermometer.
A menu system was added too (as well as an annoying bug...).
I noticed that the button response is getting worse with time and the number of button clicks. Perhaps they are just to cheap? It is not a software fault.
The possibility to calibrate the clock for higher accuracy is still missing.
A menu system was added too (as well as an annoying bug...).
I noticed that the button response is getting worse with time and the number of button clicks. Perhaps they are just to cheap? It is not a software fault.
The possibility to calibrate the clock for higher accuracy is still missing.
Gameport to PS/2 converter
With this little circuit it is possible to emulate a ps/2 keyboard with your gamepad.
I designed the circuit for a game that could not be played with that gamepad. But it worked well with a keyboard - so this evil mad idea was born. ;)
I used my old repaired gravis gamepad (repair report) for that project. Other gamepads could be wired internal in a different way.
The circuit is designed for digital gamepads only - no analog sticks or joysticks are supported (yet)!
But such a functionality could be implemented too. Because i used an old ATMEGA8, there are a lot of free pins for further experiments and hacks.
The buttons are "hard wired" in the code to keys. I used the ALT, SPACE, ENTER and CNTRL keys for the buttons. A function to define new key bindings without hacking them into the code and reporogram the controller could be implemented - but i was to lazy to write it. ^.^
Another impressive project that shows how easy and yet powerfull a µC circuit can be.
THX to the KISS guidelines.
The circuit in the red box does all the magic.
Feel free to use or improve this circuit.
The code can be found here:
http://sites.google.com/site/species0x2118/hive
http://sites.google.com/site/species0x2118/hive/gamepad.c?attredirects=0&d=1 (direct link)
I changed the fuses to run the controller with 8 MHz to have enough speed reserves. But a lower frequency could work as well.
As a goody i made a video of the gameplay with the gamepad connected to the converter:
Thursday, February 25, 2010
Additional adaptors for the ISP

Because i'm lazy dog, i made some adapters for my self made ISP to save the in-circuit programming connector. This would save some wires, parts, space on the board and a lot of time.
Now - with those adapters - i only need to connect the right adapter to the ISP and mount the adapter onto the µC.
Programming the µC is done as usually.
The only drawback is, when the adapter is mounted on top of an µC, it is not very stable. So better don't touch the whole thing while flashing the controller.
I made one adapter for the Atmega8 (in the background) and one for the Attiny84 (in the foreground).
The big one for the Atmega8 looks a bit strange, because i had to add another DIL socket to the existing one who had to unflexible pins.
My collection of DIL sockets is very limited.
It is better to use the cheap low quality DIL sockets, because their pins can bend well.
The more expensive ones have rigid pins, so they can not be bend over the µC pins.
Since i made the adapters, i have never soldered an ISP connector into an circuit again.
And because i don't want to take the credits for this invention: i have seen such an adapter in the internet, before i made mine. Thanks to you stranger for this fabulous handiwork! ^.^
Atmel ISP
Today i want to show you my ISP adapter for Atmega and Attiny µControllers from Atmel.
I found a circuit diagram in the internet, but unfortunately it was using an 74HC244 but i had only 74HC245 laying around.
That's why i redesigned the programmer a bit, to make it work with the slightly different 245.
The adapter is compatible with PonyProg2000 and AVRDude.
Now some pictures and the final circuit diagram:




PonyProg2000: http://www.lancos.com/prog.html
AVRDude: http://www.nongnu.org/avrdude/
A GUI for AVRDude: http://avr8-burn-o-mat.aaabbb.de (german)
I found a circuit diagram in the internet, but unfortunately it was using an 74HC244 but i had only 74HC245 laying around.
That's why i redesigned the programmer a bit, to make it work with the slightly different 245.
The adapter is compatible with PonyProg2000 and AVRDude.
Now some pictures and the final circuit diagram:



PonyProg2000: http://www.lancos.com/prog.html
AVRDude: http://www.nongnu.org/avrdude/
A GUI for AVRDude: http://avr8-burn-o-mat.aaabbb.de (german)
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!
Monday, February 22, 2010
Clock-Thermometer with Attiny and LM35
Today i want to present you my last project i've made.
It's a more modern version of my first big µC project: a thermometer. (yeah!)
I finished it last sunday - at least the most parts of the project.
My first version i made months ago, was equiped with an Atmega8, four multiplexed 7 segment displays, "software" based USB and a batterie backup if no USB connection was in the near.
So far so good.
The negative points were:
It consumed a lot of power, it used tons of parts, it had some bugs i never killed and it only displayed the actual temperature.
I paused the project for a while.
By the time my µC skills increased and so on one day i decided to make a better version.
The requirements:
That was the hour of birth for the thermometer version 4a:

The whole circuit is build around an Attiny84V and an LM35C.
The output is done on an LC Display from Displaytech.
1x16 Chars - or more precise: 2x8 Chars in one line.
Sadly without backlight.
After making some plans for the hard- and software parts i build up the circuit on an pinboard and then i made the software.
(Usually i never make plans for the software part.)
Last step was soldering the stuff onto a bredboard as you can see in the pictures below.
Because i made a lot of plans and "brain work" in the forefront, it was a very easy and straight forward implementation. No bigger problem appeared till now.
The circuit is using a wall power supply.
It is specified with 6 V DC, 300 mA and it is from an old wirless mouse charging station.
In idle time it delivers around 9 V and because the whole circuit consumes under 15 mA it will work in idle even when the circuit is connected. ^.^
As special feature i implemented a clock (wohoo!).
With three switches on the back you can set the hour, minute and the display mode.
Display mode means the appearance of the time and temperature on the LCD:
But because it is getting warmer here outside i need some fridge to test the posibility of displaying negative values.
The build in clock is synced by an 16 MHz Quartz (CHKDIV8 is on - resulting in a clock speed of 2 MHz!).
The clock is not calibrated yet - but on the pinboard it was exact enough. Further testing with the breadboard circuit is needed.
The hardware version i soldered is a bit older than the plan.
As well as the software version.
The software is written in C with AVRStudio and WinAVR.
The main program consists of under 300 lines of code.
It uses 3132 bytes in the flash for code.
So there is plenty of room in the 8 kb flash for further extensions.
For the LCD i used the routines from Mikrocontroller.net.
(A big thanks to this side! It is just a paradise for µC users... at least when you can read german)
As soon as i figured out how to post software here i will upload it. ;)



It's a more modern version of my first big µC project: a thermometer. (yeah!)
I finished it last sunday - at least the most parts of the project.
My first version i made months ago, was equiped with an Atmega8, four multiplexed 7 segment displays, "software" based USB and a batterie backup if no USB connection was in the near.
So far so good.
The negative points were:
It consumed a lot of power, it used tons of parts, it had some bugs i never killed and it only displayed the actual temperature.
I paused the project for a while.
By the time my µC skills increased and so on one day i decided to make a better version.
The requirements:
- no batterie
- no usb
- no 7 segment display
- should display something more than just temperature...
- lesser parts
- KISS!
That was the hour of birth for the thermometer version 4a:
The whole circuit is build around an Attiny84V and an LM35C.
The output is done on an LC Display from Displaytech.
1x16 Chars - or more precise: 2x8 Chars in one line.
Sadly without backlight.
After making some plans for the hard- and software parts i build up the circuit on an pinboard and then i made the software.
(Usually i never make plans for the software part.)
Last step was soldering the stuff onto a bredboard as you can see in the pictures below.
Because i made a lot of plans and "brain work" in the forefront, it was a very easy and straight forward implementation. No bigger problem appeared till now.
The circuit is using a wall power supply.
It is specified with 6 V DC, 300 mA and it is from an old wirless mouse charging station.
In idle time it delivers around 9 V and because the whole circuit consumes under 15 mA it will work in idle even when the circuit is connected. ^.^
As special feature i implemented a clock (wohoo!).
With three switches on the back you can set the hour, minute and the display mode.
Display mode means the appearance of the time and temperature on the LCD:
- Mode 1: HH:MM:SS +/-TT,T°C
- Mode 2: HH:MM +/-TT,T°C
- Mode 3: HH:MM +/-TT°C
But because it is getting warmer here outside i need some fridge to test the posibility of displaying negative values.
The build in clock is synced by an 16 MHz Quartz (CHKDIV8 is on - resulting in a clock speed of 2 MHz!).
The clock is not calibrated yet - but on the pinboard it was exact enough. Further testing with the breadboard circuit is needed.
The hardware version i soldered is a bit older than the plan.
As well as the software version.
The software is written in C with AVRStudio and WinAVR.
The main program consists of under 300 lines of code.
It uses 3132 bytes in the flash for code.
So there is plenty of room in the 8 kb flash for further extensions.
For the LCD i used the routines from Mikrocontroller.net.
(A big thanks to this side! It is just a paradise for µC users... at least when you can read german)
As soon as i figured out how to post software here i will upload it. ;)



Subscribe to:
Posts (Atom)
