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

keypad response too slow
Goto page Previous  1, 2
 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
freedom



Joined: 10 Jul 2011
Posts: 54

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

PostPosted: Tue Dec 23, 2014 5:05 am     Reply with quote

here is some download link
http://www.megafileupload.com/en/file/590854/4094-and-74595-LCD-with-3-wire-877A-zip.html
http://www.mediafire.com/download/kh8162yud86dkcf/4094_and_74595_LCD_with_3_wire_877A.zip
Mike Walne



Joined: 19 Feb 2004
Posts: 1785
Location: Boston Spa UK

View user's profile Send private message

PostPosted: Tue Dec 23, 2014 10:12 am     Reply with quote

It's all down to timings, and working out what they are.

This section tells you how to set up:-
Code:
#define KBD_DEBOUNCE_FACTOR 33 // Set this number to apx n/333 where
// n is the number of times you expect
// to call kbd_getc each second

How many times per second do you expect to go round your loop?

These lines each take ~1.2ms
Code:
        lcd_gotoxy(1,1);
        printf(lcd_putc, "%c",k);

This one ~10ms
Code:
   printf(LCD_PUTC,"%05ld   ",dat);

With these lines in place:-
Code:
   dat++;
   lcd_gotoxy(10,3);
   printf(LCD_PUTC,"%05ld   ",dat);

You're going round at once in slightly over 11ms.
So your n is ~90.
In my book the calculation n/333 does NOT yield 33.

Now do you see where the problem is?

Mike
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Goto page Previous  1, 2
Page 2 of 2

 
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