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 setting
1) GPIO Data Register setting


2) GPIO Control Register (Pin select)

     
/SS   Pin “1”
SCLK Pin “1”
MOSI Pin “1”
/SS   Pin – GPIO OUT
SCLK Pin – GPIO OUT
MOSI Pin – GPIO OUT
MISO Pin – GPIO In

2 SPI setting
1) SPI Control Register setting
2) SPI Status Register clear


SPI Mode, First bit (MSB/LSB), Bit length, Frequence
Error status, TXI status, RXI status

3 SPI enable
1) SPI Interrupt enable
2) GPIO Control Register (Pin select)


When using interruptions
/SS   Pin – SPI /SS
SCLK Pin – SPI SCLK
MOSI Pin – SPI MOSI
MISO Pin – SPI MISO

OSS-ECAL English
error: Content is protected !!