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

Battery check - missing values when writing on EEPROM
Goto page Previous  1, 2
 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
DragonPIC



Joined: 11 Nov 2003
Posts: 118

View user's profile Send private message

PostPosted: Fri Apr 15, 2005 1:11 pm     Reply with quote

Idea Or maybe you can write a book "Getting help through forums for dummies"

OK, I'll stop now.
_________________
-Matt
Irritated
Guest







To Mr DragonPic
PostPosted: Sat Apr 16, 2005 2:45 am     Reply with quote

Do us all a favour and get lost. Your comments are uncalled for and add no value to this list. If you have nothing relevant to say regarding the topic at hand then keep quit. Now go and play with your lego blocks.

I think that Darren should give this person a warning...
global



Joined: 01 Feb 2005
Posts: 21
Location: Paris

View user's profile Send private message

PostPosted: Mon Apr 18, 2005 2:17 am     Reply with quote

Idea Question

Last edited by global on Fri May 13, 2005 3:55 am; edited 1 time in total
global



Joined: 01 Feb 2005
Posts: 21
Location: Paris

View user's profile Send private message

PostPosted: Mon Apr 18, 2005 2:26 am     Reply with quote

However i read this in the datasheet and someone on maxim helped me saying this :

Quote:
When you write to EEPROM addresses it stores
the written byte in shadow RAM. The copy EEPROM
command must then be used to store the values
im EEPROM memory.


This is my code for copy the eeprom that are than copied in addresses : 0x20 to 0x2F :

Code:

void Copy_memory(int8 address)
{
   if(!Reset())
   {
   WriteByte(0xCC);    // SkipNetAdress Command
   WriteByte(0x48);    // Copy command
   WriteByte(address); // address to copy
   }
}


I a m not really sure how to copy the eeprom, can i copy a value of an address to the user eeprom that i want ?
For example, if i copy the value at address 0x10, can i choose to copy it at address 0x20? Or is it automaticly increment at this first address ?
I know maybe i could copy a block.
Could the groupe help me to get this function ok ?
I think i may need to get the RECALL EEPROM function as well.

Thanks for your help.
DragonPIC



Joined: 11 Nov 2003
Posts: 118

View user's profile Send private message

Re: To Mr DragonPic
PostPosted: Tue Apr 19, 2005 12:22 pm     Reply with quote

To Irritated:

My comments were not posted to insult anyone. Maybe just to point out that improvments might help. If you have noticed, most of this post has been a posting lesson for global and many people come to this forum who make exactly the same mistakes.
_________________
-Matt
global



Joined: 01 Feb 2005
Posts: 21
Location: Paris

View user's profile Send private message

PostPosted: Wed Apr 20, 2005 1:47 am     Reply with quote

Ok,
i use now the software that is with the development kit : it is the DS2780K that you can find a application note here : http://www.maxim-ic.com/appnotes.cfm/appnote_number/3463
Some values are correct others are not, i'll try to find out why it is not working, but i think it is because i do not have donc the copy of the shadow ram to the eeprom.

Please, could someone of the group tell me how to write this function correctly ?

I know there is a function that recalls the data, but i don't think this is important as the copy function as far as i get now ... Maybe not.

If someone had ever use these function to use shadow ram and eeprom it would be great.

Thanks.
DragonPIC



Joined: 11 Nov 2003
Posts: 118

View user's profile Send private message

PostPosted: Thu Apr 21, 2005 10:22 am     Reply with quote

I think you are on the right track here.

Code:
void Copy_memory(int8 addressS, int8 addressD)
{
   if(!Reset())
   {
   WriteByte(0xCC);    // SkipNetAdress Command
   WriteByte(0xB8);    // Recall from source command
   WriteByte(addressS); // address of source data
   WriteByte(0xCC);    // SkipNetAdress Command <-- must you send the SkipNetAddress before every command?
   WriteByte(0x48);    // Copy command
   WriteByte(addressD); // destination address
   }
}


Recall loads data from source address into shadow ram. Copy stores the data recalled into destination address. I think the auto incrementing is only for the read and write commands.
_________________
-Matt
Irritated
Guest







Your last posting should have read...
PostPosted: Thu Apr 21, 2005 2:19 pm     Reply with quote

I am sorry for making sarcastic remarks and I won't do it again.
DragonPIC



Joined: 11 Nov 2003
Posts: 118

View user's profile Send private message

PostPosted: Thu Apr 21, 2005 2:33 pm     Reply with quote

Laughing I understand.....

BTW, I like playing with LEGO blocks.....
_________________
-Matt
global



Joined: 01 Feb 2005
Posts: 21
Location: Paris

View user's profile Send private message

PostPosted: Mon Apr 25, 2005 6:11 am     Reply with quote

I found out, after writting you must copy the block1 from the shadow ram to the eeprom.

This is working Wink
global



Joined: 01 Feb 2005
Posts: 21
Location: Paris

View user's profile Send private message

PostPosted: Fri May 13, 2005 9:32 am     Reply with quote

Hello,

I found the way to do read all, it is ok the lonly thing left is that when i try write on register 0x10, 0x11 et 0x14, i can't read CURRENT, that i can read when disabling the writtings of these registers :

Code:
      printf("\nDS2780_RAAC_MSB = %2X", Read_memory_ds2780(0x02));
      printf("\nDS2780_RAAC_LSB = %2X", Read_memory_ds2780(0x03));
      printf("\nDS2780_RSAC_MSB = %2X", Read_memory_ds2780(0x04));
      printf("\nDS2780_RSAC_LSB = %2X", Read_memory_ds2780(0x05));
      printf("\nDS2780_RARC = %2X", Read_memory_ds2780(0x06));
      printf("\nDS2780_RSRC = %2X", Read_memory_ds2780(0x07));
      printf("\nDS2780_IAVG_MSB = %2X", Read_memory_ds2780(0x08));
      printf("\nDS2780_IAVG_LSB = %2X", Read_memory_ds2780(0x09));
      printf("\nDS2780_TEMP_MSB = %2X", Read_memory_ds2780(0x0A));
      printf("\nDS2780_TEMP_LSB = %2X", Read_memory_ds2780(0x0B));
      printf("\nDS2780_VOLT_MSB = %2X", Read_memory_ds2780(0x0C));
      printf("\nDS2780_VOLT_LSB = %2X", Read_memory_ds2780(0x0D));
      printf("\nDS2780_CURRENT_MSB = %2X", Read_memory_ds2780(0x0E));
      printf("\nDS2780_CURRENT_LSB = %2X", Read_memory_ds2780(0x0F));
      printf("\nDS2780_ACR_MSB = %2X", Read_memory_ds2780(0x10));
      printf("\nDS2780_ACR_LSB = %2X", Read_memory_ds2780(0x11));
      printf("\nDS2780_ACRL_MSB = %2X", Read_memory_ds2780(0x12));
      printf("\nDS2780_ACRL_LSB = %2X", Read_memory_ds2780(0x13));
      printf("\nDS2780_AS = %2X", Read_memory_ds2780(0x14));
      printf("\nDS2780_FULL_MSB = %2X", Read_memory_ds2780(0x16));
      printf("\nDS2780_FULL_LSB = %2X", Read_memory_ds2780(0x17));


Code:
byte Read_memory_ds2780(byte address)
{  byte data = 0;
   //if(!Reset_ds2780())
   {
   Reset_ds2780();
   WriteByte_ds2780(0xCC);    // SkipNetAdress Command
   WriteByte_ds2780(0x69);    // read command
   WriteByte_ds2780(address); // registerAddress
   data = ReadByte_ds2780();
   }return data;
}


Why do you think it is not working ? Is there any delay to put ?
global



Joined: 01 Feb 2005
Posts: 21
Location: Paris

View user's profile Send private message

PostPosted: Thu May 19, 2005 6:04 am     Reply with quote

Hello,

I still can't read the CURRENT register in 0x0E and 0x0F properly.

In the datasheet there is something pretty much like this :

Quote:
You must write the MSByte and LSByte within a 3.515 second period, then the ACRL will be cleared and current accumulation will not begin again until another 3.515 second period has elapsed.


After writting to the ACR,I putted a delay_ms(4000) to be sure that the 3.515 secondes are reached but no way.

When i put this writting in commentary, it gives 00.

There a are only these 2 register that i can't read and the current average as well but it seems because of i can't read the current that won't have to good average.

Does someone have an idea ?
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Goto page Previous  1, 2
Page 2 of 2

 
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