You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I just wanted to let you know that I have the communication working using the spi hardware (+dma) of the rp2040. Actually you provided the trick:
aspAcquire(aps);
/* inititate read */
uint8_t cmd[5] = { APS_FASTREAD };
cmd[1] = addr >> 16;
cmd[2] = addr >> 8;
cmd[3] = addr & 0xFF;
cmd[4] = 0; //dummy
spi_transfer(aps->spi, cmd, NULL, sizeof(cmd));
/* receive data */
//note: for fastread (>33Mhz) we need to switch to sampling on the falling egde
if(aps->spi->baud_rate > 33000000)
spi_set_format(aps->spi->hw_inst, 8, SPI_CPOL_0, SPI_CPHA_1, SPI_MSB_FIRST);
spi_transfer(aps->spi, NULL, buf, size);
if(aps->spi->baud_rate > 33000000)
spi_set_format(aps->spi->hw_inst, 8, SPI_CPOL_0, SPI_CPHA_0, SPI_MSB_FIRST);
aspRelease(aps);
Prior to the read operation I reconfigure the spi hardware to do sampling on the falling edge.
I have it tested at 62.5Mhz (maximum for a pico running at default speed (125Mhz)).
Cheers,
Juergen
The text was updated successfully, but these errors were encountered:
Thank you for opening this issue, that is great to hear! I will try out this code. To get 62.5MHz, do you have to reconfigure the peripheral clock? When trying to use the SPI hardware I came across this post: https://forums.raspberrypi.com/viewtopic.php?t=333214. I typically overclock the Pico (in the 266-280MHz range) and wonder if the baud rate will also scale as I overclock.
Hi,
I just wanted to let you know that I have the communication working using the spi hardware (+dma) of the rp2040. Actually you provided the trick:
Prior to the read operation I reconfigure the spi hardware to do sampling on the falling edge.
I have it tested at 62.5Mhz (maximum for a pico running at default speed (125Mhz)).
Cheers,
Juergen
The text was updated successfully, but these errors were encountered: