Skip to content
Browse files

1.0.1b

Remapped pins for Teensy 3.0 & changed main loop to ignore newlines &
returns
  • Loading branch information...
1 parent ea3bb0a commit 38154b4222571b582ac3ea94e6840859df0e4b94 @cmagagna committed Jul 7, 2013
Showing with 84 additions and 67 deletions.
  1. +18 −12 ArduinoCC3000.ino
  2. +1 −1 ArduinoCC3000Core.cpp
  3. +11 −20 ArduinoCC3000Core.h
  4. +6 −6 ArduinoCC3000SPI.cpp
  5. +1 −1 ArduinoCC3000SPI.h
  6. +22 −2 README.md
  7. +2 −2 cc3000_common.cpp
  8. +2 −2 cc3000_common.h
  9. +1 −1 evnt_handler.cpp
  10. +1 −1 evnt_handler.h
  11. +1 −1 hci.cpp
  12. +1 −1 hci.h
  13. +2 −2 host_driver_version.h
  14. +2 −2 netapp.c
  15. +2 −2 netapp.h
  16. +2 −2 nvmem.c
  17. +2 −2 nvmem.h
  18. +2 −2 security.c
  19. +1 −1 security.h
  20. +1 −1 socket.c
  21. +1 −1 socket.h
  22. +1 −1 wlan.cpp
  23. +1 −1 wlan.h
View
30 ArduinoCC3000.ino
@@ -3,7 +3,7 @@
* ArduinoCC3000.ino - An application to demo an Arduino connected to the
TI CC3000
*
-* Version 1.0.1a
+* Version 1.0.1b
*
* Copyright (C) 2013 Chris Magagna - cmagagna@yahoo.com
*
@@ -184,19 +184,20 @@ void setup(void) {
else {
// Faking SPI because the Teensy 3.0's hardware SPI library doesn't
// seem to work with the CC3000
- pinMode(MOSI, OUTPUT);
- digitalWrite(MOSI, LOW);
- pinMode(SCK, OUTPUT);
- digitalWrite(SCK, LOW);
- pinMode(MISO, INPUT); // Unlike a regular Arduino, the Teensy 3.0's pins default to 'disabled'
- // instead of 'input', so we need to explicitly set this here
+ pinMode(WLAN_MOSI, OUTPUT);
+ digitalWrite(WLAN_MOSI, LOW);
+ pinMode(WLAN_SCK, OUTPUT);
+ digitalWrite(WLAN_SCK, LOW);
+ pinMode(WLAN_MISO, INPUT); // Unlike a regular Arduino, the Teensy 3.0's pins default to 'disabled'
+ // instead of 'input', so we need to explicitly set this here
}
}
void loop(void) {
+ char cmd;
Serial.println();
Serial.println(F("+-------------------------------------------+"));
@@ -212,13 +213,18 @@ void loop(void) {
Serial.println(F(" 7 - Show CC3000 information"));
Serial.println();
- while (!Serial.available()) {
- if (asyncNotificationWaiting) {
- asyncNotificationWaiting = false;
- AsyncEventPrint();
+ for (;;) {
+ while (!Serial.available()) {
+ if (asyncNotificationWaiting) {
+ asyncNotificationWaiting = false;
+ AsyncEventPrint();
+ }
+ }
+ cmd = Serial.read();
+ if (cmd!='\n' && cmd!='\r') {
+ break;
}
}
- char cmd = Serial.read();
switch(cmd) {
case '1':
View
2 ArduinoCC3000Core.cpp
@@ -11,7 +11,7 @@
* a TI MSP430, a PIC, etc. but the core library shouldn't have to be
* changed.
*
-* Version 1.0.1a
+* Version 1.0.1b
*
* Copyright (C) 2013 Chris Magagna - cmagagna@yahoo.com
*
View
31 ArduinoCC3000Core.h
@@ -2,7 +2,7 @@
*
* This file is part of the ArduinoCC3000 library.
-* Version 1.0.1a
+* Version 1.0.1b
*
* Copyright (C) 2013 Chris Magagna - cmagagna@yahoo.com
*
@@ -70,31 +70,22 @@
#define WLAN_IRQ 3 // Arduino pin connected to CC3000 WLAN_SPI_IRQ
#define WLAN_IRQ_INTNUM 1 // The attachInterrupt() number that corresponds
// to WLAN_IRQ
+#define WLAN_MOSI MOSI
+#define WLAN_MISO MISO
+#define WLAN_SCK SCK
#else
-#define WLAN_CS 2
-#define WLAN_EN 4
-#define WLAN_IRQ 3
-#define WLAN_IRQ_INTNUM 3
+#define WLAN_CS 25
+#define WLAN_MISO 26
+#define WLAN_IRQ 27
+#define WLAN_IRQ_INTNUM 27 // On the Teensy 3.0 the interrupt # is the same as the pin #
+#define WLAN_MOSI 28
+#define WLAN_SCK 29
+#define WLAN_EN 30
#endif
-// For some Arduino implemenations these aren't defined, so define them here
-
-#ifndef MISO
-#define MISO 12
-#endif
-
-#ifndef MOSI
-#define MOSI 11
-#endif
-
-#ifndef SCK
-#define SCK 13
-#endif
-
-
View
12 ArduinoCC3000SPI.cpp
@@ -7,7 +7,7 @@
* SPI for the Teensy 3.0) to send & receive data between the library
* API calls and the CC3000 hardware. Every
*
-* Version 1.0.1a
+* Version 1.0.1b
*
* Copyright (C) 2013 Chris Magagna - cmagagna@yahoo.com
*
@@ -131,19 +131,19 @@ byte SPIPump(byte data) {
receivedData <<= 1;
if (data & (1<<i)) {
- digitalWriteFast(MOSI, HIGH);
+ digitalWriteFast(WLAN_MOSI, HIGH);
}
else {
- digitalWriteFast(MOSI, LOW);
+ digitalWriteFast(WLAN_MOSI, LOW);
}
- digitalWriteFast(SCK, HIGH);
+ digitalWriteFast(WLAN_SCK, HIGH);
asm volatile("nop");
asm volatile("nop");
- digitalWriteFast(SCK, LOW);
+ digitalWriteFast(WLAN_SCK, LOW);
- if (digitalReadFast(MISO)) {
+ if (digitalReadFast(WLAN_MISO)) {
receivedData |= 1;
}
View
2 ArduinoCC3000SPI.h
@@ -7,7 +7,7 @@
* SPI for the Teensy 3.0) to send & receive data between the library
* API calls and the CC3000 hardware. Every
*
-* Version 1.0.1a
+* Version 1.0.1b
*
* Copyright (C) 2013 Chris Magagna - cmagagna@yahoo.com
*
View
24 README.md
@@ -13,11 +13,12 @@ reference download the TI documentation at:</p>
<p>http://software-dl.ti.com/ecs/simplelink/cc3000/public/doxygen_API/v1.11/html/index.html</p>
<pre>
-/**************************************************************************
+/***************************************************************************
+****************************************************************************
*
* ArduinoCC3000.ino - Initial version of the Arduino CC3000 library.
*
-* Version 1.0.1a
+* Version 1.0.1b
*
* Copyright (C) 2013 Chris Magagna - cmagagna@yahoo.com
*
@@ -28,6 +29,25 @@ reference download the TI documentation at:</p>
* Don't sue me if my code blows up your board and burns down your house
*
****************************************************************************
+****************************************************************************
+
+Changes in 1.0.1b:
+
+1. Remapped pins on the Teensy 3.0. Since hardware SPI isn't working
+ there's no reason to waste those pins - any will work. New mapping:
+
+ Teensy pin | CC3000 name | Name
+
+ D25 - SPI_CS - WLAN_CS
+ D26 - SPI_DOUT - WLAN_MISO
+ D27 - SPI_IRQ - WLAN_IRQ
+ D28 - SPI_DIN - WLAN_MOSI
+ D29 - SPI_CLK - WLAN_SCK
+ D30 - VBAT_SW_EN - WLAN_EN
+
+2. Changed serial input in loop to ignore newlines / returns
+
+****************************************************************************
Changes in 1.0.1a:
View
4 cc3000_common.cpp
@@ -1,8 +1,8 @@
/**************************************************************************
*
* This file is part of the ArduinoCC3000 library.
-
-* Version 1.0.1a
+*
+* Version 1.0.1b
*
* Copyright (C) 2013 Chris Magagna - cmagagna@yahoo.com
*
View
4 cc3000_common.h
@@ -1,8 +1,8 @@
/**************************************************************************
*
* This file is part of the ArduinoCC3000 library.
-
-* Version 1.0.1a
+*
+* Version 1.0.1b
*
* Copyright (C) 2013 Chris Magagna - cmagagna@yahoo.com
*
View
2 evnt_handler.cpp
@@ -2,7 +2,7 @@
*
* This file is part of the ArduinoCC3000 library.
*
-* Version 1.0.1a
+* Version 1.0.1b
*
* Copyright (C) 2013 Chris Magagna - cmagagna@yahoo.com
*
View
2 evnt_handler.h
@@ -2,7 +2,7 @@
*
* This file is part of the ArduinoCC3000 library.
*
-* Version 1.0.1a
+* Version 1.0.1b
*
* Copyright (C) 2013 Chris Magagna - cmagagna@yahoo.com
*
View
2 hci.cpp
@@ -2,7 +2,7 @@
*
* This file is part of the ArduinoCC3000 library.
*
-* Version 1.0.1a
+* Version 1.0.1b
*
* Copyright (C) 2013 Chris Magagna - cmagagna@yahoo.com
*
View
2 hci.h
@@ -2,7 +2,7 @@
*
* This file is part of the ArduinoCC3000 library.
*
-* Version 1.0.1a
+* Version 1.0.1b
*
* Copyright (C) 2013 Chris Magagna - cmagagna@yahoo.com
*
View
4 host_driver_version.h
@@ -1,8 +1,8 @@
/**************************************************************************
*
* This file is part of the ArduinoCC3000 library.
-
-* Version 1.0.1a
+*
+* Version 1.0.1b
*
* Copyright (C) 2013 Chris Magagna - cmagagna@yahoo.com
*
View
4 netapp.c
@@ -1,8 +1,8 @@
/**************************************************************************
*
* This file is part of the ArduinoCC3000 library.
-
-* Version 1.0.1a
+*
+* Version 1.0.1b
*
* Copyright (C) 2013 Chris Magagna - cmagagna@yahoo.com
*
View
4 netapp.h
@@ -1,8 +1,8 @@
/**************************************************************************
*
* This file is part of the ArduinoCC3000 library.
-
-* Version 1.0.1a
+*
+* Version 1.0.1b
*
* Copyright (C) 2013 Chris Magagna - cmagagna@yahoo.com
*
View
4 nvmem.c
@@ -1,8 +1,8 @@
/**************************************************************************
*
* This file is part of the ArduinoCC3000 library.
-
-* Version 1.0.1a
+*
+* Version 1.0.1b
*
* Copyright (C) 2013 Chris Magagna - cmagagna@yahoo.com
*
View
4 nvmem.h
@@ -1,8 +1,8 @@
/**************************************************************************
*
* This file is part of the ArduinoCC3000 library.
-
-* Version 1.0.1a
+*
+* Version 1.0.1b
*
* Copyright (C) 2013 Chris Magagna - cmagagna@yahoo.com
*
View
4 security.c
@@ -1,8 +1,8 @@
/**************************************************************************
*
* This file is part of the ArduinoCC3000 library.
-
-* Version 1.0.1a
+*
+* Version 1.0.1b
*
* Copyright (C) 2013 Chris Magagna - cmagagna@yahoo.com
*
View
2 security.h
@@ -2,7 +2,7 @@
*
* This file is part of the ArduinoCC3000 library.
*
-* Version 1.0.1a
+* Version 1.0.1b
*
* Copyright (C) 2013 Chris Magagna - cmagagna@yahoo.com
*
View
2 socket.c
@@ -2,7 +2,7 @@
*
* This file is part of the ArduinoCC3000 library.
*
-* Version 1.0.1a
+* Version 1.0.1b
*
* Copyright (C) 2013 Chris Magagna - cmagagna@yahoo.com
*
View
2 socket.h
@@ -2,7 +2,7 @@
*
* This file is part of the ArduinoCC3000 library.
*
-* Version 1.0.1a
+* Version 1.0.1b
*
* Copyright (C) 2013 Chris Magagna - cmagagna@yahoo.com
*
View
2 wlan.cpp
@@ -2,7 +2,7 @@
*
* This file is part of the ArduinoCC3000 library.
*
-* Version 1.0.1a
+* Version 1.0.1b
*
* Copyright (C) 2013 Chris Magagna - cmagagna@yahoo.com
*
View
2 wlan.h
@@ -2,7 +2,7 @@
*
* This file is part of the ArduinoCC3000 library.
*
-* Version 1.0.1a
+* Version 1.0.1b
*
* Copyright (C) 2013 Chris Magagna - cmagagna@yahoo.com
*

0 comments on commit 38154b4

Please sign in to comment.
Something went wrong with that request. Please try again.