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

M24512 Driver Question

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



Joined: 17 Jan 2006
Posts: 66

View user's profile Send private message

M24512 Driver Question
PostPosted: Mon Oct 16, 2006 9:25 am     Reply with quote

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

View user's profile Send private message

PostPosted: Mon Oct 16, 2006 9:51 am     Reply with 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).

ST does not seem to use this format.
Neckruin



Joined: 17 Jan 2006
Posts: 66

View user's profile Send private message

PostPosted: Mon Oct 16, 2006 10:01 am     Reply with quote

Thank you very much Very Happy
Neckruin



Joined: 17 Jan 2006
Posts: 66

View user's profile Send private message

PostPosted: Mon Oct 16, 2006 11:10 am     Reply with quote

Sad
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

View user's profile Send private message

PostPosted: Mon Oct 16, 2006 11:15 am     Reply with quote

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

View user's profile Send private message

PostPosted: Mon Oct 16, 2006 11:23 am     Reply with quote

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 Confused
Neckruin



Joined: 17 Jan 2006
Posts: 66

View user's profile Send private message

PostPosted: Mon Oct 16, 2006 11:24 am     Reply with quote

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

View user's profile Send private message

PostPosted: Mon Oct 16, 2006 1:23 pm     Reply with quote

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

View user's profile Send private message

PostPosted: Tue Oct 17, 2006 1:22 am     Reply with quote

Thanks PCM, I'll try the original driver and trust on it as far as I can't simulate the memory Sad

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

View user's profile Send private message

PostPosted: Tue Oct 17, 2006 8:18 am     Reply with quote

In the 24512.C driver... what is this line for?:

Code:
#define EEPROM_ADDRESS long int
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Tue Oct 17, 2006 12:05 pm     Reply with quote

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

View user's profile Send private message

PostPosted: Wed Oct 18, 2006 1:37 am     Reply with quote

Ok, thanks for clarifing that issue.
See you PCM Very Happy
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