I've wired up my GLCD according to how it should be done. But now I'm trying to free up analog I/O 4 of the Arduino Nano that I'm using since I need it for the wire library to be able to use I2C communication. Analog I/O 5 is already free for use.
The GLCD makes use of analog I/O 4 for for the GLCD enable. Now I looked at the openGLCD config file and I switched it over to a manual configuration file. In the manual configuration file I only changed A4 to A6 and uploaded again after restarting the IDE. My display, displayed a lot of garbage. I then changed the manual configuration file to A7 to try and see if it made a difference. It didn't. Lastly I tried to change it over to a digital pin, I've used 13 and stll it didn't work.
So now I'm hoping that one of you could assist me on how to resolve the issue. I'm not sure if maybe I'm declaring it wrong in the manual configuration file perhaps or maybe it is something else?
I've attached the manual configuration file, the main configuration file and a picture of what the display shows with the different manual configuration settings. I've numbered the displays and here is how it's been configured for the specific picture:
Dirk,
I'm assuming that you are wanting to free up the I2C pins?
What you did is ok.
However, the issue you are bumping into is that
A6 and A6 are only analog pins. They cannot be used as digital pins
as the AVR internally didn't hook them up to a register for digital i/o.
The Arduino core code doesn't do any sanity checks for this and will
end up indexing off the end of a table so there is no telling what actually
happens.
You should be able to digital pin 13, but use it for something else other than EN.
Pin 13 is the LED which probably blinks on reset and that may send some
bad data to the LCD when it blinks during reset.
To do this will require changing two pins, EN and some other pin to use 13.
Maybe hook r/w to pin 13. (the LED will be on for reads and off for writes).
Alternatively, you could pick a different pin for EN other than A6, A7 or 13,
perhaps pin 2 or 3?
I hope that you are well. Thanks for the input. I've got digital 12 still open as well so I will try to hook it up to that. I'm just busy with some other coding currently so I will most likely only try it out tomorrow. I'll give you some feedback then whether it worked or not.
I just looked at pighixxx's diagram of the Nano v3 and I understand now what your saying with:
However, the issue you are bumping into is that
A6 and A6 are only analog pins
I speculated that the analog pins are just driven to their full range to give out a "digital" on value or fully off to give out a "digital" off value but I see now that most of the pins can actually be changed over to digital pins if I understand pighixxx's diagram correctly.
What you may not realize is that the AVR chips used on the Arduino boards
don't have any analog output capabilities.
Some pins can be digital outputs or analog inputs.
Some pins can be digital outputs but also support PWM modulation output.
The pins used for analog on the AVR are only for analog input.
The A6 and A7 pins can only be analog inputs.
The IDE routine analogWrite() was a VERY BAD name.
There is no analog output involved at all.
analogWrite() does a PWM modulation output on a digital pin.
In fact if you look at the pin arguments used for analogRead() and analogWrite() they
don't even take the same arguments.
analogRead() wants an analog pin number while analogWrite() wants a digital pin number.
In my opinion this was a huge screwup in the API as it is a huge inconsistency.
Thanks for the info and for broadening my knowledge. I've tried using digital 12 and have used digital 3 as well and both these pins worked. So it seems to be as you've said with the LED not working well together with the enable signal. Thanks again for the information and I hope that you will enjoy a wonderful day ahead.