Society of Robots - Robot Forum
Electronics => Electronics => Topic started by: misg on September 27, 2008, 02:02:05 AM
-
Hi,
I am new to robotics and all this microcontroller stuff is a huge mess.
At the moment all I am trying to do is to control a servo which seems like a superhuman effort.
I have a atmega16 microcontroller, parallel port in a linux PC, parallel port cable, continuosly rotating servo and basic electronics goods and skills. I do not have a programming board and around here they are unavailable. So I have a few questions:
1. Do I have the necessary equipment to program a microcontroller?
2. I don't know how to program a bootloader. Where can I download bootloader for this controller or are they all basically the same?
3. If I manage to get the bootloader uploaded how do I program it then?
BR,
m
-
May I ask you why you have a atmega16? Maybe it's better to mailorder a beginners-kit like basic stamp. Or OOPic. If you want the real deal you should go for a PIC or AVR, for which you can easily build a programmer and download a bootloader.
-
May I ask you why you have a atmega16? Maybe it's better to mailorder a beginners-kit like basic stamp.
There are places in this planet where the conventional mail does not come. The microcontroller was a spare part and now it is the only controller I have got.
-
hi Misg,
ignore bootloaders for now.
you do not need one to get started and they considerably complicate things if you are starting with a blank AVR.
although this link does not mention the ATmega16 the principal is exactly the same:
http://www.instructables.com/id/Ghetto-Programming%3a-Getting-started-with-AVR-micro/ (http://www.instructables.com/id/Ghetto-Programming%3a-Getting-started-with-AVR-micro/)
it should tell you everything you need.
good luck!
dunk.
-
Lary Barello has built a board using ATmega16, check it out here:
http://www.barello.net/ARC/index.htm (http://www.barello.net/ARC/index.htm)
He has schematics, code samples in both Bascom and GCC and a bootloader for the ATmega16.
-
1. Do I have the necessary equipment to program a microcontroller?
You already have all the components to program your microcontroller.
You just need a programmer, which you can build from a few resistors. And since you already have a parallel port cable it should not be expensive. For the schematic just google for "parallel port programmer for AVR" .
And as dunk said you will not need bootloaders.
-
1. Do I have the necessary equipment to program a microcontroller?
You already have all the components to program your microcontroller.
You just need a programmer, which you can build from a few resistors. And since you already have a parallel port cable it should not be expensive. For the schematic just google for "parallel port programmer for AVR" .
And as dunk said you will not need bootloaders.
Incredible. PC recognizes the chip. I skipped the resistors but I guess that won't be a problem with Voltages < 5V. However I still don't quite see how to control the servo. Alll I could find in the servos datasheet was that it needs 1.5 ms pulses with 20 ms delays. How do I know what Voltage it needs or is it based on some standard? Secondly being a continuously rotation servo I can see how it would rotate continuosly forward with the pulses but can I set some position for the servo?
-
you need the resistors.....
-
you need the resistors.....
I thought their only purpose was to protect the parallel port which should not be an issue if the supply voltage < 5V or am I incorrect?
-
no, even at low voltages you can damage the port. it's not the voltage that damages, it's the current (think static electricity)
and don't listen to all the naysayers. atmega16 is a great chip.
-
And also, the supply power won't stay at 5 Volt at all times. A capacitor is a good way to keep the voltage supply at the same level, so you won't harm any "weak" links (components) at your board. A resistor can also be used to remove some of the electrical noise from your AVR board.
-
Adding the resistor will help protect your circuitry from dumb mistakes, too.
Alll I could find in the servos datasheet was that it needs 1.5 ms pulses with 20 ms delays. How do I know what Voltage it needs or is it based on some standard?
The servo signal is binary, 0 (0V) and 1 (5V). It's much easier than it sounds actually. Look at my $50 Robot code and you'll see how I do servos.
-
i dont know if and how does paralel port work on linux but i sure know that this avr isp works fine
http://cgi.ebay.com/Serial-Atmel-ISP-programmer-works-with-AVR-Studio-4_W0QQitemZ120308735472QQcmdZViewItem?hash=item120308735472&_trkparms=72%3A1205|39%3A1|66%3A2|65%3A12|240%3A1318&_trksid=p3286.c0.m14
i bought ir from some bulgarian, soldered shematic and i`m happy that i invested some money to it and didnt waste too much around :)