969 views|3 replies

26

Posts

0

Resources
The OP
 

STM32F103ZET6】Evaluation of SPI module [Copy link]

SPI is a common communication method between the master chip and the slave chip, and is widely used. After all, it is easy to access such as storage chips, driver chips, power chips, etc.

Since I have used W25x series memory chips on other platforms before, I wanted to try the SPI communication between the STM32 development board and the W25x chip, and I checked the schematic diagram

From the schematic diagram, we can also see that there is this W25X64 position

Then I looked for the U2 position on the board, but found that there was no chip soldered on it.

In other words, it is reserved, which is a bit embarrassing.

Since we can't communicate with the external chip, let's try a simple SPI send.

According to the chip pin diagram, we can see that PA5, PA6, and PA7 are the SCK, MISO, and MOSI pins of SPI1 respectively. Then we find another pin as CS pin, and then we can test the SPI function through these four pins.

I found an SPI example, configured it roughly, burned it to the board, connected it to the logic analyzer, and found that I couldn't collect waveforms well, even the basic clock signal couldn't be collected well, which was a headache. There were 8 clock signals, but I could only collect 3/4 of them. Then I had to plug and unplug the signal line many times, open and close the software many times, and even suspected that the logic analyzer in my hand was broken. After two days of intermittent attempts, I felt that it was most likely a problem with the logic analyzer. Then I planned to buy another logic analyzer online.

When I was looking at logic analyzers on Taobao, I was thinking about buying one with a higher sampling rate so that I could collect signals with higher frequencies. Then I looked at the device I had and found that it only supported 24M at most. According to the device's recommendation, a 24M sampling rate can generally only collect signals of 2M or less.

At this time, I suddenly realized that maybe the SPI frequency of ST was set too high, which caused the logic analyzer to collect data poorly. I immediately changed the SPI clock division from 4 to 64.

Recompile and burn it to the board, collect it with a logic analyzer, and it will be ready immediately

The output value is consistent with the program setting, which means the problem is the SPI frequency. Hahahahaha, I made a low-level mistake, but fortunately I found it in time and saved money on buying a logic analyzer.

At this point, the SPI module evaluation is completed

This post is from stm32/stm8

Latest reply

It turns out that the SPI frequency of ST is set too high I almost wrongly accused the original logic analyzer.   Details Published on 2023-10-5 18:31
 

6027

Posts

6

Resources
2
 

A logic analyzer would be nice.

This post is from stm32/stm8
 
Personal signature

在爱好的道路上不断前进,在生活的迷雾中播撒光引

 

2w

Posts

341

Resources
3
 

It turns out that the SPI frequency of ST is set too high

I almost wrongly accused the original logic analyzer.

This post is from stm32/stm8

Comments

Hahahaha yeah  Details Published on 2023-10-7 10:17
 
 

26

Posts

0

Resources
4
 
qwqwqw2088 posted on 2023-10-5 18:31 It turned out that the SPI frequency of ST was set too high, which almost wronged the original logic analyzer

Hahahaha yeah

This post is from stm32/stm8
 
 
 

Guess Your Favourite
Just looking around
Find a datasheet?

EEWorld Datasheet Technical Support

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京B2-20211791 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号
快速回复 返回顶部 Return list