Jump to content
IGNORED

Eeprom support added to cc65 for 93C46, 93C66 and 93C86 chips


karri

Recommended Posts

I spent some time to integrate Sage's EEPROM drivers into the daily snapshot of cc65.

 

You should now be able to use any of these chips in your code.

 

93c46 - a 128 byte eeprom

93c66 - a 512 byte eeprom

93c86 - a 2048 byte eeprom

 

In order to make the use a bit easier for programmers I suggest to add this to the config file:

 

SYMBOLS {
   _lynx_eeread: type = export, value = _lynx_eeread_93c86;
   _lynx_eewrite: type = export, value = _lynx_eewrite_93c86;
}

 

In the file lynx.h I have already declared the routines like:

unsigned _fastcall_ lynx_eeread(unsigned addr);
void _fastcall_ lynx_eewrite(unsigned addr, unsigned val);

 

You can also use the right routine directly like:

 

lynx_eewrite_93c86(1023, 0xffff);

 

But if you add the symbol in the config file you can write:

 

lynx_eewrite(1023, 0xffff);

 

and then just link in the right driver by changing the data in the config file.

 

The old eeprom used to be similar to the 93c46. That is a 128 byte eeprom. But in the old days you also needed a separate erase-command to set the 0-bits back to 1-bits. This is now history. But for old eeprom designs there is still the old eeprom driver also. It has commands like lynx_eeprom_read, lynx_eeprom_write, lynx_eeprom_erase.

 

--

Regards,

 

Karri

Link to comment
Share on other sites

Actually, as teh command are the same for 56 and 66 and 76 and 86 you should also be able to access these.

 

93c46 - a 128 byte eeprom

 

93c66 - a 512 byte eeprom (and 93c56 - a 256 byte eeprom)

 

93c86 - a 2048 byte eeprom (and 93c76 - a 1024 byte eeprom)

Link to comment
Share on other sites

  • 1 month later...

Please read the datasheet for 93C56 and 93C76 before using.

 

There are 2 different adress methodes for this chips.

 

93C56 is in most case same addressing as 93C66. But i know there is a 93C56 with different adressing.

Same maybe for 93C76.

 

In case you use this chips read the datasheet before using.

 

Or feel free to contact me.

Link to comment
Share on other sites

  • 1 year later...

Just to revive this thread, as there were questions regarding EEPROM support for emulation:

 

With the following code ouy can check the functionality of an eeprom (at least the ones supported / tested by me):

 

hmmm i hate these "You aren't permitted to upload this kind of file" messages... i will put the binary for download on my developers site.

 

these attachment rules seems to completly junk, one cannot attach anything, neigther source code no compiled binary.

Edited by sage
Link to comment
Share on other sites

Is your site's home page still OK? It seems the last bullit might contain this program/code is incomplete.

 

had some problems updating the files one the site, seems some files go corrupted

 

but now oit should be o.k.

 

but i did not put the source files up, anyway they should be in my newcc lib, maybe i also did some bll version of the libs, dont remember right now.

Link to comment
Share on other sites

If the check procedure is simple I could add it as a front end to the cc65 eeprom suite. Then you could have a function that returns the size of the eeprom and can handle any size automatically. You would not have to include drivers for all sizes but that could be an option.

 

Is this ok for you?

Link to comment
Share on other sites

One problem with that is that you'd need to link all the functions for all EEPROMs (or better yet, load the proper one from the cart), but typically you are going to know the target hardware arent' you?

 

Anyway, if you do implement a check procedure, put it in the STARTUP segment so it can be overwritten with something else later after it's used, or a constructor maybe? Probably preaching to the choir here... :)

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...