View previous topic :: View next topic |
Author |
Message |
global
Joined: 01 Feb 2005 Posts: 21 Location: Paris
|
Battery check - missing values when writing on EEPROM |
Posted: Fri Apr 08, 2005 1:10 am |
|
|
Hello, i use a DS2780 Stand-Alone Fuel Gauge IC to check my battery.
I only read the data with my programm and i get this :
Quote: |
DS2780_STATUS = 07
DS2780_RAAC_MSB = 00
DS2780_RAAC_LSB = 00
DS2780_RSAC_MSB = 00
DS2780_RSAC_LSB = 00
DS2780_RARC = 38
DS2780_RSRC = 38
DS2780_IAVG_MSB = FF
DS2780_IAVG_LSB = 79
DS2780_TEMP_MSB = 18
DS2780_TEMP_LSB = 00
DS2780_VOLT_MSB = 5F
DS2780_VOLT_LSB = A0
DS2780_CURRENT_MSB = FF
DS2780_CURRENT_LSB = 7F
DS2780_ACR_MSB = 47
DS2780_ACR_LSB = DF
DS2780_ACRL_MSB = 7A
DS2780_ACRL_LSB = 30
DS2780_AS = 80
DS2780_SFR = 32
DS2780_FULL_MSB = 80
DS2780_FULL_LSB = 00
DS2780_AE_LSB = 00
DS2780_AE_MSB = 00
DS2780_SE_LSB = 00
DS2780_SE_MSB = 00
DS2780_EEPROM = 30
|
Do you think these values are correct ? It seems that they look typical but i need to confirm. Some are zero is that normal ?
Anyway when i add simples lines about the writting and reading on the EEPROM, it seems that some values are 00.
Could someone tell me what' wrong when i write on th EEPROM because some values are missing ?
Thanks a lot ! |
|
|
global
Joined: 01 Feb 2005 Posts: 21 Location: Paris
|
|
Posted: Wed Apr 13, 2005 9:51 am |
|
|
Last edited by global on Fri May 13, 2005 3:54 am; edited 4 times in total |
|
|
global
Joined: 01 Feb 2005 Posts: 21 Location: Paris
|
|
Posted: Wed Apr 13, 2005 9:52 am |
|
|
Last edited by global on Thu Apr 14, 2005 1:25 am; edited 1 time in total |
|
|
global
Joined: 01 Feb 2005 Posts: 21 Location: Paris
|
|
Posted: Wed Apr 13, 2005 9:53 am |
|
|
Last edited by global on Thu Apr 14, 2005 1:26 am; edited 1 time in total |
|
|
Humberto
Joined: 08 Sep 2003 Posts: 1215 Location: Buenos Aires, La Reina del Plata
|
|
Posted: Wed Apr 13, 2005 11:44 am |
|
|
Hi global,
It is not easy to help you if:
1. You donīt post the full relevant code info that demostrate your
problem and that we can compile.
2. We doesnīt know what microcontroller are you using.
3. We doesnīt know your hardware.
Quote: |
Could someone tell me what' wrong when i write on th EEPROM because
some values are missing ?
|
4. We doesnīt know wich EEPROM you are talknig about, the PIC or the DS2780 EEPROM.
Humberto |
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Wed Apr 13, 2005 11:54 am |
|
|
The reason no one replied is because of the nebulous nature of your post.
You post a bunch of register values for some chip that we probably
haven't used, and then say, well, does anyone think these are correct ?
Well, I don't know.
Essentially, you're asking us to download the data sheet, study it in
detail, look up the default values of those registers, do an eyeball
comparsion of all the hex values, and then make a pronouncement
of their correctness or lack thereof.
Probably most people don't want that assignment. |
|
|
newguy
Joined: 24 Jun 2004 Posts: 1908
|
|
Posted: Wed Apr 13, 2005 12:06 pm |
|
|
PCM programmer wrote: | Probably most people don't want that assignment. |
Unless it pays. And well. |
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Wed Apr 13, 2005 12:43 pm |
|
|
To add something more constructive to my post, here would be a
better way to ask your question:
"I am trying to write a driver for chip XXXX. When I write to certain
registers, I always read back a 0. I have studied the data sheet and
it says these registers are fully readable and writable on all bits.
There is no write-protection as far as I can see. I have studied similar
drivers provided by CCS, and I believe my driver should work.
However, it doesn't, so can the group please look at my code ?"
And then, you should provide a test program that just writes and reads
to one register. Show all the routines necessary to do that.
In other words, keep your question very focused. If you do that, you
will attract far more people to your post, than otherwise. People like
to look at problems that they can solve in 5 minutes or less.
We might spend more time than that in some cases if the problem is
very interesting, but most driver problems can be narrowed down to
a few lines of code. |
|
|
global
Joined: 01 Feb 2005 Posts: 21 Location: Paris
|
|
Posted: Thu Apr 14, 2005 1:49 am |
|
|
Hello group,
Sorry if i wasn't clear at all !
I posted my code.
I use a DS2780 Stand-Alone Fuel Gauge IC to check my battery.
I use a PIC 18LF458.
I use read and write functions on the DS2780 EEPROM, not on the PIC.
I just wanted to know if there were someone who used components like the DS2780 or DS2770 to read a battery's level, capacity for example.
My question is also focused on this :
when i read using the function Read_memory that is simply reading all the registers available on MEMORY on the DS2780 giving battery features, it is ok.
No trouble as well using the write_eeprom function to write in the EEPROM of the DS2780, it is working.
But when i use the function Write_memory, i can't get data that were available when using Read_memory, it seems that i can't Write_memory and Read_memory without having some returned data 00.
Is it because when i write i change data that will have an impact on the read data ?
Or is it because is miss something ( a delay or something else) between the 2 functions ?
Maybe my functions are wrong ...
I hope i am more clearer, thanks for your pieces of advice !
Can the group please look at my code ? |
|
|
global
Joined: 01 Feb 2005 Posts: 21 Location: Paris
|
|
Posted: Thu Apr 14, 2005 7:11 am |
|
|
I found this which is exactly what i needed, there are some values to compare with what i was supposed to have.
http://www.maxim.de/appnotes.cfm/appnote_number/3463
I solved the problem adding delay_ms(500) in the Read_memory function before returning data. It seems that the missing values are there now =).
When i try to read the EEPROM on the DS2780, it returns 0xFF for some of them ...
Otherwise some are 0x00 on the DS2780 memory ...
I think i may have some troubles with some delays in my code as well if anyone of the group could help me ... |
|
|
global
Joined: 01 Feb 2005 Posts: 21 Location: Paris
|
|
Posted: Fri Apr 15, 2005 3:56 am |
|
|
I forgot this is the datasheet :
http://pdfserv.maxim-ic.com/en/ds/DS2780.pdf
Parameters that are interresting for me are page 19 and 20.
And most importants are in this MEMORY MAP.
Many Thanks.
These are my results, as you can see some are 00 :
Quote: | DS2780_RAAC_MSB = 00\0A
DS2780_RAAC_LSB = 00\0A
DS2780_RSAC_MSB = 00\0A
DS2780_RSAC_LSB = 00\0A
DS2780_RARC = 38\0A
DS2780_RSRC = 38\0A
DS2780_IAVG_MSB = 00\0A
DS2780_IAVG_LSB = 00\0A
DS2780_TEMP_MSB = 18\0A
DS2780_TEMP_LSB = 00\0A
DS2780_VOLT_MSB = 5F\0A
DS2780_VOLT_LSB = 00\0A
DS2780_CURRENT_MSB = FF\0A
DS2780_CURRENT_LSB = 6E\0A
DS2780_ACR_MSB = 47\0A
DS2780_ACR_LSB = DF\0A
DS2780_ACRL_MSB = F6\0A
DS2780_ACRL_LSB = D0\0A
DS2780_AS = 80\0A
DS2780_SFR = 32\0A
DS2780_FULL_MSB = 80\0A
DS2780_FULL_LSB = 00\0A
DS2780_AE_LSB = 00\0A
DS2780_AE_MSB = 00\0A
DS2780_SE_LSB = 00\0A
DS2780_SE_MSB = 00\0A
DS2780_EEPROM = 30\0A
|
|
|
|
global
Joined: 01 Feb 2005 Posts: 21 Location: Paris
|
|
Posted: Fri Apr 15, 2005 7:22 am |
|
|
Last edited by global on Fri May 13, 2005 3:54 am; edited 1 time in total |
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Fri Apr 15, 2005 11:38 am |
|
|
This program is too complicated to show your problem.
It has 10 million printf statements.
You said you have a problem with writing to EEPROM.
Pick one EEPROM address that has a problem.
Write a test program that writes and reads to that ONE address.
Then post that program. Tell us the value that you read.
If you post a small program as I have described, then maybe
we have a chance to help you. |
|
|
Humberto
Joined: 08 Sep 2003 Posts: 1215 Location: Buenos Aires, La Reina del Plata
|
|
Posted: Fri Apr 15, 2005 12:14 pm |
|
|
I guess that you canīt get any help regarding this matter because nobody
use/has the DS2780 chip and canīt test the DS2780 EEPROM r/w problems.
Humberto |
|
|
DragonPIC
Joined: 11 Nov 2003 Posts: 118
|
|
Posted: Fri Apr 15, 2005 1:08 pm |
|
|
We should save this post and lock it on top of the dicussion page with the Annoucement with the title "YOU NEW? PLEASE READ".
PCM programmer giving lessons on how to post. _________________ -Matt |
|
|
|