|
|
View previous topic :: View next topic |
Author |
Message |
Joshua Lai
Joined: 19 Jul 2004 Posts: 42 Location: Malaysia, PJ
|
Many devices on PIC16F876 |
Posted: Tue Sep 06, 2005 1:26 am |
|
|
Dear All,
I am using PIC16F876 and old version PCM compiler. I need to use a LCD display, a 4x3 keypad, an EEprom, and a serial DAC. I must use port C for i2c communication for EEprom, and serial communication for DAC. Both LCD and keypad need 7 pins connection, but port A only have 6 pins.
Any suggestion that i can connect all these devices to the PIC?
Can I try to:
1. Use any decoder to connect the keypad?
2. Use a single ADC input for a few push buttons input?
3. Connect 4 data pins of the LCD, then pull-up or ground the rs, r/w, enable pins? |
|
|
Ttelmah Guest
|
|
Posted: Tue Sep 06, 2005 2:21 am |
|
|
Probably the simplest solution, would be a 2 to 4 line decoder to drive the keypad. Two lines select which output on this is enabled (connected to the 4 connections on one axis of the keypad), then three lines read the signal back. Five connection, and a very cheap TTL/CMOS chip. Something like a 74LS156, with open collector outputs, makes this very easy to use.
The LCD, needs it's control pins.
Yes you can decode a keypad using a ADC input. You add resistors, to effectively turn the keypad into a DAC. However you are limited by the resistor accuracy, the accuracy of the ADC, and assuming you read a keypad 'row' this way (4 bits giving 16 different voltage patterns), you would still need three drives to control the columns, and would be adding 16 resistors to the circuit, which is probably more complex than using the decoder.
Best Wishes |
|
|
dromero
Joined: 05 Sep 2005 Posts: 3
|
Re: Many devices on PIC16F876 |
Posted: Tue Sep 06, 2005 8:29 am |
|
|
Joshua Lai wrote: | Dear All,
I am using PIC16F876 and old version PCM compiler. I need to use a LCD display, a 4x3 keypad, an EEprom, and a serial DAC. I must use port C for i2c communication for EEprom, and serial communication for DAC. Both LCD and keypad need 7 pins connection, but port A only have 6 pins.
Any suggestion that i can connect all these devices to the PIC?
Can I try to:
1. Use any decoder to connect the keypad?
2. Use a single ADC input for a few push buttons input?
3. Connect 4 data pins of the LCD, then pull-up or ground the rs, r/w, enable pins? |
The 'F876 has a PORT B also. Why not use some of that? |
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|