|
|
View previous topic :: View next topic |
Author |
Message |
sliders_alpha
Joined: 03 Mar 2008 Posts: 55
|
writing in rom, 16f876a |
Posted: Sun Apr 19, 2009 2:41 am |
|
|
hi,
I must design a mother clock for my graduation project.
In this clock I must store a bi-dimensional array array[100][2]
and this array must be editable through a computer with an RS-232 link.
Is there a way to write in rom? Because I won't have enough space in ram.
Thanks
ps : Also there was a special thing do to to make CCS use all the ram and rom, I think it was adding a "=*" somewhere, but I can't remember. _________________ yup, i know, i don't speak english very well
CCS V4.057 |
|
|
Ttelmah Guest
|
|
Posted: Sun Apr 19, 2009 8:31 am |
|
|
It'd help if you said how large the array _elements_ are. Single bytes would only involve 200 bytes, but if these are float values for example, it will get more complex...
If it is only bytes, then simply consider using the EEPROM (which is better designed for anything that changes even relatively 'infrequently'), and 'encapsulate' the routines, so you have something like:
Code: |
read_array(x,y) read_eeprom(x+(y*100))
write_array(x,y,val) write_eeprom(x+(y*100),val)
|
and use these instead of the 'normal' array access functions.
#device *=16
Near the top of your code, after the include for the procssor file
Best Wishes |
|
|
sliders_alpha
Joined: 03 Mar 2008 Posts: 55
|
|
Posted: Sun Apr 19, 2009 12:06 pm |
|
|
Well, it's even bigger now.
My mother clock must be able to trigger siren in 4 different area
(so I've planned to make 4 array).
Duration and ring type are stored in one byte.
Trigger hour in one byte
and trigger minutes in one byte.
So I've come up with this:
Code: |
typedef struct
{
int8 hours; // 0 a 23
int8 minutes; // 0 a 59
int8 data; //0 a 255
}SirenData;
|
and I've made 4 struct-array:
Code: |
SirenData AreaOne[12];
SirenData AreaTwo[12];
SirenData AreaThree[12];
SirenData AreaFour[12];
|
But even with only 12 trigger it's too big for everything else (GPS-managment, graphic LCD var, etc).
Quote: |
then simply consider using the EEPROM
|
I didn't know I could do that, I'm going to look this, thanks. _________________ yup, i know, i don't speak english very well
CCS V4.057 |
|
|
|
|
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
|