Society of Robots - Robot Forum

Electronics => Electronics => Topic started by: misg on September 27, 2008, 02:02:05 AM

Title: Microcontroller programming
Post 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
Title: Re: Microcontroller programming
Post by: Tomomastchi-project on September 27, 2008, 02:43:15 AM
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.
Title: Re: Microcontroller programming
Post by: misg on September 27, 2008, 03:38:03 AM
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.
Title: Re: Microcontroller programming
Post by: dunk on September 27, 2008, 04:05:41 AM
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.
Title: Re: Microcontroller programming
Post by: Ro-Bot-X on September 27, 2008, 06:34:32 AM
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.
Title: Re: Microcontroller programming
Post by: Pratheek on September 30, 2008, 05:49:46 AM
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.
Title: Re: Microcontroller programming
Post by: misg on October 04, 2008, 02:22:57 PM
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?
Title: Re: Microcontroller programming
Post by: Trumpkin on October 04, 2008, 02:29:02 PM
you need the resistors.....
Title: Re: Microcontroller programming
Post by: misg on October 05, 2008, 12:44:10 AM
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?
Title: Re: Microcontroller programming
Post by: izua on October 05, 2008, 01:12:43 AM
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.
Title: Re: Microcontroller programming
Post by: sotu on October 05, 2008, 02:52:48 PM
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.
Title: Re: Microcontroller programming
Post by: Admin on October 08, 2008, 11:41:28 PM
Adding the resistor will help protect your circuitry from dumb mistakes, too.

Quote
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.
Title: Re: Microcontroller programming
Post by: karlis on October 09, 2008, 12:26:43 PM
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 :)