Storing values on pic16f887

Thread Starter

quantumlab

Joined Dec 4, 2008
19
Im using a PIC to store and display varying voltage values in real time. I would like to store these values onboard the PIC for future analyis,is this possible? Would like to have a sampling rate of once a second.The sensor will be running up to an hour. We are using MICROC on a PIC16F887.

Any help would be appreciated
 

mik3

Joined Feb 4, 2008
4,843
Yes, you can use the built-in EEPROM of the PIC to store values for future use. I am not sure if this PIC has enough EEPROM for your application. If not look for another one with bigger EEPROM capacity.
 

Alberto

Joined Nov 7, 2008
169
Noway! assuming your data is at the minimum two bytes long, then sampling every second for one hour means 7200 bytes. No 16F series pics have so much eeprom on board. You must use external memory.

Alberto
 

futz

Joined Dec 14, 2008
23
Im using a PIC to store and display varying voltage values in real time. I would like to store these values onboard the PIC for future analysis. Is this possible? Would like to have a sampling rate of once a second.The sensor will be running up to an hour. We are using MICROC on a PIC16F887.
3600 seconds in an hour. Say your values are 8-bits. That means you'll need no less than 3600 bytes of non-volatile storage. If your values are 10-bit (call it 16-bit then) you'll need at least 7200 bytes. No PIC has that much internal EEPROM.

If your program is fairly small and you have leftover flash program memory you could maybe write it there.

I would suggest getting a Microchip 24LC256 EEPROM (256K-bit and around $2.50) or 24LC1024 Flash (1024K-bit and around $7.50) chip. Both have enough space for your project - the 256 is 32K bytes, and the 1024 is 128K bytes. The 256 uses an I2C interface and the 1024 uses SPI. SPI is easier to implement, IMHO.

If you want to run it for longer periods than will fit in the above chips, look at SD cards. They're simple to interface (SPI) and not too difficult to code for. Vast amounts of storage for dirt cheap. :p You can buy a 2GB card for six bucks or less.
 
Top