You are reading a single comment by @Andrey and its replies. Click here to read the full conversation.
  • Hi, Gordon, Hi all!
    according to the TI instructions I tryed to initialize cc3000. (i've got the module from
    embeddedadventures)
    here is the code snippet, I've used:

    SPI_OPERATION_WRITE=0x01;
    HCI_TYPE_COMMAND=0x01; 
    HCI_COMMAND_SIMPLE_LINK_START=0x4000;
    SPI1.setup();
    digitalWrite(B0,0); 		// Disable the module by setting EN(B0) low 
    while(digitalRead(C5)==0){};	// Wait for IRQ line (C5) to go high
    digitalWrite(B0,1);			// Enable the module by setting EN high 
    while(digitalRead(C5)){};	// Wait for IRQ line to go low 
    digitalWrite(C4,1); 		//Set CS line (C4) high
    temp1=2;
    while(temp1-->0){};			// Wait 50 µs (probably it takes not 50us, is it critically?)	
    SPI1.send(SPI_OPERATION_WRITE,A4);
    SPI1.send(0x00,A4);			// Send via SPI: 0x00 (length MSB)
    SPI1.send(0x05,A4);			// Send via SPI: 0x05 (length LSB)
    SPI1.send(0x00,A4);			// Send via SPI: 0x00 (busy 0)
    temp1=2;
    while(temp1-->0){};			// Wait 50 µs 	
    SPI1.send(0x00,A4);			// Send via SPI: 0x00 (busy 1)
    SPI1.send(HCI_TYPE_COMMAND,A4);
    SPI1.send(HCI_COMMAND_SIMPLE_LINK_START & 0xff); 	//Send via SPI: HCI_COMMAND_SIMPLE_LINK_START (LSB)
    SPI1.send(HCI_COMMAND_SIMPLE_LINK_START >> 8); 		//Send via SPI: HCI_COMMAND_SIMPLE_LINK_START (MSB)
    SPI1.send(0x01,A4);			// Send via SPI: 0x01 (1 byte payload)
    SPI1.send(0x01,A4);			// Send via SPI: PatchesRequest (0x00 = Don’t load patches 0x01 = Load patches) 		
    digitalWrite(C4,0); 		//Set CS line low
    while(digitalRead(C5)==1){};	// Wait for IRQ line to go low
    ans = SPI1.send(0x00,A4);
    

    monitoring "ans" variable by lcd indicator shows me always zero, but must contain the answer from the module.
    what is my mistake ?

About

Avatar for Andrey @Andrey started