Electronic Projects, forums and more.

Go Back   Electronic Circuits Projects Diagrams Free > Electronics Categories > Micro Controllers


Micro Controllers Discuss all aspects of micro controllers - building them, coding them, etc. All controllers are welcome - PIC, BASIC, Z8 Encore!, etc.

Reply
 
Thread Tools Display Modes
Old 4th June 2008, 07:43 AM   (permalink)
Default Storage size limit

Hi, I am using the PIC16F690 which came with my PicKit 2 starter kit.

I have programmed the PIC to read from the analogue port and then output a bar display on the C port indicating the percentage of voltage read.

I also want to store the result every 5 minutes. To do this I have converted the voltage to an 8 bit number (which is good enough for me) and what I was going to do was write this to a FIFO store which I could then read from at a later date. However instead of doing that I though I could just keep track of the 5 minute readings internally in an array of bytes in the PIC. The question I have is how big can this get?

The statitistics of the chip show that I have 234 storage locations free of RAM and 3479 free of ROM (not too sure what this means).

Can someone help me out?

Thanks,

Craig
richacm is offline   Reply With Quote
Old 4th June 2008, 08:07 AM   (permalink)
Default

hi Craig,
The 690 has also 256 bytes of EEPROM, in which you could save readings.

The registers [storage locations] which are free could be used as a volatile store.

Its also possible to write/save to the free Flash memory. You called it 'ROM', its the program flash memory area.
__________________
Eric
"Good enough is Perfect"

PIC tutorials:
Gramo's: www.digital-diy.net/
Bill's: www.blueroomelectronics.com/

Last edited by ericgibbs; 4th June 2008 at 08:08 AM.
ericgibbs is online now   Reply With Quote
Old 4th June 2008, 09:55 AM   (permalink)
Default

Quote:
Originally Posted by ericgibbs View Post
hi Craig,
Its also possible to write/save to the free Flash memory. You called it 'ROM', its the program flash memory area.
You can read but not write to it on the 16F690
__________________
Pete
picprojects.org.uk
geko is offline   Reply With Quote
Old 4th June 2008, 12:45 PM   (permalink)
Default

Quote:
Originally Posted by geko View Post
You can read but not write to it on the 16F690
Woops!
You are 'write' of course..
__________________
Eric
"Good enough is Perfect"

PIC tutorials:
Gramo's: www.digital-diy.net/
Bill's: www.blueroomelectronics.com/
ericgibbs is online now   Reply With Quote
Old 4th June 2008, 08:48 PM   (permalink)
Default

Thanks for the replies.

So I can write to the EEPROM correct? That's not the ROM eh.

I saw some samples of accessing the EEPROM but it was a bit confusing for me. Can someone show me a peice of code that will write/read to the EEPROM 1 byte of data. I want it to be like a FIFO store so after each 5 minutes I will add a byte to the EEPROM. Then I am going to keep checking the AN1 input and when this goes high I will read and remove the items from the EEPROM in a FIFO manner. I will keep an index pointed to indicate where I am in the EEPROM so its really just a case of how do I write/read data from the EEPROM and what location can I write to?

Cheers everyone,

Craig
richacm is offline   Reply With Quote
Old 4th June 2008, 09:04 PM   (permalink)
Default

Page 108 of the 16F690 datasheet.
__________________
Bill
Smart Kits build Smart People

http://www.blueroomelectronics.com
blueroomelectronics is offline   Reply With Quote
Old 4th June 2008, 10:16 PM   (permalink)
Default

Yeah I read that - that's what kind of confused me since I am programming in microBasic.

I did find a library that writes it though EEprom_write and EEprom_read so all is good. For the PIC16F690 I can only write up to FFh as that is the 255 spaces allocated - correct?

Thanks,

Craig
richacm is offline   Reply With Quote
Old 4th June 2008, 10:28 PM   (permalink)
Default

Quote:
Originally Posted by richacm View Post
I did find a library that writes it though EEprom_write and EEprom_read so all is good. For the PIC16F690 I can only write up to FFh as that is the 255 spaces allocated - correct?
If you're going to be programming, you should learn hexadecimal. It's not difficult, and it's used all the time in programming because it makes many things just SO much simpler.

Yes, $ff hex = 255 decimal = 11111111 binary.
__________________
=========================
Futz's Microcontrollers & Robotics
=========================
futz is offline   Reply With Quote
Old 4th June 2008, 10:34 PM   (permalink)
Default

Yeah I know Hex - the question was is the limit I can write to in the EEPROM FF?, i.e. 255 locations.

Cheers,

Craig
richacm is offline   Reply With Quote
Old 5th June 2008, 01:52 AM   (permalink)
Default

Quote:
Originally Posted by richacm View Post
Yeah I know Hex - the question was is the limit I can write to in the EEPROM FF?, i.e. 255 locations.

Cheers,

Craig
Yes, it's on page 3 of the datasheet.
__________________
Bill
Smart Kits build Smart People

http://www.blueroomelectronics.com
blueroomelectronics is offline   Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Latest
How to limit current ? rcmeca Electronic Projects Design/Ideas/Reviews 6 3rd November 2006 09:43 PM
Tables data - size limit kenmac Micro Controllers 7 8th April 2006 02:21 PM
Avatar size limit zachtheterrible Feedback/Comments 3 8th March 2005 01:28 PM
Best / simplest way to limit voltage Scarr General Electronics Chat 4 28th September 2004 08:57 AM
current limit SupeR-NovA General Electronics Chat 13 17th March 2004 12:21 PM



All times are GMT. The time now is 08:42 AM.


Electronic Circuits  |  Electronics Wiki
Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.