Initialization procedure of Function Port (example of SPI communication)

This posting describes the procedure for initializing the functional ports.

Functional ports often need time to adjust to hardware requirements during initialization, which can cause malfunctions. To avoid this, the following procedure is recommended for initializing functional ports.

1. GPIO setting1) GPIO Data Register setting/SS   Pin “1”
SCLK Pin “1”
MOSI Pin “1”
2) GPIO Control Register (Pin select)Pin function selection
/SS   Pin – GPIO OUT
SCLK Pin – GPIO OUT
MOSI Pin – GPIO OUT
MISO Pin – GPIO In
2. SPI setting1) SPI Control Register settingSPI Mode
First bit (MSB/LSB)
Bit length
Frequence
2) SPI Status Register clearError status
TXI status
RXI status
3 SPI enable1) SPI Interrupt enableWhen using interruptions
2) GPIO Control Register (Pin select)Pin function selection
/SS   Pin – SPI /SS
SCLK Pin – SPI SCLK
MOSI Pin – SPI MOSI
MISO Pin – SPI MISO
OSS-ECAL English
error: Content is protected !!