|
|
View previous topic :: View next topic |
Author |
Message |
Jay2004 Guest
|
is a pic able to handle all this work? |
Posted: Tue Apr 06, 2004 3:17 pm |
|
|
I am thinking to design a hand-held terminal project, the function of this terminal is able to take the input from a keypad(4x4) then search data from the memory(eeprom) and display the result on a 2 or 4 lines LCD, input will be 4 digits number, the output will be 15 letters long, around 1000 data will be recorded. my question are:
what kind of eeprom can be used?
how to create a look-up table?
can i load the data from pc through a pic into eeprom?
am i doing the right way?
thanks!
Jay |
|
|
dbotkin
Joined: 08 Sep 2003 Posts: 197 Location: Omaha NE USA
|
|
Posted: Tue Apr 06, 2004 11:34 pm |
|
|
Well, a 24LC256 should be sufficient. You might be able to get it down to a 24LC128. I'm figuring a layout with 2 bytes for the number, 15 for the data. 17 bytes x 1000 entries comes up to 17000 bytes, just a little too big for a 24LC128. A 24LC256 will give you enough room for 1927 entries.
Your 4-digit number can be anything from 0000 to 9999 (or FFFF?), which can be represented by two bytes. A lookup table would be ridiculously long, so just store the index with the data. Convert your 4 keystrokes to a long, look at EEPROM address 0 for a match on the high-order byte, if it matches see if address 1 matches the low-order byte. If so you fetch the next 15 locations as data. If there's no match just repeat the process, adding 17 (15 data plus 2 index) to the EEPROM address until you run out of address space. I've done something very similar with a 16F877 at 20 MHz and it's plenty fast. Matter of fact it may have been 4 MHz, but the limiting factor will be the EEPROM read speed.
You can load data from the PC into EEPROM, sure. Serial receive, write to EEPROM. Do it at a low enough baud rate with a hardware UART and you won't even need handshaking.
As for whether you're doing it right - it's too soon to tell! And to answer your question of whether the PIC can handle all the work... sure, but what will it be doing the other 90% of the time? |
|
|
jay2004 Guest
|
|
Posted: Wed Apr 07, 2004 2:04 pm |
|
|
Hi!dbotkin,
thanks for the help!! |
|
|
|
|
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
|