Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

LCD and Button Controller

Status
Not open for further replies.

Gobbledok

Active Member
Hey guys I am working on a digitally controlled 7.1 preamp just for myself as a bit of a hobby. So far I have drawn up the circuit for the front panel board which includes an LCD Display (HD44780), some LED's, some buttons and a rotary encoder. The rest of the circuit (which isn't drawn up yet) will include some Digital Volume Control IC's (PGA2320) from Texas Instruments, some relays for input switching, a D/A converter, and maybe an analogue 7.1 matrix decoder.

The LCD and LED's are controlled by two 74HC595 serial-parallel converters. The buttons and rotary encoder are read by a 74HC165 parallel-serial converter. The LCD backlight is controlled by a PWM pin. The LCD enable is connected directly to the PIC (in the rest of the circuit).

The data and clock pins of each '595 are connected to each other and then to the PIC rather than daisy-chaining them. This way I only have to shift one byte to update the LCD instead of 2. I imagine I will be updating the LCD more often than changing the LED's.

The load (/PL) pin of the '165 is connected straight to the PIC. The serial-out (Q7) from the '165 is connected to the '595 data pins through a resistor. This way I can change the corresponding pin on the PIC to an input to read the buttons, or an output to update the LCD/LED's.

All of the buttons are OR'd together using small diodes for an interrupt-on-change function in order to know when to read the buttons. Is this the best way of doing this or should I poll the 74HC165?

Apart from that I am after any other advice you can give, I am still learning. Or are there any glaring mistakes perhaps? Maybe a way of doing something easier. Is the whole way of doing things OK?

Thanks in advance guys for any assistance you can give.
 

Attachments

  • Front Panel Board.jpg
    Front Panel Board.jpg
    104.8 KB · Views: 581
Last edited:
Sometimes it's more convenient to wire switches active-low so one side can be ground, which is usually easier to find on a typical layout. Somewhere your interrupt line has to be pulled to its default state, either on this board or the host board.

If you were using a bipolar 74LS165, you would want to drive the LED cathodes. Since you're using 74HC165 with symmetrical drive, it's OK either way. By rearranging resistors a little bit, you could ground two of the pins on the lighted switch .

If this is surface mount, you can get diodes in pairs (SOT23 etc.) to save space.
 
Excellent, thanks for the tips, you are worth your weight in gold.

I have had a bit of a think about the pull-down resistor on the interrupt line. Am I better off simply adding a resistor after the diodes, before the debounce, or would I be better off doing it as per the attachment below?
 

Attachments

  • Debounce.jpg
    Debounce.jpg
    52.7 KB · Views: 267
Awesome, thanks heaps.


Edit:
By rearranging resistors a little bit, you could ground two of the pins on the lighted switch .

That there is an excellent tip.
 
Last edited:
Status
Not open for further replies.

New Articles From Microcontroller Tips

Back
Top