View previous topic :: View next topic |
Author |
Message |
dnatechnical
Joined: 26 Nov 2009 Posts: 19
|
need help for dspic 30f6010A data eeprom |
Posted: Tue Dec 01, 2009 8:34 am |
|
|
I'm using ide ver 4.068. I'm new for dspic.
Anyone help for writing data eeprom and reading data eeprom.
I'm using function value= read_eeprom(address)
and write_eeprom(address, value)
But it does not work.
Anyone has a code for this?
thank |
|
|
mkuang
Joined: 14 Dec 2007 Posts: 257
|
Re: need help for dspic 30f6010A data eeprom |
Posted: Tue Dec 01, 2009 11:00 am |
|
|
dnatechnical wrote: | I'm using ide ver 4.068. I'm new for dspic.
Anyone help for writing data eeprom and reading data eeprom.
I'm using function value= read_eeprom(address)
and write_eeprom(address, value)
But it does not work.
Anyone has a code for this?
thank |
How about some compilable code, otherwise it could be anything. |
|
|
dnatechnical
Joined: 26 Nov 2009 Posts: 19
|
|
Posted: Tue Dec 01, 2009 12:23 pm |
|
|
if you have any code please send me |
|
|
mkuang
Joined: 14 Dec 2007 Posts: 257
|
|
Posted: Tue Dec 01, 2009 12:26 pm |
|
|
I don't have any code. But you said something doesn't work, which implies you have written a program, try to compile it, and either get a compiler error or when burnt into your PIC the program doesn't work as you intended. |
|
|
dnatechnical
Joined: 26 Nov 2009 Posts: 19
|
|
Posted: Tue Dec 01, 2009 10:50 pm |
|
|
There is no error for compile.
But when I simulate it eeprom doesn't change data. |
|
|
dnatechnical
Joined: 26 Nov 2009 Posts: 19
|
|
Posted: Thu Dec 03, 2009 12:49 am |
|
|
write _eeprom (address, value );
where address is 16bit data
dspic 30f6010 data eeprom start from 0x007ff000 , it 24 or 32 bit
now which instruction is suitable for this device.
anyone can help?
thanks |
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Thu Dec 03, 2009 4:12 pm |
|
|
Download the PCD compiler manual.
http://www.ccsinfo.com/downloads/PCDReferenceManual.pdf
Look in this section on page 291 (page 303 in the Acrobat reader):
The manual says:
Quote: |
write_eeprom (address, value)
Address is the 0 based starting location of the EEPROM write |
Note that you don't put in the physical address of the eeprom.
Just put in a relative address that starts at 0. For example, if you
have 1024 bytes of eeprom in the PIC, then you can use addresses
0 to 1023 (0 to 0x3FF in hex). |
|
|
dnatechnical
Joined: 26 Nov 2009 Posts: 19
|
|
Posted: Fri Dec 04, 2009 1:20 am |
|
|
Thank you.
Its working now.
Its my fault to understand it.
Thank you |
|
|
|