HI,
I tried to set spi clk configuration by writing the SPI_CLOCK_REG. and then i tried to read it out. and i found it's still a default value of reset. The code is like bellow. Does i missed somewhere before access spi registers?
WRITE_PERI_REG(SPI_CLOCK_REG(SPI_NUM_HSPI),
((0x7 & SPI_CLKDIV_PRE) << SPI_CLKDIV_PRE_S) // Pre-divide by 8 --> 10MHz
| ((0x09 & SPI_CLKCNT_N) << SPI_CLKCNT_N_S) // Further divide by 10 --> 1 MHz
| ((0x04 & SPI_CLKCNT_H) << SPI_CLKCNT_H_S) // = ((SPI_CLKCNT_N+1)/2)-1
| ((0x09 & SPI_CLKCNT_L) << SPI_CLKCNT_L_S)); // = SPI_CLKCNT_N
uint32_t clkcfg = READ_PERI_REG(SPI_CLOCK_REG(SPI_NUM_HSPI));
printf("clkcfg : %u\n",clkcfg);
I get an output of 2147496003 for clkcfg. Can anybody help to have a look at this and give a suggestion?
Thanks very much
Write register not take effect [IDFGH-3226]
Who is online
Users browsing this forum: No registered users and 99 guests