Reading real cartridges (Update - IT LIVES! - video)

Show off your completed Game Boy Zero, or post your build logs here!
User avatar
abrugsch
Posts: 971
Joined: Tue Aug 02, 2016 10:00 am
Has thanked: 356 times
Been thanked: 430 times
Contact:

Re: Reading real cartridges (Update - IT LIVES! - video)

Post by abrugsch » Wed Jul 12, 2017 7:00 am

kite wrote:
Tue Jul 11, 2017 3:22 pm
I really like your project don't let anything I say sway you ;) I'm interested in it however you do it as I think it's such a neat idea and you've proven over i2c and the spi should make it loads quicker :)
well it's not just you saying it, some of the peeps at my hackerspace are too. I honestly didn't think the I2C version would have been as slow as it is. We'll see soon enough if the SPI version helps much (though the MCP23S17 doesn't go anywhere near as fast as SPI is capable of and I have a feeling the bottleneck is somewhere in the software stack, not the I2C/SPI hardware interface since overclocking the Pi had a decent effect on speeding it up...)
If it comes to it, I will go down the MCU route, it's just less interesting to me since that's already been 'done' (GBCartRead - which slurp is notionally based on - is an arduino mega, BennVenn Joey Joebags - uses a STM32) and isn't using the Pi itself really. If I do use a MCU it will be to directly interface the cartridge though.

It's crazy to think that i've been farting around with this project since before sudomod even existed/became a massive thing!

User avatar
abrugsch
Posts: 971
Joined: Tue Aug 02, 2016 10:00 am
Has thanked: 356 times
Been thanked: 430 times
Contact:

Re: Reading real cartridges (Update - IT LIVES! - video)

Post by abrugsch » Mon Jul 24, 2017 6:59 am

so a tiny update while I wait for the new SPI based boards to arrive...
I hacked one of the I2C boards to have the SPI chips on them (they are mostly the same but obviously take SPI signals instead of I2C, so 2 pins have to be re-routed and 2 new pins have to be connected PER CHIP) by dropping the header socket connections out of the socket, and wiring the appropriate SPI header lines to connect with the correct (former) I2C positions, and wiring new jumps from the SPI header pins to the chips legs directly. Quite a task on fine pitch SSOP chips I can tell you!

anyway the result is a working (if fragile) SPI version of GBCartSlurp.

so on to the software... I can get the SPI chips to read and write without an intermediate library like wiring pi but one of the speedups I did on the I2C version was that I could make use of "Sequential" mode where I could write 2 bytes per chip (for the address data) in one command, reducing some of the overhead per transfer.
(the operation to read one byte of data off the cartridge looks something like:

Code: Select all

* Write the address data out to the address bus (2 bytes - chip 1, ports 1 and 2)
*Set the apropriate read/write lines (1 byte - chip 2, port 2)
*read the state of the data lines (1 byte - chip 2, port 1)
*revert the control lines back to rest (1 byte - chip 2, port 2)
each of those is one command sent to the port expander chips PER BYTE.
so sequential mode lets me send 2 bytes to the address bus with only the overhead of one byte command.
This works well on I2C and it gave me a small speed increase pretty much for free.
However for SPI it doesn't seem to work despite me following every documented reference I can find to it to the letter...
(this is in a test program which was explicitly written to exercise this feature.) I have lights go on for the first byte, but the second one is always dropped.
*BUMMER!!*
So testing continues, but I may have to forget about sequential mode. fortunately the SPI command set overhead isn't as much as it is on the I2C version so it may not matter if the overall speed increase is significant...

User avatar
abrugsch
Posts: 971
Joined: Tue Aug 02, 2016 10:00 am
Has thanked: 356 times
Been thanked: 430 times
Contact:

Re: Reading real cartridges (Update - IT LIVES! - video)

Post by abrugsch » Thu Jul 27, 2017 6:48 am

The mods to make the I2C version SPI compatable:
IMG_20170727_122055.jpg
IMG_20170727_122055.jpg (1.57 MiB) Viewed 8229 times
IMG_20170727_122007.jpg
IMG_20170727_122007.jpg (1.44 MiB) Viewed 8229 times
(and only a token number of LED's installed for easy testing)

User avatar
abrugsch
Posts: 971
Joined: Tue Aug 02, 2016 10:00 am
Has thanked: 356 times
Been thanked: 430 times
Contact:

Re: Reading real cartridges (Update - IT LIVES! - video)

Post by abrugsch » Fri Aug 11, 2017 4:46 am

so after wiring up the I2C->SPI board above, my actual SPI boards arrived and I've built one up:
SpoilerShow
Image
Image
Image
I'm still trying to get sequential writes working, but even if I don't it's probably not going to increase speed anywhere near as much as just the switch from I2C to SPI.

User avatar
YaYa
Posts: 1719
Joined: Mon Jun 26, 2017 12:42 pm
Location: brittany - France
Has thanked: 871 times
Been thanked: 689 times
Contact:

Re: Reading real cartridges (Update - IT LIVES! - video)

Post by YaYa » Fri Aug 11, 2017 3:39 pm

This project is crazy . Thumb up abrugsch ! :o
Follow me on instagram Image


Pap
Posts: 39
Joined: Sat Nov 05, 2016 12:59 pm
Has thanked: 14 times
Been thanked: 7 times

Re: Reading real cartridges (Update - IT LIVES! - video)

Post by Pap » Sat Aug 12, 2017 5:17 am

abrugsch wrote:
Fri Aug 11, 2017 5:04 pm
YaYa wrote:
Fri Aug 11, 2017 3:39 pm
Thumb up abrugsch !
What now??? :shock:
now get back to work and get this thing manufactured:) so much progress since you started this if you gonna stop now i swear to god...:D i already bought a couple of used gba cart slots just in case;)

User avatar
abrugsch
Posts: 971
Joined: Tue Aug 02, 2016 10:00 am
Has thanked: 356 times
Been thanked: 430 times
Contact:

Re: Reading real cartridges (Update - IT LIVES! - video)

Post by abrugsch » Sat Aug 12, 2017 10:15 am

there's no stopping!
just gotta fit around kids and wife and all my other projects. but this is taking priority of all my projects.

I hope you got the right gba slot... the one my PCB takes is the one from NDS Lite. (as in the ones I desolder and have for sale...)
I'll probably do a footprint for the other ones as well once it's actually working properly though...

Pap
Posts: 39
Joined: Sat Nov 05, 2016 12:59 pm
Has thanked: 14 times
Been thanked: 7 times

Re: Reading real cartridges (Update - IT LIVES! - video)

Post by Pap » Sun Aug 13, 2017 3:35 pm

not sure what kind i got, i guess the classic GBA ones if i recall correctly but that should not be the problem i can saw how much it would be possible and 3dprint/glue what is missing as long as the connectors part is fine:)

User avatar
abrugsch
Posts: 971
Joined: Tue Aug 02, 2016 10:00 am
Has thanked: 356 times
Been thanked: 430 times
Contact:

Re: Reading real cartridges (Update - IT LIVES! - video)

Post by abrugsch » Mon Aug 14, 2017 3:38 am

the difference is in the PCB pin arrangement. on the NDS/DSL it's surface mount. GBA is through hole. Look closely at this pic:
Image
I'm going to maybe make a Through hole version eventually but it's REALLY low on my priority list

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest