Skip to content

PSRAM crashes on 252MHZ overclock (set in code , not from the IDE menu) #2619

Answered by earlephilhower
Macrosii asked this question in Q&A
Discussion options

You must be logged in to vote

PSRAM is driven from clk_sys, so if you change that then you need to change the divider or it'll go out of spec and the PSRAM chip will probably go very badly. See:

static void __no_inline_not_in_flash_func(set_psram_timing)(void) {
// Get secs / cycle for the system clock - get before disabling interrupts.
uint32_t sysHz = (uint32_t)clock_get_hz(clk_sys);
// Calculate the clock divider - goal to get clock used for PSRAM <= what
// the PSRAM IC can handle - which is defined in SFE_PSRAM_MAX_SCK_HZ
volatile uint8_t clockDivider = (sysHz + SFE_PSRAM_MAX_SCK_HZ - 1) / SFE_PSRAM_MAX_SCK_HZ;

Replies: 3 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by Macrosii
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants