CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to CCS Technical Support

Many devices on PIC16F876

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
Joshua Lai



Joined: 19 Jul 2004
Posts: 42
Location: Malaysia, PJ

View user's profile Send private message Send e-mail

Many devices on PIC16F876
PostPosted: Tue Sep 06, 2005 1:26 am     Reply with quote

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







PostPosted: Tue Sep 06, 2005 2:21 am     Reply with quote

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

View user's profile Send private message

Re: Many devices on PIC16F876
PostPosted: Tue Sep 06, 2005 8:29 am     Reply with quote

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?
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
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