Jump to content
IGNORED

Driver for 24AAXXX EEPPROM mounted on karri's carts


Nop90

Recommended Posts

It's something, it gets the ACK after setting the address and gets the ACK after writing (there is no ACK after reading). We are very close to have it working.

 

Please check with the programmer the value written in the first position of the EEPROM: if it's 128 the writing is ok and there is a bug in the reading part. If it's 16, there is a bug in the writing part but the reading is ok. If another value... it means I'm really bad ad coding in ASM.

Link to comment
Share on other sites

1 hour ago, Nop90 said:

I was ready to test my fixed code but the flash chip of my modded cart stopped working, and made a really bad work trying to make a new one.

 

So for the moment I'm stuck.

 

@karri ifyou want to test my last build here are the rom and the sources.

E2test.lnx 7.9 kB · 2 downloads E2test.zip 10.2 kB · 3 downloads

I can't see where y is cleared for the loop.

    lda #0
sectwriteloop:
    phy
    lda (ptr1),y
    jsr E2_put8    
    beq sectorWrite_error2
    ply    
    iny    
    cpy #0            ;needed?    
    bne sectwriteloop

 

I guess "lda #0" should be "ldy #0", right?

And yes, "cpy #0" is not needed.

Edited by 42bs
Link to comment
Share on other sites

1 hour ago, Nop90 said:

It's something, it gets the ACK after setting the address and gets the ACK after writing (there is no ACK after reading). We are very close to have it working.

 

Please check with the programmer the value written in the first position of the EEPROM: if it's 128 the writing is ok and there is a bug in the reading part. If it's 16, there is a bug in the writing part but the reading is ok. If another value... it means I'm really bad ad coding in ASM.

I really don't know exactly what is going on... I ran these 42BS changes and the result was the same.

 

00 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff

 

Perhaps it makes sense to first code the HAT version to reliably read and write the bytes. At least I know that the hardware works after that.

 

Link to comment
Share on other sites

@42bs beter fix the single byte read/write first.

 

 

Meanwhile manage to fix my cart, it works fine without the eeprom, with the eeprom strange things happens to the flash (sometimes works, others not). I'm worried they sold me  the wrong component.

 

This is the best pic I could take of the chip

 

tssop.jpg.1db8138766b141d859602748473a5730.jpg

Link to comment
Share on other sites

5 minutes ago, Nop90 said:

@42bs beter fix the single byte read/write first.

 

 

Meanwhile manage to fix my cart, it works fine without the eeprom, with the eeprom strange things happens to the flash (sometimes works, others not). I'm worried they sold me  the wrong component.

 

This is the best pic I could take of the chip

 

tssop.jpg.1db8138766b141d859602748473a5730.jpg

Lol. I may have something wrong in my code. I wrote a routine to write the eeprom but reading produce the wron result...

Link to comment
Share on other sites

There is something seriously wrong with the design/code. I tried to write "Hello World!"

 

pi@retropie:~/lynx/contrib/blankcart/programmer $ ./writeeeprom64k 
Write 128 bytes from eeprom.datr to eeprom
48 6c 6c 6f 57 72 6c 64 fe fe ff ff ff fe ff ff ff ff ff fe ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff pi@retropie:~/lynx/contrib/blankcart/programmer $ ./readeeprom64k 
Read 64k eeprom to eeprom.dat
48 ff 30 6d ff ff 56 ff fe 6d ff ff fe ff fe ff ff ff fe ff fe ff ff ff ff ff fe ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff

Link to comment
Share on other sites

8 minutes ago, 42bs said:

As I see the 24AA512 has a page of 128, so writing 256 bytes will only program the last 128 bytes

correct, only 128 bytes, writing more will make the internal counter go to o and overwrite the previous values stored in the buffer. I'll fix this, bu the priority is the single byte read write.

 

Better remove the block functions from the test program for the moment to avoid confusion.

 

 

Link to comment
Share on other sites

2 minutes ago, karri said:

There is something seriously wrong with the design/code. I tried to write "Hello World!"

 

pi@retropie:~/lynx/contrib/blankcart/programmer $ ./writeeeprom64k 
Write 128 bytes from eeprom.datr to eeprom
48 6c 6c 6f 57 72 6c 64 fe fe ff ff ff fe ff ff ff ff ff fe ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff pi@retropie:~/lynx/contrib/blankcart/programmer $ ./readeeprom64k 
Read 64k eeprom to eeprom.dat
48 ff 30 6d ff ff 56 ff fe 6d ff ff fe ff fe ff ff ff fe ff fe ff ff ff ff ff fe ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff

I'd add a "sleep" after every byte to be sure the chip has finished writing.

Link to comment
Share on other sites

The reading appears to give back the same result every time which id good ;)

Read 64k eeprom to eeprom.dat
48 ff 30 6d ff 21 56 6f fe 6d ff 21 fe 21 fe 21 ff 21 fe 21 fe 21 ff ff ff ff fe ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff pi@retropie:~/lynx/contrib/blankcart/programmer $ mv eeprom.dat oldeeprpm.dat
pi@retropie:~/lynx/contrib/blankcart/programmer $ ./readeeprom64k 
Read 64k eeprom to eeprom.dat
48 ff 30 6d ff 21 56 6f fe 6d ff 21 fe 21 fe 21 ff 21 fe 21 fe 21 ff ff ff ff fe ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff pi@retropie:~/lynx/contrib/blankcart/programmer $ 
 

Link to comment
Share on other sites

The problem is with the ACK signal received after the write operation. Something strange going on...

Write 128 bytes from eeprom.datr to eeprom
48 Error30 6d ff Error56 Errorfe 6d ff Errorfe Errorfe 21 ff 21 fe 21 fe 21 ff ff ff Errorfe ff ff Errorff ff ff Errorff ff ff Errorff ff ff Errorff ff ff Errorff 

Link to comment
Share on other sites

Well... Almost working...

pi@retropie:~/lynx/contrib/blankcart/programmer $ ./writeeeprom64k 
Write 128 bytes from eeprom.datr to eeprom
48 65 6c 6c 6f 20 57 6f 72 6c 64 21 20 20 20 20 20 20 20 20 pi@retropie:~/lynx/contrib/blankcart/programmer $ 
pi@retropie:~/lynx/contrib/blankcart/programmer $ ./readeeprom64k 
Read 64k eeprom to eeprom.dat
48 65 6c 6d 6e 21 56 6f 72 6d 64 21 20 21 20 21 20 21 20 21 

 

Some really strange bit errors here and there...

Link to comment
Share on other sites

4 minutes ago, 42bs said:

Looks like the last clock is somehow missing. That might be the reason you get no ACK.

 

No. For the last bit I outputted the last bit of the address instead of the last bit of the data. Just a typo.

 

Write 128 bytes from eeprom.datr to eeprom
48 65 6c 6c 6f 20 57 6f 72 6c 64 21 20 20 20 20 20 20 20 20
ead 64k eeprom to eeprom.dat
48 65 6c 6c 6f 20 57 6f 72 6c 64 21 20 20 20 20 20 20 20 20

  • Like 1
Link to comment
Share on other sites

So now I wrote the eeprom with some content, read it, put the cart in the Lynx to run the test it and read it again.

i@retropie:~/lynx/contrib/blankcart/programmer $ ./writeeeprom64k 
Write 128 bytes from eeprom.datr to eeprom
48 65 6c 6c 6f 20 57 6f 72 6c 64 21 20 20 20 20 20 20 20 20 pi@retropie:~/lynx/contrib/blankcart/programmer $ 
pi@retropie:~/lynx/contrib/blankcart/programmer $ ./readeeprom64k 
Read 64k eeprom to eeprom.dat
48 65 6c 6c 6f 20 57 6f 72 6c 64 21 20 20 20 20 20 20 20 20 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff pi@retropie:~/lynx/contrib/blankcart/programmer $ ./readeeprom64k 
Read 64k eeprom to eeprom.dat
00 65 6c 6c 6f 20 57 6f 72 6c 64 21 20 20 20 20 20 20 20 20 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff pi@retropie:~/lynx/contrib/blankcart/programmer $ 
 

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...