go_away

Author Topic: atmega8/168 pinout question  (Read 3302 times)

0 Members and 1 Guest are viewing this topic.

Offline SmAsHTopic starter

  • Supreme Robot
  • *****
  • Posts: 3,959
  • Helpful? 75
  • SoR's Locale Electronics Nut.
atmega8/168 pinout question
« on: March 15, 2009, 02:00:28 PM »
through reading a few forum posts and googling up some datasheets i have found that there are (correct me if im wrong) 13 digital ports, 5 analogue ports.
digital: 2, 3, 4, 5, 6, 11, 12, 13, 14, 15, 16, 17, 18, 19
analogue: 23, 24, 25, 26, 27, 28
reset: 1 (do you just short it to +5V?)
crystal: 9, 10
gnd: 22, 8
vcc:  7
i think thats all, i am still clueless about what avcc and aref do?
my main question is:
can all digital pins be configured to both inputs and outputs? and can i use all those pins a outputs? now i know about how most sensors give analogue readings and such i need to use an adc port.
Howdy

Offline superchiku

  • Supreme Robot
  • *****
  • Posts: 953
  • Helpful? 5
  • cooll
Re: atmega8/168 pinout question
« Reply #1 on: March 15, 2009, 02:26:40 PM »
avcc and aref provide voltage for the adc...aref is analog reference voltage pin where atod conversion will be done according to the refrence voltage given at that pin...
JAYDEEP ...

IT AND ROBOTICS ENGINEER

"IN THE END IT DOESNT EVEN MATTER"

Offline Webbot

  • Expert Roboticist
  • Supreme Robot
  • *****
  • Posts: 2,132
  • Helpful? 108
Re: atmega8/168 pinout question
« Reply #2 on: March 15, 2009, 02:42:12 PM »
my main question is:
can all digital pins be configured to both inputs and outputs? and can i use all those pins a outputs? now i know about how most sensors give analogue readings and such i need to use an adc port.

Yes all I/O pins can be outputs. But NB this is a +5v output with a max current of around 40mA per pin. So you cant just connect a DC motor to the pin. You can connect a couple of servos - so long as their current draw doesn't exceed the 1A available via the voltage regulator.
Webbot Home: http://webbot.org.uk/
WebbotLib online docs: http://webbot.org.uk/WebbotLibDocs
If your in the neighbourhood: http://www.hovinghamspa.co.uk

Offline SmAsHTopic starter

  • Supreme Robot
  • *****
  • Posts: 3,959
  • Helpful? 75
  • SoR's Locale Electronics Nut.
Re: atmega8/168 pinout question
« Reply #3 on: March 15, 2009, 07:10:10 PM »
yes i know about servos and whatnot with the motor controllers and how you can fry pins. so you're saying even the analogue pins can be outputs?
Howdy

Offline Webbot

  • Expert Roboticist
  • Supreme Robot
  • *****
  • Posts: 2,132
  • Helpful? 108
Re: atmega8/168 pinout question
« Reply #4 on: March 15, 2009, 10:10:03 PM »
Yes. The ADC converter works with 'channels'. On most packages 'especially a 28 pin' then each pin doubles, or even triples, up - ie it fulfills lots of functions. So the 'analogue pins' can either be used as an analogue channel or as a digit i/o port pin.
Webbot Home: http://webbot.org.uk/
WebbotLib online docs: http://webbot.org.uk/WebbotLibDocs
If your in the neighbourhood: http://www.hovinghamspa.co.uk

Offline SmAsHTopic starter

  • Supreme Robot
  • *****
  • Posts: 3,959
  • Helpful? 75
  • SoR's Locale Electronics Nut.
Re: atmega8/168 pinout question
« Reply #5 on: March 15, 2009, 11:25:47 PM »
hmm, i will have to look into this. thank you for your help webbot  :D
Howdy

Offline superchiku

  • Supreme Robot
  • *****
  • Posts: 953
  • Helpful? 5
  • cooll
Re: atmega8/168 pinout question
« Reply #6 on: March 16, 2009, 11:20:28 AM »
any pin except the avcc,aref and sum other pins can be configured for i/o
JAYDEEP ...

IT AND ROBOTICS ENGINEER

"IN THE END IT DOESNT EVEN MATTER"

Offline SmAsHTopic starter

  • Supreme Robot
  • *****
  • Posts: 3,959
  • Helpful? 75
  • SoR's Locale Electronics Nut.
Re: atmega8/168 pinout question
« Reply #7 on: March 16, 2009, 01:01:07 PM »
there is 14 digital pins and 6 analogue pins.
Howdy

 


Get Your Ad Here

data_list