0

In the Arduino Tutorial Page named "Hello World" aimed to help people connect a 16x2 LCD Display compatible with Hitachi HD44780 driver to an Arduino Uno. The pins used to connect the Arduino Uno and LCD Module are as follows:

  • LCD RS pin to digital pin 12
  • LCD Enable pin to digital pin 11
  • LCD D4 pin to digital pin 5
  • LCD D5 pin to digital pin 4
  • LCD D6 pin to digital pin 3
  • LCD D7 pin to digital pin 2

Pins 3,5 and 11 are connected to PWM Pins, however, I'm wondering if they actually need these PWM capabilities or does this tutorial just pick random pins and the LCD's D6, D4 and Enable pins doesn't actually need the PWM capabilities available of these pins.

I'm asking this as I'm considering on using an Arduino Mega for my next project and it would be much easier and neater for all the pins of the LCD to go onto the digital pins instead of some being on the digital and others on the PWM pins.

1
  • 2
    you are overthinking it. PWM is an additional capability of the pin. all gpio pins of Uno and Mega are digital pins. of course the LCD libray doesn't use PWM
    – Juraj
    Dec 27, 2018 at 9:22

2 Answers 2

2

Likely all programmable pins on modern embedded processors are able to perform digital I/O. In addition, many can also perform other tasks such as PWM, or Analog to Digital Conversion (ADC). This is true for many of the different processors used on different Arduino boards.

Often, the nice people who write the C++ driver class of programs or Arduino Libraries offer the user the ability to change pin assignments used by the Arduino Libraries when instantiating an instance of the driver. This is true for the LiquidCrystal driver in the tutorial in the question. This can be an advantage as processor's resources are limited. For example, if you need PWM controlled pin to dim LEDs, you can move LCD controlling pins to other non-PWM pins.

The LCD specified in the tutorial linked to in the above question uses a common Hitachi HD44780 interface. Such assemblies only need embedded processor Digital I/O pins for control. Had the LCD no electronic driver, the segments need to be directly driven by very low alternating current (AC). This is difficult for embedded processors. However, it may be possible using enough PWM pins and some clever software & hardware.

1
  • 1
    Too many words.
    – Rudy
    Dec 27, 2018 at 13:15
1

PWM is not used on those pins for the LCD operation. You can choose more convenient pins as long as they are general purpose pins. For example, not A/D input only.

(I thought you might appreciate a short clear answer)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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