cancel
Showing results for 
Search instead for 
Did you mean: 

what is the maximum frequency for STM32L072 discovery kit to operate properly in SPI Slave mode?

barmy
Associate II

Hi

I am using STM32L072 Discovery Kit. I have connected STM32L072 discovery kit as SPI Slave and Texas Instrument MCU as Master. Communication between the two is good for master clock frequency less than 7.5MHz.But if I increase this frequency, there is error in some received data. I have set the discovery kit frequency to 32MHz .

Is there any way to reduce error even if I increase master frequency to 15MHz? Or 7.5MHz is the maximum limit it (discovery kit) can handle in SPI Slave mode without error?

Looking forward for suggestions.

Thanks

3 REPLIES 3

For maximum SPI slave-mode SCK frequency see the datasheet. Note, that there are additional requirements on setup/hold times and duty cycle of SCK.

Your problem may also not be limitation of the SPI peripheral, but the ability of software to cope with the incoming data stream. Do you observe SPI_SR.OVR?

JW

I have gone through datasheet and found 15MHz is the maximum frequency at which STM32L072 Discovery Kit can operate but I haven't got any document for setup/hold times and duty cycle of SCK constrains. Please suggest any document where I can look into.

Also can u please elaborate "ability of software to cope with the incoming data stream".

Thanks

mckenney
Senior

I vote with JW: It's almost certainly your software not keeping up. With an 8MHz SPI there's a byte appearing every 1usec, so a 32MHz CPU has 32 clocks to deal with it before the next one arrives. If you're using interrupts, 32 clocks will probably be eaten up just getting into/out of the ISR.

If your (higher-level) protocol allows it, try using DMA.