1
\$\begingroup\$

I am working on SPI communication with STM32L073.

I download the example program of ST to MCU but SPI1 did not work. So I looked at the SCK pin of MCU with oscilloscope and it works fine. But when I look at the MOSI pin, I did not see anything. After that I pulled-up the MOSI pin with 10k resistor and I saw that it worked but not high enough which is not 3V3.

So what should I do to get enough output value from MOSI pin?

Pinout:
SP1,
MOSI: GPIOA, GPIO_PIN_12.
MISO: GPIOA, GPIO_PIN_11.
SCK: GPIOA, GPIO_PIN_5.
NSS: GPIOA, GPIO_PIN_4.

Thanks...

Edit1: I tested SPI with Nucleo-073rz. SPI worked just fine. But when I test it with my pcb, MOSI pin doesn't give output at all but SCK, NSS are fine.

Edit2: We replaced chip to stm32L152, it works!!! But I need to use STM32L073.

Schematic

\$\endgroup\$
5
  • \$\begingroup\$ Could you please show the schematic and perhaps also add a scope picture of MOSI using this 10k resistor? \$\endgroup\$ Commented Jan 3, 2020 at 19:18
  • \$\begingroup\$ Try a 1k resistor. \$\endgroup\$ Commented Jan 3, 2020 at 19:19
  • \$\begingroup\$ I tried 1.3k resistor but this time output level stays high all time. \$\endgroup\$ Commented Jan 3, 2020 at 19:42
  • \$\begingroup\$ With 10k pull up, the voltage level of MOSI is less than half of voltage level of SCK. I am at home so I cannot add the scope picture:D \$\endgroup\$ Commented Jan 3, 2020 at 19:44
  • \$\begingroup\$ Do you have the GPIO pins configured as weak pull-up and pull-down? \$\endgroup\$ Commented Jan 5, 2020 at 20:32

1 Answer 1

2
\$\begingroup\$

We found the problem which is we did not connect VDD_USB to VDD. Because PA11 and PA12 pins can be used as I/O only if VDD_USB pin is supplied between VDD_min and VDD_max.

\$\endgroup\$
3
  • \$\begingroup\$ seriously? good to know. I better fix this on the schematic I have right now. Where is this mentioned in the manual? \$\endgroup\$ Commented Jan 7, 2020 at 15:25
  • \$\begingroup\$ It is mentioned in the datasheet of STM32L073. \$\endgroup\$ Commented Jan 7, 2020 at 18:12
  • \$\begingroup\$ Man. Buried as a footnote in the Electrical Characteristics section of the datasheet, not the reference manual. \$\endgroup\$ Commented Jan 7, 2020 at 20:17

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.