View previous topic :: View next topic |
Author |
Message |
freedom
Joined: 10 Jul 2011 Posts: 54
|
Flex_LCD420 and Flex_KBD_4X3 SHARE SAME PORT |
Posted: Thu Aug 22, 2013 9:44 am |
|
|
For reference of PCM Programmer
http://www.ccsinfo.com/forum/viewtopic.php?t=26229
Ok, Fantastic solution.
Thanks to PCM programmer.
I want to use port B of PIC16F877a for both LCD (4 x 20) & keypad (4x3). But If I want to use ICSP with those then what or how to do?
is this solution support driver Flex_LCD420.c and Flex_KBD_4X3.c ?
NOTE THAT I AM USING COMPILER VER. 4.124 |
|
|
Ttelmah
Joined: 11 Mar 2010 Posts: 19504
|
|
Posted: Thu Aug 22, 2013 10:49 am |
|
|
Each of those drivers can be set to use any port you want. Just change the definitions. |
|
|
temtronic
Joined: 01 Jul 2010 Posts: 9225 Location: Greensville,Ontario
|
|
Posted: Thu Aug 22, 2013 11:51 am |
|
|
Please read the PIC datasheet chapter on 'programming' or 'using ICSP'.
In there Microchip clearly details how to use both ICSP as well as 'user' interfaces.
hth
jay |
|
|
freedom
Joined: 10 Jul 2011 Posts: 54
|
|
Posted: Fri Aug 23, 2013 5:13 am |
|
|
Quote: | Each of those drivers can be set to use any port you want. Just change the definitions. |
Thanks Ttelmah to reply.
already I'm using those drivers.
My query is for using LCD and Keypad on same port at a time
http://www.ccsinfo.com/forum/viewtopic.php?t=26229
As i post above link where showing a guide line to use LCD and Keypad on the same port at a time. That means same port shares both LCD and Keypad.
Now I want to use port B of PIC16F877a for both LCD (4 x 20) & keypad (4x3) at a time.
does this solution support driver Flex_LCD420.c and Flex_KBD_4X3.c ?
NOTE THAT I AM USING COMPILER VER. 4.124 |
|
|
freedom
Joined: 10 Jul 2011 Posts: 54
|
|
Posted: Sat Aug 24, 2013 12:50 am |
|
|
Quote: | Each of those drivers can be set to use any port you want. Just change the definitions. |
Thanks Ttelmah to reply.
already I'm using those drivers.
My query is for using LCD and Keypad on same port at a time
http://www.ccsinfo.com/forum/viewtopic.php?t=26229
As i post above link where showing a guide line to use LCD and Keypad on the same port at a time. That means same port shares both LCD and Keypad.
Now I want to use port B of PIC16F877a for both LCD (4 x 20) & keypad (4x3) at a time.
does this solution support driver Flex_LCD420.c and Flex_KBD_4X3.c ?
NOTE THAT I AM USING COMPILER VER. 4.124 |
|
|
Ttelmah
Joined: 11 Mar 2010 Posts: 19504
|
|
Posted: Sat Aug 24, 2013 1:18 am |
|
|
You are going the way to getting a bad reputation, running two threads on the same question.....
Yes, you can combine the two drivers onto one port.
PCM programmer gives 'how'.
However _caveat_. When a key is pressed, you cannot write to the LCD. Also, certain patterns of three keys, will cause problems, unless there are diodes on the key drive lines.
However you'll not blow up the PIC, unless you do something silly like connecting 5v directly to an output (even then it'll often survive), or having long lengths of unshielded wire to the keypad.
Basically, once the LCD 'enable' line is off, the remaining signals can be used to control a keypad. To do the job 'better', ideally the four input lines should feed to the PIC via 'AND' gates, with the other input of each gate connected to the signal that feeds the LCD enable. This then means that when the LCD is 'on', the keypad is disconnected. You'd then need separate pull up resistors where these lines connect to the gates, and diodes on the drive lines.
Done like this, the LCD will still work, when keys are pressed. Otherwise if keys are held, the LCD can't work. |
|
|
|