SPI Discrepancies
Hi
I'm trying to read an EEPROM connected to SPI1 and facing difficulties. For some reason the clock is off by being idle high. This doesn't happen if I use SPI3 and am therefore wondering if there's some characteristic or further configuration that is required with SPI1?
Note that I'm using PA4 for both scenarios but this is a manual process anyway; send PA4 low, interact with SPI, send PA4 high. However, I cannot see this being an issue. I've attached a couple of images showing the results as follows:
SPI1 (bad):
SPI3 (good):
I've gone through a number of settings within the configuration and my setup is as follows:
SPI1
Mode: Full-Duplex Master
Hardware NSS Signal: Disable
NVIC SPI1 global interrupt: Yes
DMA: None
GPIO:
PA5: SPI1_SCK
PA6: SPI1_MISO
PA7: SPI1_MOSI
NVIC SPI1 global interrupt: Yes
No DMA
GPIO
Frame Format: Motorola
Data Size: 8 Bits
First Bit: MSB First
Prescaler: 32
Baud Rate: 15.0 MBits/s
Clock Polarity (CPOL): Low
Clock Phase (CPHA): 1 Edge
CRC Calculation: Disabled
NSSP Model: Disabled
NSS Signal Type: Software
Fifo Threshold: Fifo Threshold 01 Data
Tx Crc Initialization Pattern: All Zero Pattern
Rx Crc Initialization Pattern: All Zero Pattern
Nss Polarity: Nss Polarity Low
Master Ss Idleness: 00 Cycle
Master Inter Data Idleness: 00 Cycle
Master Receiver Auto Susp: Disable
Master Keep Io State: Master Keep Io State Disable
IO Swap: Disabled: Disabled
Using PA4: SPI_nCSand SPI3:
Mode: Full-Duplex Master
Hardware NSS Signal: Disable
NVIC SPI3 global interrupt: Yes
DMA: None
GPIO:
PC10: SPI3_SCK
PC11: SPI3_MISO
PC12: SPI3_MOSI
Parameter Settings:
Frame Format: Motorola
Data Size: 8 Bits
First Bit: MSB First
Prescaler: 32
Baud Rate: 15.0 MBits/s
Clock Polarity (CPOL): Low
Clock Phase (CPHA): 1 Edge
CRC Calculation: Disabled
NSSP Model: Disabled
NSS Signal Type: Software
Fifo Threshold: Fifo Threshold 01 Data
Tx Crc Initialization Pattern: All Zero Pattern
Rx Crc Initialization Pattern: All Zero Pattern
Nss Polarity: Nss Polarity Low
Master Ss Idleness: 00 Cycle
Master Inter Data Idleness: 00 Cycle
Master Receiver Auto Susp: Disable
Master Keep Io State: Master Keep Io State Disable
IO Swap: Disabled: Disabled
Using PA4: SPI_nCSCan appreciate that immediate thoughts would be to stick with SPI3 but unfortunately there is functionality required using the GPIO port C pins and therefore really needs to go onto SPI1. Any thoughts, insight and suggestions would be greatly appreciated.
