STM32F0 SPI Slave wrong behaviour
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2016-01-08 6:28 AM
Posted on January 08, 2016 at 15:28
Hi
I'm stuck in my project by this spi problem. What i do is simple, i send a data from a stm32f0 (master) to another one (slave) but here is the problem: while i see on the scope the good frame, the slave device doesn't. More precisely, it sees the data divided by 2. Plus i have to send the data twice to make the slave device understand something other than 0x00.. In the case of the slave, i handle the communication by interrupt whereas the reference manual says that it is preferable to use DMA. Do anybody found this problem someday?? I really need to work this out
This discussion is locked. Please start a new topic to ask your question.
3 REPLIES 3
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2016-01-09 11:42 AM
Posted on January 09, 2016 at 20:42
I suspect that you have a ''mode'' problem. There are 4 modes with SPI, specifying the clock polarity and resting state. If you get things wrong, the slave will recieve dat one bit-clock a too late and give you data that you call ''divided by two''.
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2016-01-11 12:53 AM
Posted on January 11, 2016 at 09:53
But i've already check the CPOL and CPHA, they are the same for master and slave. I've also tried to change them but still the same problem..
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2016-01-12 7:35 AM
Posted on January 12, 2016 at 16:35 Finally i got it working perfectly well with DMA..
