LCD x Thumbwheel Switch Interface

Thread Starter

Markus999

Joined Feb 14, 2018
3
Hi! I'm a newbie when it comes to programming and I just want some help regarding the interface between a thumbwheel switch and an LCD.

What I want to do is that I want to display on the LCD whatever the number is displayed on the thumbwheel switch. The thumbwheel switch comes in 4 and connected in a bus connection (refer to the attached image, I modified it into 4 although the connections are the same.). I am also using PIC16F1937 (44pins) as my microcontroller.

However, as I said, my skills in programming ain't that much so I need help. Thank you in advance!
 

Attachments

JohnInTX

Joined Jun 26, 2012
4,787
Welcome to AAC!

The LCD you show is a standard module with a Hitachi 44780-compatible controller. This unit requires some initialization and then it displays ASCII (printable characters). Your project would involve reading the 4bit digits 0-9 from the thumbwheels connected to the PIC IO ports. Each digit would require some conversion to ASCII to write to the display. It's not hard but if you're a beginning programmer there's a bit to it.

What language and programming environment will you use? For C. MikroC is a good one that has extensive libraries that make driving the LCD a snap. The free version should be enough to do this one.

Microchip has its own C compiler XC8 for free along with MPLABX. XC8's libraries require a bit more hands-on to use but there is lots of LCD code right here on AAC we can point you to if you go that way. You'll need a PICkit3 to program and debug -- avoid the clones.

To get started, you'll need a schematic / hookup diagram for the 16F1937. The schematic you show is for some other chip. That one doesn't have enough IO. A 44pin PIC should have enough to read the 4 switches and drive the LCD without the diodes and decoder chip. The LCD connection shown is a typical 4 bit interface. That will work fine. Consider the 4 thumbwheels on PORTD and C with the LCD bus on PORTB or A and the LCD control lines on PORTE (working from memory here so you may have to tweak those assignments a bit).

Let us know the language, compiler and basic hookup you want to use and post a preliminary schematic. Meanwhile, here's the datasheet for the LCD.

Have fun!
 

Attachments

Thread Starter

Markus999

Joined Feb 14, 2018
3
Hi, thank you for that beginner friendly guiding questions!

First off, I am to use C programming and I have MPLAB X with xc8 as a compiler and a legit PICkit 3 available.

The schematic I showed above is my preliminary approach (see attached image). Although I'm not so sure if the connection is feasible, I want PORTD's D4-D7 pins as the output pin of my LCD as well as that of the pushwheel switches. Recommendations are always welcome.

Before doing this project, I have already projected some characters on my 16x2 LCD although I don't know how to "read" the output from the switches and put it in the LCD.
 

Attachments

Top