Hi,
By default the SPI communicates in 16bits mode in STM32F7xx devices.
To be able to send/receive the 8bits data, I had to make some modifications in the stm32-spi.adb.
According to the reference manual, the SPI.DS register has to be set to 4bits mode, then the data needs to be parsed in a funny way to be able to transmit.
To be able to send the data, I had to made the following modifications in Receive_8bit_Mode / Send_8bit_Mode :
his.Periph.DR.DR := UInt16 ((Outgoing (Index) and 16#0F#))256 + UInt16((Outgoing (Index) and 16#F0#))/16;
To read the data:
Tmp := This.Periph.DR.DR;
K := UInt8 (Tmp and 16#000F#)16+ UInt8 ((Tmp and 16#0F00#)/256);
This way it works fine, the operations are clocked in 8bits.
Hi, By default the SPI communicates in 16bits mode in STM32F7xx devices. To be able to send/receive the 8bits data, I had to make some modifications in the stm32-spi.adb.
According to the reference manual, the SPI.DS register has to be set to 4bits mode, then the data needs to be parsed in a funny way to be able to transmit.
To be able to send the data, I had to made the following modifications in Receive_8bit_Mode / Send_8bit_Mode : his.Periph.DR.DR := UInt16 ((Outgoing (Index) and 16#0F#))256 + UInt16((Outgoing (Index) and 16#F0#))/16; To read the data: Tmp := This.Periph.DR.DR; K := UInt8 (Tmp and 16#000F#)16+ UInt8 ((Tmp and 16#0F00#)/256);
This way it works fine, the operations are clocked in 8bits.