CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to CCS Technical Support

16bit arrays, and filling them from e2.

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
newtotheart



Joined: 10 Jan 2006
Posts: 4
Location: Derbyshire

View user's profile Send private message Send e-mail AIM Address MSN Messenger

16bit arrays, and filling them from e2.
PostPosted: Wed Feb 01, 2006 5:58 am     Reply with quote

Hi guy's, first off, this board has helped no end with various projects i have started working on so keep up the good work.

Right, i am working on a project where essentially a simcard with a pic on is inserted into a programmer. Instead of it being a boot loader device, it simply writes data to eeprom locations and leaves the program memory untouched. Then function transfers the data from ROM to RAM into two 16bit x 16 arrays. This subsequently is a huge chunk of ram taken by these arrays. Is there a way I can just generate an .asm file from PCWH? Then I can use the free tools provided by microchip to link a data table to the original .asm, thus reducing ram overhead.

If that is not possible then I really need try and save on ram overhead. By creating a 16bit x 16 array, then trying to fill the array from EEPROM memory, the first thing that pops into my head is to use the MAKE16(); function shipped with CCS C. Is this needed? If I structure the EEPROM


( 1 6 B I T I N T ) ( 1 6 B I T I N T )
(high byte, low byte) (high byte, low byte).....

What is the best way to get the high byte and low byte to a 16bit array location? So far ive came up with whats below, but please if you know of another easier way, please tell!!!

arrayname[0];

EEPROM_HIGH; variables containing the high byte of the eeprom
EEPROM_LOW; and low byte of the eeprom.

could I then do this?


for (i=0; i<16; i++){
arrayname[i] = MAKE16(EEPROM_HIGH, EEPROM_LOW);
getnexteeprom(i); //function for updating eeprom HIGH/LOW
}


Also does anyone know the access times of the eeprom? All i'm doing is reading, nothing else.

Any help with this would be greatly appreciated, thanks

Dave
treitmey



Joined: 23 Jan 2004
Posts: 1094
Location: Appleton,WI USA

View user's profile Send private message Visit poster's website

PostPosted: Wed Feb 01, 2006 9:13 am     Reply with quote

To address the last question. For us(or YOU) to find the access time, we need to know the chip your using.
Then we go to someplace(i go to digikey)
http://www.digikey.com/
Look up the part, and then it has the spec sheet. Inside the spec sheet has the magical access time you are looking for.

We can't do this for you because we don't know the chip.
newtotheart



Joined: 10 Jan 2006
Posts: 4
Location: Derbyshire

View user's profile Send private message Send e-mail AIM Address MSN Messenger

lol...sorry about being lazy.
PostPosted: Wed Feb 01, 2006 9:53 am     Reply with quote

I am working with at the min the 12f683. This I will be running at 20MHz but obviously after its /4, program execution will be 5MHz. To cut a very long story short, i'm looking to read the eeprom at 6 different addresses (3x16byte constants), and compare these value's with what timer1 stopped at. Then do some other math which calculates delay times. However I have approx 6024 program cycles to do the calculations in.

Also do you know how I can go about generating a straight forward .asm from ccs c? Or am I going to have to edit the .list?

Thanks again
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
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