Skip to content

Commit

Permalink
Increase SPI speed to fCLk/2 after SD card init
Browse files Browse the repository at this point in the history
  • Loading branch information
raspiduino committed Oct 25, 2023
1 parent 5123370 commit a3a42ad
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions sdcard.c
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,8 @@ uint8_t SD_init()

SD_readOCR(res);

SPI_init(SPI_MASTER | SPI_2X_FOSC_2 | SPI_MODE_0);

return SD_SUCCESS;
}

Expand Down
2 changes: 1 addition & 1 deletion sdcard.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
#define CMD55_MAX_ATTEMPTS 255
#define SD_ERROR 1
#define SD_SUCCESS 0
#define SD_MAX_READ_ATTEMPTS 1563
#define SD_MAX_READ_ATTEMPTS 3907
#define SD_READ_START_TOKEN 0xFE
#define SD_INIT_CYCLES 80

Expand Down

0 comments on commit a3a42ad

Please sign in to comment.