Page 1 of 1

I cannot write to register associated with HSPI

Posted: Thu May 30, 2019 12:45 pm
by pdemianczuk
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.

Re: I cannot write to register associated with HSPI

Posted: Thu May 30, 2019 1:16 pm
by WiFive

Code: Select all

periph_module_enable(PERIPH_HSPI_MODULE);

Re: I cannot write to register associated with HSPI

Posted: Thu May 30, 2019 2:34 pm
by pdemianczuk
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?

Re: I cannot write to register associated with HSPI

Posted: Thu May 30, 2019 2:56 pm
by pdemianczuk
If anyone know a diffrent about this 2 register?

Re: I cannot write to register associated with HSPI

Posted: Sun Jun 02, 2019 7:32 pm
by pdemianczuk
anyone can help me?

Re: I cannot write to register associated with HSPI

Posted: Mon Jun 03, 2019 3:43 am
by ESP_Angus
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?

Re: I cannot write to register associated with HSPI

Posted: Thu Jun 06, 2019 9:55 am
by pdemianczuk
oh, great, it's work, thx You