hoglet67 / MMFS

Modern SD Card File System for Acorn 8-bit Machine (Master, Beeb, Electron)
68 stars 17 forks source link

Implement MMC_SlowClocks #22

Open hoglet67 opened 4 years ago

hoglet67 commented 4 years ago

Currently SPI initialization happens @ 1MHz which is out of the specified 100KHz to 400KHz range.

(From Myelin):

Looking at the code, it seems that MMC_Clocks is used for a bunch of different things:

  • MMC_INIT (10)
  • MMC_GetCIDCRC (16)
  • MMC_ReadBlock (256) to skip a sector
  • MMC_WriteBlock (258)
  • MMC_ReadDiscTitle (248, 250)

It looks like this is mostly to skip a given number of bytes when reading; it looks like we'll want to
add an 'MMC_SlowClocks' function to produce clocks at a slower rate. That said, it looks like the user port driver just always clocks the card at 1MHz, even during the initial clocks, so maybe we can just completely forget about this at first!

Cheers, Phil

hoglet67 commented 3 years ago

Work on this was started in the mgc_mkii branch, and stubs exist in tall the drivers but in all the other drivers it just calls down to MMC_Clocks.

https://github.com/hoglet67/MMFS/search?q=mmc_slowclocks