View previous topic :: View next topic |
Author |
Message |
Neckruin
Joined: 17 Jan 2006 Posts: 66
|
M24512 Driver Question |
Posted: Mon Oct 16, 2006 9:25 am |
|
|
Hello all,
I have found a driver for an 512kbits (64Kbytes) serial EEPROM memory:
http://www.ccsinfo.com/forum/viewtopic.php?t=22587
The problem is that I don't know why, in case the address is higher than 0x7FFF, the author changes the Enable Select bits. Is he selecting another device?
I'm using a M24512 memory from ST and it's supposed (well, I suppose) to have a address range from 0x0000 to 0xFFFF, am I in a mistake?
Thanks in advance,
Neckruin
Last edited by Neckruin on Sun Sep 16, 2018 4:20 am; edited 1 time in total |
|
|
rberek
Joined: 10 Jan 2005 Posts: 207 Location: Ottawa, Canada
|
|
Posted: Mon Oct 16, 2006 9:51 am |
|
|
This driver was written for a Microchip 24 series EEPROM. They have two 256 kbit pages internally and the pages are selected via the MSB of the Chip Select bits (Microchip calls it the Block Select bit).
ST does not seem to use this format. |
|
|
Neckruin
Joined: 17 Jan 2006 Posts: 66
|
|
Posted: Mon Oct 16, 2006 10:01 am |
|
|
Thank you very much |
|
|
Neckruin
Joined: 17 Jan 2006 Posts: 66
|
|
Posted: Mon Oct 16, 2006 11:10 am |
|
|
I have made a very simple example code with the mentioned driver and tried it in Proteus ISIS 6.5 using the M24512 model from its library. Maybe that's not the correct model because it doesn't work.
I'm using FORCE_HW statement in the #use i2c(...) preprocessor directive and conected the SDA and SCL properly: C3 for SCL and C4 for SDA (the tipical)... and it makes nothing at all...
Any suggestion????
Last edited by Neckruin on Sun Sep 16, 2018 4:20 am; edited 1 time in total |
|
|
rberek
Joined: 10 Jan 2005 Posts: 207 Location: Ottawa, Canada
|
|
Posted: Mon Oct 16, 2006 11:15 am |
|
|
I'd review your driver with the ST datasheet in hand. We know of at least one difference in operation between Microship and ST memories, and there could be more. |
|
|
Neckruin
Joined: 17 Jan 2006 Posts: 66
|
|
Posted: Mon Oct 16, 2006 11:23 am |
|
|
Oooooppssss,
I have found out that the M24512 model that is included in the Proteus Libraries is a different model from ST's M24512. The first is a 512 Mbits memory from SGS Thompson and the second one (the one I'm using) is a 512 Kbits mem from STMicroelectronics.
Sorry |
|
|
Neckruin
Joined: 17 Jan 2006 Posts: 66
|
|
Posted: Mon Oct 16, 2006 11:24 am |
|
|
rberek wrote: | I'd review your driver with the ST datasheet in hand. We know of at least one difference in operation between Microship and ST memories, and there could be more. |
As I know, reviewing the datasheet and the code, there are no more differences.
I'll go on investigating.
Thanks. |
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Mon Oct 16, 2006 1:23 pm |
|
|
Quote: |
I have found a driver for an 512kbits (64Kbytes) serial EEPROM memory.
I'm using a M24512 memory from ST. |
CCS has a driver that should be compatible with that EEPROM.
It's called 24512.C and it's in c:\Program Files\Picc\Drivers
Quote: |
This driver was written for a Microchip 24 series EEPROM. They have two
256 kbit pages internally and the pages are selected via the MSB of the
Chip Select bits (Microchip calls it the Block Select bit). |
This architecture is used by the 24LC515.
Apparently, the driver in the Code Library was written for the 24LC515,
but the author didn't say so in his post. So some people mistake it
for a 24LC512 driver.
My recommendation is for the original poster to use the 24512.c driver
in the CCS drivers directory. |
|
|
Neckruin
Joined: 17 Jan 2006 Posts: 66
|
|
Posted: Tue Oct 17, 2006 1:22 am |
|
|
Thanks PCM, I'll try the original driver and trust on it as far as I can't simulate the memory
Thanks again
Last edited by Neckruin on Sun Sep 16, 2018 4:20 am; edited 1 time in total |
|
|
Neckruin
Joined: 17 Jan 2006 Posts: 66
|
|
Posted: Tue Oct 17, 2006 8:18 am |
|
|
In the 24512.C driver... what is this line for?:
Code: | #define EEPROM_ADDRESS long int |
|
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Tue Oct 17, 2006 12:05 pm |
|
|
CCS has an example file called EX_EXTEE.C, that is used to demonstrate
their EEPROM drivers.
The address parameter for smaller eeproms can be held in a byte
(8-bits). For larger eeproms (like the 24LC256), it takes 2 bytes to hold
the address.
CCS only wanted to have one EX_EXTEE.c file. They didn't want to have
two or more versions, just to accomodate eeproms of different sizes.
By putting in that #define statement, they can let the EX_EXTEE.C
program know the size of the address field used by a particular driver.
If you look in EX_EXTEE.c, you'll see many #if and #else statements,
where the example program's code is altered, depending upon whether
the eeprom's address field is one or two bytes.
All this stuff is just so CCS could have only one EX_EXTEE.c example
file. You don't need to worry about it in your own program. |
|
|
Neckruin
Joined: 17 Jan 2006 Posts: 66
|
|
Posted: Wed Oct 18, 2006 1:37 am |
|
|
Ok, thanks for clarifing that issue.
See you PCM |
|
|
|