本帖最后由 san_gr 于 2010-5-25 16:35 编辑
Hi everyone.
First of all I am sorry that i write in english but I don't speak or understand Chinese AT ALL! :) So I hope I didn't break any of the forum's rules.
I am an engineering student in Denmark and I am currently working on a PSoC3 project. I have already asked at the english PSoC forums and at Cypress directly but I haven't received a satisfactory answer. That is why I want to ask you also. So here it goes:
I am working on a big project where I will have 9 PSoC3 devices working together.
A short description of the project:
8 PSoC3 devices to "read", amplify, filter and store locally 8 analog sensors.
1 PSoC3 device to be the master SPI and control the rest.
The master has to periodically acquire the data gathered from the 8 slaves and store them on an SD Card. Hopefully the SPI has to transmit with a bit rate of 8 MHz.
The problem:
For weeks now I am trying to establish a solid SPI communicationbetween 2 PSoC3 chips using two CY8CKIT-001 kits. I have tried havingDMAs and/or ISRs to transfer the data from and to SPI, I have tried tojust send 4 bytes from each side with the APIs but all my attempts havefailed. Almost every time I get wrong bytes (very few times I got the correct ones).
The latest attempt I'm doing is having a simple communicationprotocol. So the Master tries to send a command and the Slave has toreturn a reply according to the command. This gives me correct resultsmore often than before but still 1 out of 4 times Ireceive wrong results.
I have thoroughly studied both "SPI Master and Slave in Loopback"and "SPI with DMA" application notes and they seem to work perfectly onmy Development Kit.
I am pretty sure I am missing something but I can't find out whatit is. So I would greatly appreciate it if you could take a look in myproject and point out any possible mistakes I have made.
I have attached the workspace. It has two projects, "Master4" and "Slave4". Each project is used on one of the two CY8CKIT-001 kits.
Thank you in advance! And please reply in English :P
Regards,
Stefanos
PS. Hereyou can find my post to the English forum which has details of my previous attempts with the SPI. |