2018-02-26 02:43 AM
I am using an STM32L031K6 and I configure SP1 as Full Duplex Master, I expect that MOSI is an output and MISO an input but Cube MX configures SPI1_MISO as a Alternate Function Push Pull and can not be changed.
If I short MISO and MOSI of course doesn't work because both are outputs.
Why is it like that?
Thanks.
2018-02-26 04:26 AM
I noticed that SPI1_MISO is connected to PB6 throw one 0Ohm resistor. Removing the resistor now I see that SPI1_MISO is configured as an input since I can short MISO and MOSI and see the same in the scope.
2018-02-26 02:42 PM
Cube MX configures SPI1_MISO as a Alternate Function Push Pull and can not be changed.
If I short MISO and MOSI of course doesn't work because both are outputs.
They are not - in Alternate Mode, the 'direction' of pin is controlled by the associated peripheral.
Read the GPIO chapter of RM.
JW