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]
Return to “General Discussion”
Jump to
- English Forum
- Explore
- News
- General Discussion
- FAQ
- Documentation
- Documentation
- Sample Code
- Discussion Forum
- ESP32-S31
- Hardware
- ESP-IDF
- ESP-BOX
- ESP-ADF
- ESP-MDF
- ESP-WHO
- ESP-SkaiNet
- ESP32 Arduino
- IDEs for ESP-IDF
- ESP-AT
- ESP IoT Solution
- ESP RainMaker
- Rust
- ESP8266
- Report Bugs
- Showcase
- Chinese Forum 中文社区
- 活动区
- 乐鑫活动专区
- 讨论区
- ESP32-S31 中文讨论版
- 喵伴 中文讨论版
- ESP-IDF 中文讨论版
- 《ESP32-C3 物联网工程开发实战》书籍讨论版
- 中文文档讨论版
- ESP-AT 中文讨论版
- ESP-BOX 中文讨论版
- ESP IoT Solution 中文讨论版
- ESP-ADF 中文讨论版
- ESP Mesh 中文讨论版
- ESP Cloud 中文讨论版
- ESP-WHO 中文讨论版
- ESP-SkaiNet 中文讨论版
- ESP 生产支持讨论版
- 硬件问题讨论
- 项目展示
Who is online
Users browsing this forum: No registered users and 2 guests
- All times are UTC
- Top
- Delete cookies
About Us
Espressif Systems is a fabless semiconductor company providing cutting-edge low power WiFi SoCs and wireless solutions for wireless communications and Internet of Things applications. ESP8266EX and ESP32 are some of our products.
Information
Espressif ESP32 ... Available now!