I cannot write to register associated with HSPI

pdemianczuk
Posts: 28
Joined: Thu May 30, 2019 12:05 pm

I cannot write to register associated with HSPI

Postby pdemianczuk » Thu May 30, 2019 12:45 pm

hello, I have WROOM-32D
I would like to start with SPI. I chosen SPI2 (HSPI), but I cannot write to some register i.e. SPI_PIN_REG, SPI_MOSI_DLEN_REG.
What would have a cause of this?
I would like to use registers without API (at this moment).
At the picture a I showed that i Can modify register on SPI0 and SPI1 interfaces.
Before that I set GPIO signal to function2 ( MCU_SEL na function2 (val=1)) (MOSI and CLK) and set them as output mode. I used GPIO_PAD13 and 14 (as a default)

Do you know what I have done wrong?
maybe some clock oraz mode master register bit,to enable this function perihperial/accces to write some register?
maybe some power managment features?
I Can write/clear to register which associatted with SPI(1) (see at pict.)
I can write to buffor eg with SPI_W0_REG(2) register.
Attachments
ESP32_problem_wrtie_register_SPI2SPI3.png
ESP32_problem_wrtie_register_SPI2SPI3.png (85.29 KiB) Viewed 6612 times

WiFive
Posts: 3529
Joined: Tue Dec 01, 2015 7:35 am

Re: I cannot write to register associated with HSPI

Postby WiFive » Thu May 30, 2019 1:16 pm

Code: Select all

periph_module_enable(PERIPH_HSPI_MODULE);

pdemianczuk
Posts: 28
Joined: Thu May 30, 2019 12:05 pm

Re: I cannot write to register associated with HSPI

Postby pdemianczuk » Thu May 30, 2019 2:34 pm

Thank you for help, I find the in 5.3.7 Technical Manual, but It's still not working correctlly.
Maybe Should I start/reset initialization of clock?
Attachments
ESP32_problem_wrtie_register_SPI2SPI3_002.png
ESP32_problem_wrtie_register_SPI2SPI3_002.png (104.59 KiB) Viewed 6595 times

pdemianczuk
Posts: 28
Joined: Thu May 30, 2019 12:05 pm

Re: I cannot write to register associated with HSPI

Postby pdemianczuk » Thu May 30, 2019 2:56 pm

If anyone know a diffrent about this 2 register?
Attachments
ESP32_problem_wrtie_register_SPI2SPI3_003.png
ESP32_problem_wrtie_register_SPI2SPI3_003.png (168.42 KiB) Viewed 6593 times

pdemianczuk
Posts: 28
Joined: Thu May 30, 2019 12:05 pm

Re: I cannot write to register associated with HSPI

Postby pdemianczuk » Sun Jun 02, 2019 7:32 pm

anyone can help me?

ESP_Angus
Posts: 2344
Joined: Sun May 08, 2016 4:11 am

Re: I cannot write to register associated with HSPI

Postby ESP_Angus » Mon Jun 03, 2019 3:43 am

You have to clear the reset bit for the peripheral as well as set the clk_en bit.

Is there a reason why you need to write the registers directly, rather than calling periph_module_enable(PERIPH_HSPI_MODULE); ?

If it's still not working, can you please post the code that you're using?

pdemianczuk
Posts: 28
Joined: Thu May 30, 2019 12:05 pm

Re: I cannot write to register associated with HSPI

Postby pdemianczuk » Thu Jun 06, 2019 9:55 am

oh, great, it's work, thx You

Who is online

Users browsing this forum: No registered users and 67 guests