+karri Posted December 22, 2020 Share Posted December 22, 2020 32 minutes ago, Nop90 said: Before changing the driver, better test if the problem is the delay. Added a delay of 1 second (an extremely looong time for such a device) betwen write and read. E2test.lnx 9.31 kB · 1 download BYTE WRITE OK BYTE R/W DONE DATA CHECK PASSED VALUE 128 SECTOR R/W DONE DATA CHECK FAILED BLOCK READ CHECK OK Quote Link to comment https://forums.atariage.com/topic/313609-driver-for-24aaxxx-eepprom-mounted-on-karris-carts/page/5/#findComment-4705568 Share on other sites More sharing options...
Nop90 Posted December 22, 2020 Author Share Posted December 22, 2020 Ok, so we only need to add a delay. The error in the page read is because there isn't a delay after the page write. The last block read reads the same data of the previous call, so if it went ok, the data is there. I'll modify the driver to return the no ACK when reading, so the code can get it and retry. With this last change we should have what we need to start experimenting with the new eepprom. The driver code is not optimized (I made things easy to debug), I will optimize it to be a lot faster when I have the cart to test the new code. I also have to check if my eeprom emulator maintains internally the correct address after every funcion call, and to do this I have to compare the behaviour with a real eeprom. 1 Quote Link to comment https://forums.atariage.com/topic/313609-driver-for-24aaxxx-eepprom-mounted-on-karris-carts/page/5/#findComment-4705591 Share on other sites More sharing options...
+karri Posted December 22, 2020 Share Posted December 22, 2020 Sounds great! I have already started on my holodeck-code and will be running eeprom stuff from the start. Quote Link to comment https://forums.atariage.com/topic/313609-driver-for-24aaxxx-eepprom-mounted-on-karris-carts/page/5/#findComment-4705621 Share on other sites More sharing options...
+karri Posted December 22, 2020 Share Posted December 22, 2020 Perhaps it needs a few idle clock cycles between operations? Quote Link to comment https://forums.atariage.com/topic/313609-driver-for-24aaxxx-eepprom-mounted-on-karris-carts/page/5/#findComment-4705684 Share on other sites More sharing options...
Nop90 Posted December 22, 2020 Author Share Posted December 22, 2020 I could add a delay after the write commands, but why waste time that could be sed for other things? The delay should be added in the calling code if the program has nothing else to do meanwhile. Quote Link to comment https://forums.atariage.com/topic/313609-driver-for-24aaxxx-eepprom-mounted-on-karris-carts/page/5/#findComment-4705842 Share on other sites More sharing options...
Nop90 Posted December 22, 2020 Author Share Posted December 22, 2020 I propose these changes: unsigned char __fastcall__ lynx_eeread_24aa512(unsigned char *val, unsigned int addr); unsigned char __fastcall__ lynx_eereadnext_24aa512 (unsigned char *val, ); this way all the functions return the same error code (0 = OK, 1 = KO). After a write it's possible to use a while loop for the next EEPROM access (read or write) to wait the EEPPROM ACK: while(lynx_eeread_24aa512 (&content,0)); This is exactly the process proposed in the datasheet. The only thing to remind is that whitout a 24AA eeprom this while loop is blocking, so it should not be used with the first read to the eeprom. The updated driver code is: eeprom64k.s and the new test rom (with sources) using these while loop instead of the delay: E2test.lnx E2test.zip @karri if you like the last changes we can consider the driver interface final. Note: my emulator eeprom code doesn't have any writing delay after a write, so writing to the eeprom and then reading from it without a delay can be used to detect the emulator (with a real EEPROM the read will fail). It's a trivial thing to fix in the emulator code, but I bet no one will ever do it ? Quote Link to comment https://forums.atariage.com/topic/313609-driver-for-24aaxxx-eepprom-mounted-on-karris-carts/page/5/#findComment-4706066 Share on other sites More sharing options...
+karri Posted December 23, 2020 Share Posted December 23, 2020 8 hours ago, Nop90 said: I propose these changes: unsigned char __fastcall__ lynx_eeread_24aa512(unsigned char *val, unsigned int addr); unsigned char __fastcall__ lynx_eereadnext_24aa512 (unsigned char *val, ); this way all the functions return the same error code (0 = OK, 1 = KO). After a write it's possible to use a while loop for the next EEPROM access (read or write) to wait the EEPPROM ACK: while(lynx_eeread_24aa512 (&content,0)); This is exactly the process proposed in the datasheet. The only thing to remind is that whitout a 24AA eeprom this while loop is blocking, so it should not be used with the first read to the eeprom. The updated driver code is: eeprom64k.s 9.8 kB · 1 download and the new test rom (with sources) using these while loop instead of the delay: E2test.lnx 9.37 kB · 1 download E2test.zip 31.57 kB · 1 download @karri if you like the last changes we can consider the driver interface final. Note: my emulator eeprom code doesn't have any writing delay after a write, so writing to the eeprom and then reading from it without a delay can be used to detect the emulator (with a real EEPROM the read will fail). It's a trivial thing to fix in the emulator code, but I bet no one will ever do it ? Wonderful! Thanks! 1 Quote Link to comment https://forums.atariage.com/topic/313609-driver-for-24aaxxx-eepprom-mounted-on-karris-carts/page/5/#findComment-4706391 Share on other sites More sharing options...
Nop90 Posted December 23, 2020 Author Share Posted December 23, 2020 This EEPROM has a I2C interface, and with "almost" the same code we can control every device with a I2C communication protocol. Up to 8 can cohesist setting different addresses on the same bus (this eeprom uses address 0). I had some crazy ideas: - hardmod the lynx with a capacitive 4.5 inch touchscreen - add a keyboard like this . Could be connected to a special cart with a back connector, and on the cart a Basic interpreter that can store programs on the 64kB eeprom - add an accelerometer chip like this (can be on the cart) to make a game controlled moving the lynx Quote Link to comment https://forums.atariage.com/topic/313609-driver-for-24aaxxx-eepprom-mounted-on-karris-carts/page/5/#findComment-4706965 Share on other sites More sharing options...
Fadest Posted December 24, 2020 Share Posted December 24, 2020 8 hours ago, Nop90 said: - add an accelerometer chip like this (can be on the cart) to make a game controlled moving the lynx This is probable what @vince did with his Ouragan cartridge prototype, a 3D Tempest clone played via an accelerometer on cartridge. @vince, how did you interface it ? Quote Link to comment https://forums.atariage.com/topic/313609-driver-for-24aaxxx-eepprom-mounted-on-karris-carts/page/5/#findComment-4707289 Share on other sites More sharing options...
Nop90 Posted December 24, 2020 Author Share Posted December 24, 2020 On 5/2/2012 at 8:13 AM, vince said: The accelerometer is on the cartridge, in order to access it the communication is made with SPI protocol. This protocol is also used for the eeprom access. Found a 2012 post about it: different protocol but same idea Quote Link to comment https://forums.atariage.com/topic/313609-driver-for-24aaxxx-eepprom-mounted-on-karris-carts/page/5/#findComment-4707306 Share on other sites More sharing options...
+karri Posted December 24, 2020 Share Posted December 24, 2020 The cart I sent you also has some extra pins on the back side for connecting to strange stuff. Like my prototype to blink a 3-colour LED in blue/white in "Shaken, not stirred" while you are driving. And flash red when are shot. The silly idea was to use the LED for ambient lighting to get a better gaming experience. 1 1 Quote Link to comment https://forums.atariage.com/topic/313609-driver-for-24aaxxx-eepprom-mounted-on-karris-carts/page/5/#findComment-4707354 Share on other sites More sharing options...
Nop90 Posted December 28, 2020 Author Share Posted December 28, 2020 I read on @Igor twitter page that he is using a cart with a 3 wires 1KB eeprom chip instead of the usual 128B one. Does it use the same driver of the 128B eeprom or a modified one? Quote Link to comment https://forums.atariage.com/topic/313609-driver-for-24aaxxx-eepprom-mounted-on-karris-carts/page/5/#findComment-4710275 Share on other sites More sharing options...
Igor Posted December 28, 2020 Share Posted December 28, 2020 The driver is different, but the driver is in CC65 already 1 Quote Link to comment https://forums.atariage.com/topic/313609-driver-for-24aaxxx-eepprom-mounted-on-karris-carts/page/5/#findComment-4710289 Share on other sites More sharing options...
+karri Posted December 29, 2020 Share Posted December 29, 2020 sage wrote a whole bunch of drivers for 93cXX eeproms. But they are only up to 2k if I remember correctly. Quote Link to comment https://forums.atariage.com/topic/313609-driver-for-24aaxxx-eepprom-mounted-on-karris-carts/page/5/#findComment-4710554 Share on other sites More sharing options...
42bs Posted December 29, 2020 Share Posted December 29, 2020 Any reason for using A1 instead of A0 for the CLK? Quote Link to comment https://forums.atariage.com/topic/313609-driver-for-24aaxxx-eepprom-mounted-on-karris-carts/page/5/#findComment-4710647 Share on other sites More sharing options...
42bs Posted December 29, 2020 Share Posted December 29, 2020 Again, "cylce counting" iny cpy #128 bne pagewriteloop => iny bpl pagewriteloop Quote Link to comment https://forums.atariage.com/topic/313609-driver-for-24aaxxx-eepprom-mounted-on-karris-carts/page/5/#findComment-4710649 Share on other sites More sharing options...
42bs Posted December 29, 2020 Share Posted December 29, 2020 Ok, put my hands on the cc65 code but cannot test it since I have no working setup. I hope I just improved it and did not build in bugs. Note: Logic of last-byte-flag changed from != 0 to == 0 !! eeprom64k.s 1 Quote Link to comment https://forums.atariage.com/topic/313609-driver-for-24aaxxx-eepprom-mounted-on-karris-carts/page/5/#findComment-4710662 Share on other sites More sharing options...
+karri Posted December 29, 2020 Share Posted December 29, 2020 35 minutes ago, 42bs said: Any reason for using A1 instead of A0 for the CLK? The only reason was that the 93c46 eeprom used A1. So I just used the same. Quote Link to comment https://forums.atariage.com/topic/313609-driver-for-24aaxxx-eepprom-mounted-on-karris-carts/page/5/#findComment-4710665 Share on other sites More sharing options...
42bs Posted December 29, 2020 Share Posted December 29, 2020 8 minutes ago, karri said: The only reason was that the 93c46 eeprom used A1. So I just used the same. ? like the old A20 gate. And I used A1 because for an unknown reason A0 did not work. Quote Link to comment https://forums.atariage.com/topic/313609-driver-for-24aaxxx-eepprom-mounted-on-karris-carts/page/5/#findComment-4710667 Share on other sites More sharing options...
Nop90 Posted December 29, 2020 Author Share Posted December 29, 2020 2 hours ago, 42bs said: Ok, put my hands on the cc65 code but cannot test it since I have no working setup. I hope I just improved it and did not build in bugs. Note: Logic of last-byte-flag changed from != 0 to == 0 !! eeprom64k.s 9.47 kB · 3 downloads Thank you for the improvements. I didn't spend time optiizing the code an Iìm a novice with 6502 ASM. Later I'll test it with handy. The driver can run faster with protocol improvements, i.e. theoretically there is no need to set the IODIR byte for output and the AUDIN value to 1 because leaving IODIR as input the line should go to 1 for the pull-up resistor. Using this extensively we can save a lot of instructions. But I want to have a real eeprom to test it, @karri already spent a lot of time testing my bugs. Quote Link to comment https://forums.atariage.com/topic/313609-driver-for-24aaxxx-eepprom-mounted-on-karris-carts/page/5/#findComment-4710705 Share on other sites More sharing options...
42bs Posted December 29, 2020 Share Posted December 29, 2020 I first had to add a BLL loader to the card. I will now try to write a BLL driver based on your work and see if it can be further optimized. And sure will try A0 instead of A1 later. The question will be later: Speed or size. Quote Link to comment https://forums.atariage.com/topic/313609-driver-for-24aaxxx-eepprom-mounted-on-karris-carts/page/5/#findComment-4710816 Share on other sites More sharing options...
+karri Posted December 29, 2020 Share Posted December 29, 2020 32 minutes ago, 42bs said: I first had to add a BLL loader to the card. I will now try to write a BLL driver based on your work and see if it can be further optimized. And sure will try A0 instead of A1 later. The question will be later: Speed or size. It may be a good idea to try out the A0 for clock on the 64k eeprom and modify the pcb. Quote Link to comment https://forums.atariage.com/topic/313609-driver-for-24aaxxx-eepprom-mounted-on-karris-carts/page/5/#findComment-4710852 Share on other sites More sharing options...
42bs Posted December 29, 2020 Share Posted December 29, 2020 3 minutes ago, karri said: It may be a good idea to try out the A0 for clock on the 64k eeprom and modify the pcb. I have some spare PCBs from T-Tris and five 24aaxxx, so after I got the routine work with your card, I will give it a try. Quote Link to comment https://forums.atariage.com/topic/313609-driver-for-24aaxxx-eepprom-mounted-on-karris-carts/page/5/#findComment-4710853 Share on other sites More sharing options...
42bs Posted December 30, 2020 Share Posted December 30, 2020 (edited) Added driver and test program to new_bll. And here (again) an improved version for cc65. https://github.com/42Bastian/new_bll/blob/master/includes/24aaxxx.inc https://github.com/42Bastian/new_bll/blob/master/demos/check_24aaxxx.asm I chose ee24aaxxx_ prefix for common functions and ee24aa512_ for those only for the 128 page version. eeprom64k.s Edited December 30, 2020 by 42bs 1 1 Quote Link to comment https://forums.atariage.com/topic/313609-driver-for-24aaxxx-eepprom-mounted-on-karris-carts/page/5/#findComment-4711565 Share on other sites More sharing options...
42bs Posted December 30, 2020 Share Posted December 30, 2020 (edited) On 12/29/2020 at 5:57 PM, 42bs said: I have some spare PCBs from T-Tris and five 24aaxxx, so after I got the routine work with your card, I will give it a try. Ok, just checked that using A0 for clock works. Reading page wise all 64K takes ~6.2s with A0 clock and 7.8s with A1 clock. Edited December 30, 2020 by 42bs Quote Link to comment https://forums.atariage.com/topic/313609-driver-for-24aaxxx-eepprom-mounted-on-karris-carts/page/5/#findComment-4711770 Share on other sites More sharing options...
Recommended Posts
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.