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 support@ccsinfo.com

Problem with CCSs keypad driver KBD.C

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
D.e



Joined: 28 Dec 2009
Posts: 3

View user's profile Send private message

Problem with CCSs keypad driver KBD.C
PostPosted: Mon Dec 28, 2009 6:11 pm     Reply with quote

Hi all,
I have got a problem with CCSs keypad driver "kbd.c". I couldn't use it. I connected the wires like this

and I have changed the "kbd.c"

Code:
#else ////////////////////////////////////////////////// For the black keypad

#define COL0 (1 << 1)
#define COL1 (1 << 2)
#define COL2 (1 << 3)

#define ROW0 (1 << 4)
#define ROW1 (1 << 5)
#define ROW2 (1 << 6)
#define ROW3 (1 << 7)


#endif


And my main code is
Code:

#include<16f877.h>
#use delay(clock=4M)
#fuses XT,NOWDT
#use rs232(baud=9600, xmit=PIN_B1)

#include<KBD.c>

void main()
{
   char c;
   printf("Hello\r\n");

   while(TRUE)
   {
      c=kbd_getc( );
      if(c!='\0')
         printf("Key:%c\r\n",  c );
      delay_ms(20);
   }
}

But it didn't work. I don't know what is wrong. Can anybody help me?
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Mon Dec 28, 2009 6:35 pm     Reply with quote

That's not the correct way to use the kbd.c keypad driver.
Look in this CCS example file to see how to do it:
Quote:
c:\program files\picc\examples\ex_lcdkb.c

Note that they don't use a delay_ms() statement in the while loop.


If you still have a problem, then post your compiler version.
Guest








PostPosted: Tue Dec 29, 2009 6:18 am     Reply with quote

Thank you for your help.
My compiler version is 4.013. I have compiled and tried "ex_lcdkb.c" but it didn't work again.I only see "Ready..." on the lcd screen.
I defined "use_portb_lcd TRUE" and "use_portd_kbd TRUE" and my connections and bit masks are seen in my first post.
Are they true?
Ttelmah
Guest







PostPosted: Tue Dec 29, 2009 9:13 am     Reply with quote

The obvious thing is what are the resistors connected to?. The symbol appears to be the triangle, normally used for GND. They need to connect to Vcc/Vdd.

Best Wishes
ckielstra



Joined: 18 Mar 2004
Posts: 3680
Location: The Netherlands

View user's profile Send private message

PostPosted: Tue Dec 29, 2009 10:11 am     Reply with quote

Compiler v4.013 is very unstable. It was one of the first v4 compiler versions and contained many bugs. If you download an illegal version, then at least take one of the stable versions...
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