Home
Prox / RFID
Verichips
Ladder Logic
[interfacing] †
Tube Joints
Key Code From Photo
SolveSpace (3d CAD)
SketchFlat (2d CAD)
Photographs
Miscellany
Resume / Consulting
Contact Me

LDmicro Forum - 1602 LCD KeyPad Shield Interface

(you are viewing a thread; or go back to list of threads)

1602 LCD KeyPad Shield Interface (by Carey)
I'd like to use a 1602a LCD Keypad Shield with my Arduino Mega 328p (Uno). The keypad uses a pushbuttons with progressive resistors values wired into Analog Input(0). Your code then looks for a range of resistance Ito determine which button was pushed.

I've tried to use the ADC command to read ADC0(GPIO23) and then move it to a register then print out the value using the Format String to the UART. It runs on the simulator with no issues but when I load the code to the Uno, the analog value reads 23 and never changes as the keypad buttons are pushed. I tried using a second sheild as a test so see if the hardware was working with no change.

If anyone has any experience with this or has any idea how to troubleshoot this issue. Appreciate the help, -C
Tue Jul 6 2021, 21:12:44
(no subject) (by Carey)
Here's a link that explains the 1602 LCD Keypad Shield: https://www.epizeuxis.net/inde...d-keypad-shield-for-arduino-2/
Tue Jul 6 2021, 21:41:24
(no subject) (by José)
Hi Carey


Can you post your ld file so that I can try it with my AtMega328 board ?

José
Wed Jul 7 2021, 03:25:32
(no subject) (by paulino calubert)
No entiendo porque se hace una programación en escalera y luego pasarla para alduino, cuando las placas de alduino puedes cargar el programa de ldmicro y funcionan, yo personal mente lo hago pero no en (C) lo cargo en código maquina que lo genera el mismo LDMicro.
Wed Jul 7 2021, 06:56:51
(no subject) (by Carey)
Google Translation of Paulino's post|:
"I do not understand why you do a programming in ladder and then pass it to alduino, when the alduino plates you can load the ldmicro program and they work, I personally do it but not in (C) I charge it in machine code that generates it the same LDMicro."

Paulino, Thank you for replying to my post. If I understand you correctly. I'm using RLL for Arduino because the end-user is an elderly gentleman who know RLL and is not able to learn c-language programming (trust me, I've tried). So one of my projects is to emulate some of the Arduino LiquidCrystal library and keypad functionality in RLL so a 1620 LCD Keypad shield can be used with an Arduino for controlling small machines that my friend builds for his shop. I thought about implementing the user interface in the Ardunio Setup and Loop routines but I'm not familiar enough with the Arduino and LDMicro environments to be able to pass register values between the two. If you know of a better way to implement this design, I'd be interested in your thoughts, Thanks again
Wed Jul 7 2021, 07:23:21
(no subject) (by Carey)
Jose, Here's my .ld file as you requested. Let me know if you can replicate the issue I've described. Thanks, -C
Wed Jul 7 2021, 07:28:44, download attachment 1620LCDKeypad.ld
(no subject) (by José)
Carey:

I have tested your ladder with my AtMega328 board (28 pin chip)
and it works, but that your must write on uart with 4 digits (\4) instead of 3 (\3) because ADC is on 10 bits (0-> 1023).

I have tested with ldmicro by 2 ways:
- generating directly hex file
- using C libraries
with the same results.

Not tested with Arduino...

José
Wed Jul 7 2021, 13:42:05
(no subject) (by Carey Kiernan)
Hey Jose,

That's Awesome! Thanks for checking this out for me! I'll give it a shot tonight and post my solution to share with others

The only thing I'm using the Arduino IDE for is to monitor the output of the UART so I'm pretty sure it will work

Thanks again for the assist

-Carey
Wed Jul 7 2021, 18:47:17
(no subject) (by Carey)
Hi Jose, I tried to run the code on my AT328 and it doesn't appear the code is reading the analog input from the shield buttons. I was able to load an ardunio program that reads the value from the buttons and displays the analog input value on the 1602 display.

Is there any way you can recommend that I can test this out further using the LDmicro tools?

Thanks, -Carey
Thu Jul 8 2021, 20:25:21
(no subject) (by José)
I'm working on a brand new release of my ldmicro32 with a brand new tool which converters ladder .ld files into .c, easy to read, equivalents.
Then .c file can be compiled, using external libraries, into a .hex.
All the operations are managed from ldmicro32.

It may be a solution for you ?

The converter is almost ready but not adapted yet to AVR targets ; I'm testing it with ARMs. But there are very little things that are target dependent and it should be working within a few weeks.

BR
José
Fri Jul 9 2021, 02:42:35
(no subject) (by Carey Kiernan)
I'd be happy to help you beta test a new release of your software. Let me know what I can do.

I was able to get my code working on a ATMega 2560 but it will not read the analog input when running on my AT328P 28 pin Uno. I'm using the Atmel Studio libraries to directly compile my hex code for the Ardunios with avr-gcc.exe and flashing the device with avrdude.exe.

Looking forward to your next release,

-Carey
Fri Jul 9 2021, 13:49:18
Post a reply to this comment:
Your Name:
Your Email:
Subject:
(no HTML tags; use plain text, and hit Enter for a line break)
Attached file (if you want, 5 MB max):