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

Show off your completed Game Boy Zero, or post your build logs here!
User avatar
kite
Posts: 1770
Joined: Thu May 12, 2016 4:30 am
Location: UK
Has thanked: 390 times
Been thanked: 2153 times
Contact:

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

Post by kite » Wed Jan 17, 2018 7:02 am

Have you considered using shift registers? You can shift in a full 32 or 24bits very quickly this way with only using 3x data GPIO pins. There is very little overhead and the speed is as fast as you can switch the GPIO pins. I've been doing some experimenting and getting very good performance.. is any of your software published? I could see if it is actually suitable or not for this?

User avatar
tinkerBOY
Posts: 562
Joined: Tue May 30, 2017 4:00 am
Has thanked: 265 times
Been thanked: 163 times

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

Post by tinkerBOY » Wed Jan 17, 2018 7:59 am

This is awesome! Im following.

I've always wanted to do a similar project like this https://www.tindie.com/products/JRodrig ... r-gameboy/ which makes it easier to save roms and save files.

User avatar
kite
Posts: 1770
Joined: Thu May 12, 2016 4:30 am
Location: UK
Has thanked: 390 times
Been thanked: 2153 times
Contact:

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

Post by kite » Thu Jan 18, 2018 1:20 am

Just thought actually, the shift registers are input only, so it wouldn't actually work as intended as i think you have to do writes to set the registers in cart for which banks to read? :) ignore me, just spouting random things!

User avatar
abrugsch
Posts: 990
Joined: Tue Aug 02, 2016 10:00 am
Has thanked: 367 times
Been thanked: 441 times
Contact:

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

Post by abrugsch » Mon Jan 29, 2018 7:27 am

ok guys this has been on hold for a while thanks to several things (mainly the amount of sleep my little one allows me...)

There's a RGB565 mode that frees up SPI without the Chip Select pin AFAIK it's JUST doable as long as I don't need any other devices on the SPI bus. (I can use more than one MCP23S17 since it has it's own addressing mode using the same CS line. as long as the CS lines on the MCP's are held low then they will be selected and active.)

@144Tech I2C/SPI is too slow for DPI.
Sorry, I forgot to look at the stuff you sent. where did you send it? (Email/PM/Discord ?) Yeah. I'm terrible. I've barely even been on the forum for a couple of months! - usually on discord though
kite wrote:
Thu Jan 18, 2018 1:20 am
Just thought actually, the shift registers are input only, so it wouldn't actually work as intended as i think you have to do writes to set the registers in cart for which banks to read? :) ignore me, just spouting random things!
yep exactly! original designs for a reader only used shift registers on arduino, and was where i started out. but since I need Bi-Di (especially if I want to extend to GBA) then full port expanders is the only way to go. however it may well be that to get the speed i want, MCU's are looking increasingly likely the way to go. (that is what BennVenn does afterall...)

User avatar
kite
Posts: 1770
Joined: Thu May 12, 2016 4:30 am
Location: UK
Has thanked: 390 times
Been thanked: 2153 times
Contact:

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

Post by kite » Mon Jan 29, 2018 7:45 am

Bit banging SPI in C level code (wiringPi) is actually very fast. I've seen benchmarks of 10-20MHz output. Way faster than hardware I2C! The GPIO Soft SPI would be CPU intensive, but it only needs to happen at the start when not playing so that should be fine?

User avatar
abrugsch
Posts: 990
Joined: Tue Aug 02, 2016 10:00 am
Has thanked: 367 times
Been thanked: 441 times
Contact:

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

Post by abrugsch » Mon Jan 29, 2018 8:09 am

kite wrote:
Mon Jan 29, 2018 7:45 am
Bit banging SPI in C level code (wiringPi) is actually very fast. I've seen benchmarks of 10-20MHz output. Way faster than hardware I2C! The GPIO Soft SPI would be CPU intensive, but it only needs to happen at the start when not playing so that should be fine?
this is true... I didn't realise bit banging SPI was quick. I'll have to experiment a bit in that case, though wiring pi didn't seem to be setup well for transferring whole bytes of data, more individual pins. I'll definitely check it out once i've got to the bottom of the strange behavior I was seeing. (may have been device specific, i.e. borked)

User avatar
kite
Posts: 1770
Joined: Thu May 12, 2016 4:30 am
Location: UK
Has thanked: 390 times
Been thanked: 2153 times
Contact:

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

Post by kite » Mon Jan 29, 2018 8:16 am

abrugsch wrote:
Mon Jan 29, 2018 8:09 am
kite wrote:
Mon Jan 29, 2018 7:45 am
Bit banging SPI in C level code (wiringPi) is actually very fast. I've seen benchmarks of 10-20MHz output. Way faster than hardware I2C! The GPIO Soft SPI would be CPU intensive, but it only needs to happen at the start when not playing so that should be fine?
this is true... I didn't realise bit banging SPI was quick. I'll have to experiment a bit in that case, though wiring pi didn't seem to be setup well for transferring whole bytes of data, more individual pins. I'll definitely check it out once i've got to the bottom of the strange behavior I was seeing. (may have been device specific, i.e. borked)
With wiringPi you would only be reading one pin at a time because you would clock the SCK pin, and read from MISO, or write to MOSI if you are transmitting data. I agree that wirigingPi probably isn't good at reading a BANK of GPIO on the pi, but with only an SPI GPIO expander all you would need to do is make the SOFT SPI methods to poke the right registers. Eventually I'd like to look in to this too but don't have the time right now.. otherwise an MCU like the other ones do but then you still need some way to transfer the data ;)

mattmikemo
Posts: 12
Joined: Tue Nov 07, 2017 11:26 am
Been thanked: 1 time

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

Post by mattmikemo » Wed Feb 14, 2018 12:10 pm

Just discovered this thread. Awesome work. This will be my dream Gameboy once this project is ready. Actually tearing up a little Thank You!

User avatar
abrugsch
Posts: 990
Joined: Tue Aug 02, 2016 10:00 am
Has thanked: 367 times
Been thanked: 441 times
Contact:

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

Post by abrugsch » Wed Feb 14, 2018 12:37 pm

Just to let you know, the project isn't dead... Just had other IRL priorities lately but I'm definitely going to be finishing this as soon as i can

User avatar
abrugsch
Posts: 990
Joined: Tue Aug 02, 2016 10:00 am
Has thanked: 367 times
Been thanked: 441 times
Contact:

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

Post by abrugsch » Thu Feb 15, 2018 7:37 am

kite wrote:
Mon Jan 29, 2018 7:45 am
The GPIO Soft SPI would be CPU intensive, but it only needs to happen at the start when not playing so that should be fine?
Actually I just re-read that... and no it's not fine, as one of the final goals for this project is to have a filesystem wrapper so that emulators can be pointed at the cartridge and the wrapper loads the address requests in realtime, with the emu just accessing what it thinks is a .ROM file...

Post Reply

Who is online

Users browsing this forum: eggbowl and 17 guests