Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Given SPI_CTRL_AUTOTX doesn't work on hardware it should be removed #382

Open
Yazwh0 opened this issue Feb 4, 2023 · 1 comment
Open

Comments

@Yazwh0
Copy link
Contributor

Yazwh0 commented Feb 4, 2023

It adds cycles and ROM space unnecessarily.
(plus is has the wrong value!)

in dos/regs/inc.s

;-----------------------------------------------------------------------------
; Register bits
;-----------------------------------------------------------------------------
SPI_CTRL_SELECT_SDCARD = $01
SPI_CTRL_SELECT_MASK   = $01
SPI_CTRL_SLOWCLK       = $02
SPI_CTRL_AUTOTX        = $08
SPI_CTRL_BUSY          = $80
@Jaxartes
Copy link
Contributor

Jaxartes commented Feb 4, 2023

Throwing in my 2¢:

It looks like the correct value of SPI_CTRL_AUTOTX should be $04 instead of $08, from https://github.com/fvdhoef/vera-module/blob/rev4/doc/VERA%20Programmer's%20Reference.md.

In https://github.com/fvdhoef/vera-module/blob/rev4/fpga/source/top.v the autotx bit does appear to be implemented (spi_autotx_r, spi_autotx_next). It looks like what it would do is transmit $FF whenever SPI_DATA gets read (without that, you'd have to write to SPI_DATA before reading anything).

It's not actually taking up any cycles or ROM space at the moment, since the code which uses it in dos/fat32/sdcard.s is not assembled without FAST_READ.

Perhaps someone with real hardware should try correcting SPI_CTRL_AUTOTX, uncommenting FAST_READ in dos/fat32/sdcard.s, assembling, and testing. Or perhaps X16 doesn't need the extra speed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants