Spi 통신 문제를 해결해 주세요
Ethernet Chips
No replies yet. Be the first to reply.
Join the discussion.
Ethernet Chips
No replies yet. Be the first to reply.
Join the discussion.
Share projects and connect with makers.
Joined before the site update? first.
New to WIZnet Makers?
We sent a verification link to your address. Open it to activate your account, then log in.
Accounts from this email provider are reviewed by an administrator after verification. Approval usually takes one business day.
Already have an account?
Enter your email address. If it belongs to an account, we'll send a link to set a new password. Members who joined before the site update use this to set their password.
If an account uses that address, we sent a link to set a new password. The link works once and expires in 30 minutes.
Know your password?
Need an account?
RE: Spi 통신 문제를 해결해 주세요
by suhwan ·
안녕하세요.
SPI 특성상 Master에서 Clock을 Slave에게 입력시켜주어야 Slave가 input/output을 하게됩니다.
보통 많은 MCU들이 Read를 하기 위해 dummy write를 하게됩니다.
write를 하게되면 SCLK이 발생하게 되도록 되어 있기 때문입니다.
이때 Slave는 data를 output하게 됩니다.
따라서 SPI의 단위 함수가 아래와 같이 구현된 경우가 많습니다.
보다 자세한 사항은 해당 MCU, stm32f407의 datasheet를 참고 하시기 바랍니다.
이부분은 stm32f407이 지원하고 있는 SPI속도와 구현 하려는 App.및 보드의 특성을
고려하여 설정하시기 바랍니다
W5200은 SPI Clock이 88MHz까지를 지원하고 있습니다.
감사합니다.
RE: Spi 통신 문제를 해결해 주세요
by yiulsup ·
SPI의 Read/Write 설명이 아니라,
보통 Send나 Receive할 때 동일 함수 uint8_t SPI1_SendByte(uint8_t byte)를 씁니다.
Send할 때도 쓰고, Receive할 때도 쓰고.
그런데 Send시나 Receive시나 두 함수가 어떻게 공통으로 쓰이는지 궁금합니다.
RE: Spi 통신 문제를 해결해 주세요
by suhwan ·
안녕하세요.
앞에서도 말씀드렸다시피 SPI는 Write와 Read가 동시에 이루어 집니다.
따라서 한개의 함수를 이용하여 처리할 수 있으며 아래와 같이 사용하시면 됩니다.
send시에는 return값을 무시하시면 됩니다.
반대로 recv시에는 return값을 사용하시면 됩니다.
감사합니다.
RE: Spi 통신 문제를 해결해 주세요
by yiulsup ·
보통 함수 SPI1_SendByte(uint8_t byte)가 한 바이트를 쓰고 그 다음 값이 들어올때가지 기다립니다.
그리고 Receive를 하지요. 그런데 값이 들어오지 않으면 RXNE이 Flag가 1이 되지 않습니다. 그럼 계속 While에서
있습니다.
값이 들어오려면 Master에서 Clock을 보내야 하는데, 보내지도 않고 마냥 기다리는 것 같아요.
어떻게 하나요?
RE: Spi 통신 문제를 해결해 주세요
by hjjeon0608 ·
SPI1_SendByte(0x00);
를 하게 되면 클럭이 인가됩니다.
따라서 recv 할때도 send를 해야 하는 겁니다.