View previous topic :: View next topic |
Author |
Message |
filjoa
Joined: 04 May 2008 Posts: 260
|
max value eeprom |
Posted: Sun Jan 10, 2010 7:10 pm |
|
|
Hi
What is max value which I can save on PIC18F252 EEPROM?
For example:
Quote: |
int8 STATE;
STATE=1;
write_eeprom(0, STATE);
|
Is possible I define STATE like int32 or float32? and put STATE=2147483647?
Best regards |
|
|
dyeatman
Joined: 06 Sep 2003 Posts: 1933 Location: Norman, OK
|
|
Posted: Sun Jan 10, 2010 8:47 pm |
|
|
According to the latest manual on page 273 it says the following:
Quote: |
write_eeprom( )
Syntax: write_eeprom (address, value)
Parameters: address is a (8 bit or 16 bit depending on the part) int, the range is device dependent
value is an 8 bit int
|
_________________ Google and Forum Search are some of your best tools!!!! |
|
|
FvM
Joined: 27 Aug 2008 Posts: 2337 Location: Germany
|
|
Posted: Mon Jan 11, 2010 12:08 am |
|
|
Handling of larger data types with EEPROM has been verbosely discussed at CCS Forum. Just search. |
|
|
filjoa
Joined: 04 May 2008 Posts: 260
|
|
Posted: Mon Jan 11, 2010 4:31 am |
|
|
hi
sorry I try find before post this topic and don't find anythink... I have write on search "eprom" and not "eeprom", sorry.
I make the new search and I find very information, and one of them tell to I see file "internal_eeprom.c" and on this file I see witch is possible read and write in 32bits.
Quote: |
void write_int32_eeprom(address, int32 data) ////
//// Call to write a 32 bit integer ////
//// ////
//// int16 read_int32_eeprom(address) ////
//// Call to read a 32 bit integer
|
but on PIC18F252 datasheet tell 8bits. because that I stay confuse.
if I include "internal_eeprom.c" on my program it accept my int32 value?
best regards |
|
|
dnatechnical
Joined: 26 Nov 2009 Posts: 19
|
|
Posted: Mon Jan 11, 2010 5:31 am |
|
|
if you are using 18f252 then it has only 256 bytes eeprom
which addresss are 0 to 256 with data bit8
it can't save your data more then 256 bytes
if you r using external serial eeprom then its depend upon your select device |
|
|
filjoa
Joined: 04 May 2008 Posts: 260
|
|
Posted: Mon Jan 11, 2010 7:58 am |
|
|
why the "internal_eeprom.c" have write that?
when I can use this driver? this file is to external device? |
|
|
ckielstra
Joined: 18 Mar 2004 Posts: 3680 Location: The Netherlands
|
|
Posted: Mon Jan 11, 2010 4:17 pm |
|
|
The file internal_eeprom.c is for the internal EEPROM.
For external EEPROM see the file external_eeprom.c. This file calls the function read_ext_eeprom(), defined in the file for the specific external EEPROM. Examples are 2401.c, 2402.c, 9606.c, 24128.c, etc.
For storing an int16 you call write_int16_eeprom, a maximum value of 65536
For storing an int32 you call write_int32_eeprom, a maximum of 4 billion-something.
For larger values you can write your own function using the above example functions. |
|
|
dnatechnical
Joined: 26 Nov 2009 Posts: 19
|
|
Posted: Mon Jan 11, 2010 9:20 pm |
|
|
"internal eeprom.c " file support to all devices which has internal eeprom.
Other devices has 256 or 512 or 1024 eeprom space. So address will be 16bit for higher than 256 bytes, but your selected device has 255 bytes only so when your address higher than 256 then it's overwrite to your 0 to 256 address as per your address. |
|
|
filjoa
Joined: 04 May 2008 Posts: 260
|
|
Posted: Wed Jan 13, 2010 7:25 pm |
|
|
Hi
Ok I think which understand how this file work, thanks.
For example, if I have an array of 100000000 elements (+- 5 seconds at 20Mhz, of ADC reading, I think), is possible I save this on eeprom?
My idea is to read values from ADC in 5 seconds and save this on array, but if possible save this on eeprom.
Best regards |
|
|
arunb
Joined: 08 Sep 2003 Posts: 492 Location: India
|
RE: |
Posted: Wed Jan 13, 2010 11:11 pm |
|
|
Hi,
You cannot save 100000000 elements (also bytes ??) in the internal eeprom of the mcu.
You could use an external eeprom for this, but these can be slow, I think you should use a Flash RAM for your application, they are fast and are meant for frequent write/erase cycles.
How many channels of the ADC are you going to access and save ?? Each sample of the ADC reading will consume 2 bytes or 16 bits, assuming the ADC has a resolution of 10 or 12 bits.
thanks
arunb |
|
|
ckielstra
Joined: 18 Mar 2004 Posts: 3680 Location: The Netherlands
|
|
Posted: Thu Jan 14, 2010 2:08 am |
|
|
filjoa wrote: | For example, if I have an array of 100000000 elements (+- 5 seconds at 20Mhz, of ADC reading, I think), is possible I save this on eeprom? | ...... NO.
Think a bit more before posting wild questions.
In the posts above it is mentioned several times that the internal EEPROM of the PIC18F252 is 256 bytes, max. 1024 bytes on larger processors, how on earth do you want to store '100000000 elements'? Assuming each 'element' is 8 bits, you are talking about 100Mbyte data...
Another problem is the speed of the ADC. An ADC capable of 20Msamples/second needs to be an external device. The internal ADC of the PIC18F252 requires a minimum of 11us/sample = 91kHz, excluding acquisition time. More realistically you can forget using the internal ADC for anything above 20kHz sampling rate.
A PIC processor is small. Tiny when compared to a modern PC. You'll have to adapt your targets when working with these processors. |
|
|
filjoa
Joined: 04 May 2008 Posts: 260
|
|
Posted: Thu Jan 14, 2010 5:01 am |
|
|
hi
ok thank, my ideia is save sound like a eord for example. but I find on forum anda I read sometkins about isd4003, I'll try buy one and use them.
is possible compare sound with this IC on PIC? for example I record word "START" with my voice, on program I define is it word is call it activate one led. is possible?
best regards |
|
|
Ttelmah Guest
|
|
Posted: Thu Jan 14, 2010 9:41 am |
|
|
Not really....
You can't just compare a sound, like text. No two samples will be exactly the same. Even if you played the same sound, using a tape machine, and digitally recorded it twice, there _would_ be differences (timing, the random noise element in sampling, etc. etc,).
To compare sound, requires a huge amount of mathematics. What you do, is perform a Fourier analysis to work out the tones contained in the signal, and the relative levels of these, then use 'fuzzy logic' comparison, to see if the pattern of changes in the amplitude and levels is a good enough match to what you are looking for.
Do a search for 'Hidden Markov model', to find out about te basis used in most systems now.
You could perform this in a PIC, but on the standard PICs, perhaps expect to take several tens of seconds to perform the analysis, for even a single word. A DSPIC, could do it faster. However you are also looking at something involving several thousands of lines of quite sophisticated code. I was involved in writing a voice recognition system a few years ago (that is embedded on some cars today), and it was a nine month project, involving three programmers, and the core parts of the analysis were done in hardware to get the speed required. Something over 3 million gates, plus a processor with a lot more RAM, and ROM than the typical PIC....
Best Wishes |
|
|
filjoa
Joined: 04 May 2008 Posts: 260
|
|
Posted: Thu Jan 14, 2010 9:53 am |
|
|
thanks to the explanation Ttelmah
is possible buy one system voice recognizer to connect on PIC? |
|
|
Ttelmah Guest
|
|
Posted: Thu Jan 14, 2010 10:09 am |
|
|
Do a search for HM2007, VRP6679, and aP89341.
Generally limited vocabulary one or two chip solutions (some need a memory). The VRP, is rather old now, but has probably been replaced by something better. You will find people using them on many of the robotics forums.
Best Wishes |
|
|
|