Hi Andrey, One thought is that using SPI1.send(0x00,A4); will lower A4 and raise it for each byte. You may also find that the SPI 'mode' is wrong (CPOL/CPHA). You're better off doing:
(or actually doing the raising and lowering of A4 manually, and not specifying it for SPI.send at all)
The code that I have been using (different pins) is:
var EN = B7;
var IRQ = B8;
var CS = B6;
SPI1.setup({sck:B3,miso:B4, mosi:B5,mode:1/*Mode 1 CPOL= 0 CPHA= 1*/, baud: 1000000});
digitalWrite(CS,1);
digitalWrite(EN,0);
while (!digitalRead(IRQ)); // wait for IRQ high
digitalWrite(EN,1);
while (digitalRead(IRQ)); // wait for IRQ low
digitalWrite(CS,1);
// 1 = command
SPI1.send([1,0,5,0]);
// IRQ goes high after this
SPI1.send([0,1,0,0x40,1,1]); // last digit should be 1 according to EmbeddedAdventures
digitalWrite(CS,0);
However I haven't had much luck with the Embedded Adventures module. I'm in contact with them and hopefully we'll figure out what the problem is.
There is CC3000 support in Espruino itself though (which works with the Adafruit module) - see http://www.espruino.com/CC3000
Until the Espruino board comes out you'll have to compile your image with USE_CC3000=1 and USE_NET=1 in the Makefile though (I've been developing using the F4DISCOVERY board and it works well).
Espruino is a JavaScript interpreter for low-power Microcontrollers. This site is both a support community for Espruino and a place to share what you are working on.
Hi Andrey, One thought is that using
SPI1.send(0x00,A4);
will lower A4 and raise it for each byte. You may also find that the SPI 'mode' is wrong (CPOL/CPHA). You're better off doing:(or actually doing the raising and lowering of A4 manually, and not specifying it for SPI.send at all)
The code that I have been using (different pins) is:
However I haven't had much luck with the Embedded Adventures module. I'm in contact with them and hopefully we'll figure out what the problem is.
There is CC3000 support in Espruino itself though (which works with the Adafruit module) - see http://www.espruino.com/CC3000
Until the Espruino board comes out you'll have to compile your image with USE_CC3000=1 and USE_NET=1 in the Makefile though (I've been developing using the F4DISCOVERY board and it works well).