2017-05-02 10:16 AM
I am attempting to use the SPI interface of the SPWF04S module but with very limited success
I can get the module out of RESET with the SPI interface enabled by simply pulling the interrupt pin high as the reset pulse ends. The module sends some WIND messages that all make perfect sense. I get 'console active' 'wifi hardware started' etc etc and eventually it settles down to doing scans every few seconds ( I get 'scan active' followed by 'scan complete' repeatedly) That's all good.
I can't get the module to respond to any commands I send it. Lets say I want to send the simplest command (AT) just to determine if the console is alive... Here is what I've tried so far
1- SET CS low ... Send 0x02, 0x00, 0x02, 0x01, 0x00 ... Set CS high ... Wait for INT to go low ... Read response
2- SET CS low ... Send 0x02, 0x00, 0x02, 0x01, 0x00 ... Leave CS low ... Wait for INT to go low ... Read response
3-
SET CS low ... Send 0x02, 0x00, 0x02, 0x01, 0x00 ... continue clocking
... Wait for INT to go low ... Read response
4-
SET CS low ... Send 0x02, 0x00, 0x02, 0x01, 0x00 ... continue clocking
... Wait for sync (0x02) ... Read response
The 'length' bytes are ordered as in the examples in the TCP stack manual (high byte first) but I have also tried all of the above with the two bytes reversed (low byte first, as is the byte order of the receive transactions) but to no avail.
In both cases, if INT does eventually go low, it is not the kind of response I am expecting, just another WIND (usually the next 'scan started' or 'scan complete')
I've been through the manual, the very short section on SPI isn't much help (looks like I should be doing as 1- above (since it shows CS going high at the end of the transaction) but then it's description of the multiple receive isn't what I'm seeing (I see INT go high after every transaction, not staying low as in the manual) and the broken-english description of the SPI transactions don't match either. I'm not sure how far I should trust these diagrams. All of the code examples have sections relating to SPI but on closer inspection, they all use the UART.
Can someone point me in the right direction here with either an accurate description of the transfers or timing diagrams or some example code that actually uses the SPI interface. I've been battling with this for the last 3 days so any help would be greatly appreciated.
Many thanks
Ian
Solved! Go to Solution.
2018-04-16 04:02 AM
I had exactly the same issue, however SPI parameters correctly.
Few hours I've struggled with non-answering SPWF04, until I tried to set higher SPI clock (someone on this forum wrote that 4Mb/sec didn't work properly, 8Mb/sec did).
After that, SPWF04 started to answer.
So if someone has similar issues, ~325Kb/sec is too low clock. At 10.5Mb/sec it works.
I don't know where exactly the limit is.
Hope this helps someone.
R. Beneš