go_away

Author Topic: Question about the Atmega8 microcontroller  (Read 2783 times)

0 Members and 1 Guest are viewing this topic.

Offline gamefreakTopic starter

  • Supreme Robot
  • *****
  • Posts: 543
  • Helpful? 2
  • Robo-Enthusiast
Question about the Atmega8 microcontroller
« on: January 09, 2008, 09:58:11 PM »
While looking through the datasheets for the microcontroller I discovered the PB0-7 is the same as PD0-7, so then that leads me to believe that the microcontroller could run 16 servos(if there was enough current). But it also says that port B and port D are 8 bit inputs, while port C is a 7 bit input, is there a reason in choosing the 7 bit for the sensors and the 8 bit, which I beleive means it has higher accuracy, for motors. Also at what point do the inputs turn into pulsed outputs?(I am referring to in the 50$ robot example)

And this one is a little random, but what ever happened to port A?
All hail Rodney, the holy 555 timer
And Steve said: "Let there be lead!"

Offline Admin

  • Administrator
  • Supreme Robot
  • *****
  • Posts: 11,660
  • Helpful? 169
    • Society of Robots
Re: Question about the Atmega8 microcontroller
« Reply #1 on: January 10, 2008, 06:02:27 AM »
Without looking into the detailed pin descriptions, I'm fairly sure you can have up to 20 servos with it.

I actually added another row of headers for the bottom left of my $50 robot to handle more. I didn't use all the pins in the original tutorial, but its definitely possible.

Offline Admin

  • Administrator
  • Supreme Robot
  • *****
  • Posts: 11,660
  • Helpful? 169
    • Society of Robots
Re: Question about the Atmega8 microcontroller
« Reply #2 on: January 10, 2008, 06:09:37 AM »
forgot to answer the other questions . . .

Quote
Also at what point do the inputs turn into pulsed outputs?(
This is a setting you must do in software. Look in the SoR_Utils file for configure_ports()

Quote
it also says that port B and port D are 8 bit inputs, while port C is a 7 bit input, is there a reason in choosing the 7 bit for the sensors and the 8 bit
you want to only use the analog ports (portC for ATmega8) for the sensors (unless your sensor is digital, in which case you only need 1 bit)

Quote
And this one is a little random, but what ever happened to port A?
checked the datasheet? :P

Offline gamefreakTopic starter

  • Supreme Robot
  • *****
  • Posts: 543
  • Helpful? 2
  • Robo-Enthusiast
Re: Question about the Atmega8 microcontroller
« Reply #3 on: January 10, 2008, 06:29:12 AM »
the amazing shhet with very little answears, and a lot of questions....

So where does it say port C is not analog, is it just inferred since there are 7 bits?

I find it funny how many things skip things and it doesnt seem to make sense, apparently Atmega doesnt like A.
All hail Rodney, the holy 555 timer
And Steve said: "Let there be lead!"

Offline paulstreats

  • Supreme Robot
  • *****
  • Posts: 1,381
  • Helpful? 21
Re: Question about the Atmega8 microcontroller
« Reply #4 on: January 10, 2008, 07:42:54 AM »
Without looking at the datasheet etc.. I would guess that the port C has only 7 pins which is why its a 7 bit port and not an 8 bit port. Also admin said that port C WAS an analog port.

A port which has 8 pins is an 8 bit port etc...

Offline Admin

  • Administrator
  • Supreme Robot
  • *****
  • Posts: 11,660
  • Helpful? 169
    • Society of Robots
Re: Question about the Atmega8 microcontroller
« Reply #5 on: January 10, 2008, 08:33:01 AM »
I got over my lazyness . . . Looking at the ATmega8 datasheet on page 196, it says first line '10-bit Resolution' . . .

I just noticed it says
Quote
The ADC is connected to an 8-
channel Analog Multiplexer which allows eight single-ended voltage inputs constructed from the
pins of Port C.

but it only has 6 ADC pins . . . I don't understand . . .


I also noticed the datasheet mentioned nothing about port A . . . sometimes a chip might have internal ports but no external pins. I suspect it is because they reused a design from another chip, but didn't reuse portA.

Offline dunk

  • Expert Roboticist
  • Supreme Robot
  • *****
  • Posts: 1,086
  • Helpful? 21
Re: Question about the Atmega8 microcontroller
« Reply #6 on: January 10, 2008, 01:28:17 PM »
Quote
but it only has 6 ADC pins . . . I don't understand . . .
the surface mount version has pins for the remaining 2 ADCs if i remember correctly.
the through hole chip has them on the die just you can't use them since they are not connected to pins. you can still set them up in software if you are board though....

dunk.

Offline gamefreakTopic starter

  • Supreme Robot
  • *****
  • Posts: 543
  • Helpful? 2
  • Robo-Enthusiast
Re: Question about the Atmega8 microcontroller
« Reply #7 on: January 10, 2008, 10:02:54 PM »
hey, due to the fact that I was careless and was resoldering and forget to unplug my chip and now nothing works anymore, I did a search for the chip, on digikey it is 3.66 for each, but i found this : http://www.ebest24.com/product_info.php?cPath=111_28&products_id=1746

it appears to be the same thing but for a lot cheaper and you get 5 at a time.
All hail Rodney, the holy 555 timer
And Steve said: "Let there be lead!"

Offline Admin

  • Administrator
  • Supreme Robot
  • *****
  • Posts: 11,660
  • Helpful? 169
    • Society of Robots
Re: Question about the Atmega8 microcontroller
« Reply #8 on: January 11, 2008, 08:05:16 AM »
sounds like a good excuse to get an upgrade:
http://www.societyofrobots.com/step_by_step_atmega168_swapout.shtml
(mouser has really low shipping in the US)

Quote
I did a search for the chip, on digikey it is 3.66 for each, but i found this : http://www.ebest24.com/product_info.php?cPath=111_28&products_id=1746

Thats in europe (high shipping) and is like $10 US. Not that much of a discount . . .

Offline gamefreakTopic starter

  • Supreme Robot
  • *****
  • Posts: 543
  • Helpful? 2
  • Robo-Enthusiast
Re: Question about the Atmega8 microcontroller
« Reply #9 on: January 11, 2008, 03:51:44 PM »
lol, i've had it for three days, destoryed it, and am upgrading it,  :P

does mouser sell the female plugs for the headers?
« Last Edit: January 11, 2008, 03:52:41 PM by gamefreak »
All hail Rodney, the holy 555 timer
And Steve said: "Let there be lead!"

Offline Admin

  • Administrator
  • Supreme Robot
  • *****
  • Posts: 11,660
  • Helpful? 169
    • Society of Robots
Re: Question about the Atmega8 microcontroller
« Reply #10 on: January 11, 2008, 03:57:39 PM »
hmmmm look up the manufacturing part number, then search it in mouser.

Offline gamefreakTopic starter

  • Supreme Robot
  • *****
  • Posts: 543
  • Helpful? 2
  • Robo-Enthusiast
Re: Question about the Atmega8 microcontroller
« Reply #11 on: January 11, 2008, 04:35:31 PM »
im not sure what they are, you have tons of them for your sensor and stuff, but you dont post where to buy them anywhere, like on all of your sensor tutorials you have them connected to the end of your wires to the sensor. I geuss they could be servo extension wires....
« Last Edit: January 11, 2008, 04:36:43 PM by gamefreak »
All hail Rodney, the holy 555 timer
And Steve said: "Let there be lead!"

Offline Admin

  • Administrator
  • Supreme Robot
  • *****
  • Posts: 11,660
  • Helpful? 169
    • Society of Robots
Re: Question about the Atmega8 microcontroller
« Reply #12 on: January 11, 2008, 04:46:16 PM »
the digikey part #s are listed here:
http://www.societyofrobots.com/electronics_wire_connector.shtml

click the links, and look at the manufacturer number. then just search that number in mouser or wherever.

and yeap, mouser has them I just checked.

for the 3 pin housing:
http://www.mouser.com/Search/ProductDetail.aspx?qs=hSmm4fxMIuP8Dch19CPpiw%3d%3d


Get like 10 or 20 of them. You can also reuse them easily.

 


Get Your Ad Here

data_list