0
\$\begingroup\$

PCO/ADC/PCINT8 is pin mapping for pin 23 of ATmega 168.Which of these mappings should be included in LiquidCrystal lcd(0, 1, 2, 3, 4, 6); when interfacing ATmega 168 to 16*2 lcd? Can someone assist me on which parameters of ATmega 168's pin mapping should be used to initialize the library(LiquidCrystal lcd(0, 1, 2, 3, 4, 6)) using arduino IDE especilly for Proteus Simulation meaning Arduino Programmer is not available?

\$\endgroup\$
  • 1
    \$\begingroup\$ Going to need some datasheets. \$\endgroup\$ – Matt Young Mar 26 '13 at 18:19
  • 1
    \$\begingroup\$ And a schematic! \$\endgroup\$ – Leon Heller Mar 26 '13 at 18:23
  • 2
    \$\begingroup\$ Arudino library routines typically take Arduino (board) pin numbers rather than AVR (chip) pin numbers. \$\endgroup\$ – Chris Stratton Mar 26 '13 at 18:52
1
\$\begingroup\$

If you are using Arduino, physical pin 23 is mapped to Arduino analog pin 0. "Plain" pin numbers (such as the ones in your example of LiquidCrystal initialization) refer to digital pins in Arduino-speak. To initialize the LiquidCrystal library to use analog pins, call the initialization code with the analog pin name, which begins with A LiquidCrystal lcd(A0, ...). (See here for details). Since the LiquidCrystal library uses digitalWrite() (which is aware of analog pin names) internally, this will not present a problem.

Incidentally, the pin mapping between Arduino and ATmega168 is here

| improve this answer | |
\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.