go_away

Author Topic: Microcontroller programming  (Read 2646 times)

0 Members and 1 Guest are viewing this topic.

Offline misgTopic starter

  • Jr. Member
  • **
  • Posts: 7
  • Helpful? 0
Microcontroller programming
« 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

Offline Tomomastchi-project

  • Jr. Member
  • **
  • Posts: 20
  • Helpful? 0
Re: Microcontroller programming
« Reply #1 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.

Offline misgTopic starter

  • Jr. Member
  • **
  • Posts: 7
  • Helpful? 0
Re: Microcontroller programming
« Reply #2 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.

Offline dunk

  • Expert Roboticist
  • Supreme Robot
  • *****
  • Posts: 1,086
  • Helpful? 21
Re: Microcontroller programming
« Reply #3 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/
it should tell you everything you need.

good luck!

dunk.

Offline Ro-Bot-X

  • Contest Winner
  • Supreme Robot
  • ****
  • Posts: 1,431
  • Helpful? 25
  • Store: RoBotXDesigns.ca
Re: Microcontroller programming
« Reply #4 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

He has schematics, code samples in both Bascom and GCC and a bootloader for the ATmega16.
Check out the uBotino robot controller!

Offline Pratheek

  • Contest Winner
  • Robot Overlord
  • ****
  • Posts: 125
  • Helpful? 3
Re: Microcontroller programming
« Reply #5 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.

Offline misgTopic starter

  • Jr. Member
  • **
  • Posts: 7
  • Helpful? 0
Re: Microcontroller programming
« Reply #6 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?

Offline Trumpkin

  • Supreme Robot
  • *****
  • Posts: 1,177
  • Helpful? 5
Re: Microcontroller programming
« Reply #7 on: October 04, 2008, 02:29:02 PM »
you need the resistors.....
Robots are awesome!

Offline misgTopic starter

  • Jr. Member
  • **
  • Posts: 7
  • Helpful? 0
Re: Microcontroller programming
« Reply #8 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?

Offline izua

  • Supreme Robot
  • *****
  • Posts: 682
  • Helpful? 0
Re: Microcontroller programming
« Reply #9 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.
Check out my homepage for in depth tutorials on microcontrollers and electronics.

Offline sotu

  • Supreme Robot
  • *****
  • Posts: 350
  • Helpful? 0
  • ´BB - Eye Biped Bot
Re: Microcontroller programming
« Reply #10 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.
How to build a biped bot:

Offline Admin

  • Administrator
  • Supreme Robot
  • *****
  • Posts: 11,658
  • Helpful? 169
    • Society of Robots
Re: Microcontroller programming
« Reply #11 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.

Offline karlis

  • Full Member
  • ***
  • Posts: 79
  • Helpful? 0
Re: Microcontroller programming
« Reply #12 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 :)

 


Get Your Ad Here

data_list