Jump to content

Search the Community

Showing results for tags 'cc3200'.

More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


  • News
    • Announcements
    • Suggestions
    • New users say Hi!
  • Spotlight!
    • Sponsor Spotlight
    • Sponsor Giveaways
  • Energia
    • Energia - MSP
    • Energia - TivaC/CC3XXX
    • Energia - C2000
    • Energia Libraries
  • MSP Technical Forums
    • General
    • Compilers and IDEs
    • Development Kits
    • Programmers and Debuggers
    • Code vault
    • Projects
    • Booster Packs
    • Energia
  • Tiva-C, Hercules, CCXXXX ARM Technical Forums
    • General
    • SensorTag
    • Tiva-C, Hercules, CC3XXX Launchpad Booster Packs
    • Code Vault
    • Projects
    • Compilers and IDEs
    • Development Kits and Custom Boards
  • Beagle ARM Cortex A8 Technical Forums
    • General
    • Code Snippets and Scripts
    • Cases, Capes and Plugin Boards
    • Projects
  • General Electronics Forum
    • General Electronics
    • Other Microcontrollers
  • Connect
    • Embedded Systems/Test Equipment Deals
    • Buy, Trade and Sell
    • The 43oh Store
    • Community Projects
    • Fireside Chat
  • C2000 Technical Forums
    • General
    • Development Kits
    • Code Vault
    • Projects
    • BoosterPacks


There are no results to display.

Find results in...

Find results that contain...

Date Created

  • Start


Last Updated

  • Start


Filter by number of...


  • Start



Website URL





Found 183 results

  1. hello, i'm new here and confused where i should place my redbearlab CC3200 wifi mini topics ? my first question would be if there is any WS2812 (neopixel) support for the wifi mini ? thanks
  2. RedBear Labs WIFI mini CC3200 board I tried compiling the blink example and it compiles fine, but fails to upload. Tried using both Windows 7 32bit environment and Ubuntu 14.4 64bit environment. I have installed all the required drivers on Windows. I also had to copy the ftd2xx,dll to the folder where the C3200Prog.exe file is. Received error on both platforms is : Open UART COM1 Can't open device Failed to open uart COM1 Could not open UART COM1 The board seems to work ok because I can connect to it via WIFI. What do I need to do to upload the compiled file. I would prefer a Linux solution.
  3. As an alternative to SmartConfig I want to use the inbuilt web server to allow the user to enter his/her network details I also want to be able to allow a push button type WPS function There are TI examples provisioning_ap and provisioning_wps, essentially, I want to port these to Energia starting with the AP my simplistic attempts have not yielded any results. I flashed the provisioning_ap example to my launchpad and also to a custom board and it worked as advertised. I then flashed my Energia sketch expecting it to trigger the callback. I can log into the Energia AP and the TI web pages are displayed but it didn't print my message. I have read the sections in the SWRU368A.PDF and looked at the sample code but the TI examples are so verbose and often seem to have unnecessary levels of abstraction (especially for an example) So can anyone offer some suggestions on how to use the inbuilt web server with Energia? This is the code/sketch because someone is going to ask to see it. #include <WiFi.h> #include <WiFiClient.h> #include <WiFiServer.h> #include <WiFiUdp.h> // AP Provisioning const char ssid[] = "MyEnergiaAP"; const char wifipw[] = "password"; long retVal = -1; int i; void setup() { Serial.begin(115200); Serial.print("Setting up Access Point named: "); Serial.println(ssid); Serial.print("AP uses WPA and password is: "); Serial.println(wifipw); WiFi.beginNetwork((char *)ssid, (char *)wifipw); while (WiFi.localIP() == INADDR_NONE) { // print dots while we wait for the AP config to complete Serial.print('.'); delay(300); } Serial.println(); Serial.println("AP active.\r\n"); } void loop() { } void SimpleLinkHttpServerCallback(SlHttpServerEvent_t *pSlHttpServerEvent, SlHttpServerResponse_t *pSlHttpServerResponse) { Serial.println("I'm Here SimpleLinkHttpServerCallback"); } Trevor.
  4. I'm getting very frustrated with this CC3200MOD, and the CC3200 in general. First it started with the A0 analog channel always reading 4096 but now on to some GPIO problems. This should be fairly straight forward but apparently they make everything difficult, so I don't know what to say. I have made a custom PCB for using the CC3200MOD. Its supposed to read the 4 ADCs, 3 for accelerometer, which is working great, 1 for an analog microphone, which isn't working at all, but I've given up on it and going to just mux with one of the 3 working ones. Now I have 3 LEDs on the board for general LED applications. These LEDs are on pins(pins of the MOD device) 6,7,8, which correspond to (according to PinMux Tool) GPIO 15,16,17. So ideally I should be able to just pinMode the pins to OUTPUT, and set them HIGH to have the LEDs working. I should mention right now that I have two populated boards both have issues in the same way. So if I was to do this in Energia it would just be: pinMode(15,OUTPUT); pinMode(16,OUTPUT); pinMode(17,OUTPUT); digitalWrite(15,HIGH); digitalWrite(16,HIGH); digitalWrite(17,HIGH); So this is where it gets strange, only 1 LED turns on, only GPIO16. But here is the kicker, GPIO16 turns on only when I enable GPIO15!! What the heck is going on, I think there is an issue with Energia incorrectly labelling pins but I cannot find the solution. I think this is also the issue with the analog pin, but I want to sort this out first. Does anyone know what is going on? Ill break it down: GPIO16 turns on when I digitalWrite(15,HIGH) GPIO15 and GPIO17 don't turn on at all and get some weird low voltage on them. Using Energia
  5. I'm working with the CC3200XL and the Grove starter kit. It contains a PIR sensor. When I try to run the sample, it complains about a missing file. I can't find the file anywhere and don't even understand why Energia is looking for it. But what I need to know is, where can I find the source and header for the file. java.io.FileNotFoundException: C:\Users\Dan\AppData\Local\Temp\build5629486675398969734.tmp\pir_motion_sensor.cpp (The system cannot find the path specified) at java.io.FileOutputStream.open(Native Method) at java.io.FileOutputStream.<init>(FileOutputStream.java:179) at java.io.FileOutputStream.<init>(FileOutputStream.java:131) at processing.app.preproc.PdePreprocessor.writePrefix(PdePreprocessor.java:142) at processing.app.Sketch.preprocess(Sketch.java:1430) at processing.app.Sketch.preprocess(Sketch.java:1345) at processing.app.Sketch.build(Sketch.java:1624) at processing.app.Sketch.exportApplet(Sketch.java:1655) at processing.app.Sketch.exportApplet(Sketch.java:1641) at processing.app.Editor$DefaultExportHandler.run(Editor.java:2521) at java.lang.Thread.run(Thread.java:619) processing.app.debug.RunnerException: Build folder disappeared or could not be written at processing.app.Sketch.preprocess(Sketch.java:1437) at processing.app.Sketch.preprocess(Sketch.java:1345) at processing.app.Sketch.build(Sketch.java:1624) at processing.app.Sketch.exportApplet(Sketch.java:1655) at processing.app.Sketch.exportApplet(Sketch.java:1641) at processing.app.Editor$DefaultExportHandler.run(Editor.java:2521) at java.lang.Thread.run(Thread.java:619) Here's the example file: /* Grove PIR Motion Sensor (Passive Infrared) The following sketch demonstrates a simple application of sensing motion. When someone moves in the sensor's detecting range, it will output HIGH through its SIG pin and the LED will turn on. Otherwise, it will output LOW. Then you can use it to detect the motion of people. The circuit: * Grove PIR Motion Sensor attached to Pin 7 (J12 plug on Grove Base BoosterPack) * Note: Position the Motion Sensor's jumper on N_Retrig to ensure the light stays on while motion is present This example code is in the public domain. http://www.seeedstudio.com/depot/Grove-PIR-Motion-Sensor-p-802.html */ /* Macro Define */ #define PIR_MOTION_SENSOR 7 /* sig pin of the PIR sensor */ #define LED RED_LED /* LED */ /* the setup() method runs once, when the sketch starts */ void setup() { pinMode(PIR_MOTION_SENSOR, INPUT); /* declare the sig pin as an INPUT */ pinMode(LED, OUTPUT); /* declare the LED pin as an OUTPUT */ digitalWrite(LED, LOW); } /* the loop() method runs over and over again */ void loop() { if(isMotionDetected()) { digitalWrite(LED, HIGH); /* if we detect movement, turn on the LED */ } else { digitalWrite(LED, LOW); /* no movement, turn off the light */ } } /* check if motion has been detected */ boolean isMotionDetected() { int sensor_val = digitalRead(PIR_MOTION_SENSOR); /* read sig pin */ if(sensor_val == HIGH) { return true; /* motion detected */ } else { return false; /* no motion detected */ } }
  6. I have a Dig Pot the TPL0501 by Texas Instruments that I am trying to control with a micro controller. Link Here: http://www.ti.com/lit/ds/slis136a/slis136a.pdf I have been able to successfully control this with my CC3200 and the output signals look like Photo 1 attatched. I have since decided I want to do this with my MSP432 but I am not able to get it to work. The same code should work for each I assume. The output signals I am getting for the MSP432 are shown in photo 2. I have tried changing the mode but nothing seems to help. Any ideas? My code is listed below: #include <SPI.h> const int SS = 18; uint8_t value = 150; void setup() { pinMode(SS, OUTPUT); SPI.begin(); digitalWrite(SS, HIGH); SPI.setBitOrder(MSBFIRST); SPI.setDataMode(SPI_MODE3); SPI.setClockDivider(SPI_CLOCK_DIV32); } void loop() { digitalPotWrite(value); delay(100); } int digitalPotWrite(int x) { digitalWrite(SS, LOW); SPI.transfer(x); digitalWrite(SS, HIGH); }
  7. Hi All, I have a problem with the watchdog timer reset. I am using Energia with a CC3200 on a custom board but the same issue occurs with a Launchpad. I have cut down the code to demonstrate the problem it is part of a much larger project which has a process control element and needs a watchdog timer. I have cobbled the demo together from all over the place so there are many different coding styles (smells) used - sorry It is spread over 2 tabs The full project has 30. From my reading, the reset functions are unreliable so TI suggests, test if the system has recovered from a watchdog reset then hibernate the CC3200. Then wake it up shortly after to ensure a clean reset. This seems to work until you connect to a network. I have tried to exit the network connection gracefully but I might have missed a step, my knowledge of the underlying network stuff is not so good. The demo code started from the scan network demo that installs with Energia. The watchdog stuff comes from the TI SDK. When recovering from the reset the program or processor hangs when you try to run WiFiInit() but not all the time. I have tried different delays in different places to let the Network processor catch up but no success This program is set up to continually time out the watchdog so there is no need to tell me that I am not servicing the watchdog. It would be great if someone can offer some insight into how to solve this Trevor Tab named WatchdogTest #include <WiFi.h> #include <WiFiClient.h> #include <WiFiServer.h> #include <WiFiUdp.h> #include "driverlib\prcm.h" #define debug 1 #define Buzzer RED_LED // GPIO24 pin 17 #define BEEP 100 unsigned long ulResetCause; // moved to wdt.ino int WiFiDisconnectErr; uint8_t watchdogResetFlag; uint8_t watchdogIntClearFlag; uint32_t g_ulWatchdogCycles=0; uint32_t g_bFeedWatchdog=1; // your network name also called SSID char ssid[33] = "YourSSID"; // your network password char password[65] = "YourPassword"; void setup() { pinMode(Buzzer,OUTPUT); // for the purpposes of this demo the buzzer is redirected to the red LED on the launchpad board digitalWrite(Buzzer, LOW); //sound a chirp on the buzzer digitalWrite(Buzzer, HIGH); delay (BEEP); digitalWrite(Buzzer, LOW); Serial.begin(115200); Serial.println("Ok..."); recoverFromWatchdog(); wdt(); WiFi.init(); Serial.println(WiFi.firmwareVersion()); // Print WiFi MAC address: printMacAddress(); // scan for existing networks: Serial.println("Scanning available networks..."); listNetworks(); // attempt to connect to Wifi network: if (debug)Serial.print("Attempting to connect to Network named: "); // print the network name (SSID); if (debug)Serial.println(ssid); // Connect to WPA/WPA2 network. Change this line if using open or WEP network: WiFi.begin(ssid, password); while ( WiFi.status() != WL_CONNECTED) { // print dots while we wait to connect if (debug)Serial.print("."); delay(300); } if (debug)Serial.println("\nYou're connected to the network"); if (debug)Serial.println("Waiting for an ip address"); while (WiFi.localIP() == INADDR_NONE) { // print dots while we wait for an ip addresss if (debug)Serial.print("."); delay(300); } // you're connected now, so print out the status printWifiStatus(); } void loop() { uint32_t slowClockVal; if (watchdogResetFlag) { watchdogResetFlag =0; if (WiFi._connecting) { WiFiDisconnectErr = WiFi.disconnect(); Serial.println(WiFiDisconnectErr); delay(50); WiFiDisconnectErr = WiFi.disconnect(); Serial.println(WiFiDisconnectErr); delay(50); } } if (watchdogIntClearFlag) { watchdogIntClearFlag =0; Serial.print("Clear WD int "); Serial.println(g_ulWatchdogCycles); Serial.print("Slow Clock Value ....... "); slowClockVal = (uint32_t)PRCMSlowClkCtrGet(); Serial.println(slowClockVal); digitalWrite(Buzzer, HIGH); delay (BEEP); digitalWrite(Buzzer, LOW); } } void printMacAddress() { // the MAC address of your Wifi byte mac[6]; // print your MAC address: WiFi.macAddress(mac); Serial.print("MAC: "); Serial.print(mac[5], HEX); Serial.print(":"); Serial.print(mac[4], HEX); Serial.print(":"); Serial.print(mac[3], HEX); Serial.print(":"); Serial.print(mac[2], HEX); Serial.print(":"); Serial.print(mac[1], HEX); Serial.print(":"); Serial.println(mac[0], HEX); } void listNetworks() { // scan for nearby networks: Serial.println("** Scan Networks **"); int numSsid = WiFi.scanNetworks(); if (numSsid == -1) { Serial.println("Couldn't get a wifi connection"); while (true); } // print the list of networks seen: Serial.print("number of available networks:"); Serial.println(numSsid); // print the network number and name for each network found: for (int thisNet = 0; thisNet < numSsid; thisNet++) { Serial.print(thisNet); Serial.print(") "); Serial.print(WiFi.SSID(thisNet)); Serial.print("\tSignal: "); Serial.print(WiFi.RSSI(thisNet)); Serial.print(" dBm"); Serial.print("\tEncryption: "); printEncryptionType(WiFi.encryptionType(thisNet)); } } void printEncryptionType(int thisType) { // read the encryption type and print out the name: switch (thisType) { case ENC_TYPE_WEP: Serial.println("WEP"); break; case ENC_TYPE_TKIP: Serial.println("WPA"); break; case ENC_TYPE_CCMP: Serial.println("WPA2"); break; case ENC_TYPE_NONE: Serial.println("None"); break; case ENC_TYPE_AUTO: Serial.println("Auto"); break; } } void printWifiStatus(void) { // print the SSID of the network you're attached to: if (debug)Serial.print("Network Name: "); if (debug)Serial.println(WiFi.SSID()); // print your WiFi shield's IP address: IPAddress ip = WiFi.localIP(); if (debug)Serial.print("IP Address: "); if (debug)Serial.println(ip); } Tab named wdt #include "driverlib\wdt.h" #include "driverlib\utils.h" #include "driverlib\prcm.h" //unsigned long ulResetCause; void recoverFromWatchdog(void) { // This is here to clean up after a watchdog reset // Get the reset cause // ulResetCause = PRCMSysResetCauseGet(); // // If watchdog triggered reset request hibernate // to clean boot the system // if( ulResetCause == PRCM_WDT_RESET ) { HIBEntrePreamble(); MAP_PRCMOCRRegisterWrite(0,1); MAP_PRCMHibernateWakeupSourceEnable(PRCM_HIB_SLOW_CLK_CTR); MAP_PRCMHibernateIntervalSet(330); MAP_PRCMHibernateEnter(); } } void wdt(void) // this is the system watchdog { MAP_PRCMPeripheralClkEnable(PRCM_WDT, PRCM_RUN_MODE_CLK); MAP_WatchdogUnlock(WDT_BASE); MAP_WatchdogIntRegister(WDT_BASE,WatchdogIntHandler); MAP_WatchdogReloadSet(WDT_BASE,40000000*5); //35 seconds 40000000 is half the clock frequency 80 MHz /2 MAP_WatchdogEnable(WDT_BASE); } void wdtReset(void) // this is the software reset { MAP_WatchdogUnlock(WDT_BASE); MAP_WatchdogReloadSet(WDT_BASE,40000000 * 2); // 2 seconds give the system time to close network connections } //***************************************************************************** // //! Mandatory Configuration to put the PM into safe state before entering hibernate //! //! \param None //! //! \return None // //***************************************************************************** static inline void HIBEntrePreamble() { HWREG(0x400F70B8) = 1; UtilsDelay(800000/5);//delay(2); HWREG(0x400F70B0) = 1; UtilsDelay(800000/5);//delay(2); HWREG(0x4402E16C) |= 0x2; UtilsDelay(800);//delay(1); HWREG(0x4402F024) &= 0xF7FFFFFF; } //***************************************************************************** // //! The interrupt handler for the watchdog timer //! //! \param None //! //! \return None // //***************************************************************************** void WatchdogIntHandler(void) { // // If we have been told to stop feeding the watchdog, return immediately // without clearing the interrupt. This will cause the system to reset // next time the watchdog interrupt fires. // if(!g_bFeedWatchdog) { return; } // // After 10 interrupts, switch On LED6 to indicate system reset // and don't clear watchdog interrupt which causes system reset // if(g_ulWatchdogCycles >= 3) { // if (client)client.stop(); watchdogResetFlag++; MAP_UtilsDelay(800000); return; } // // Clear the watchdog interrupt. // MAP_WatchdogIntClear(WDT_BASE); watchdogIntClearFlag++; // // Increment our interrupt counter. // g_ulWatchdogCycles++; }
  8. Hello all, I'm having trouble getting my digital pot to respond to the CC3200. Could someone please take a look at my code and let me know where I'm going wrong? Thanks. DataSheet for the digital pot; http://www.ti.com/product/tpl0501-100 #include <SPI.h> const int SS = 8; uint8_t value; int volts = 0; void setup() { Serial.begin(9600); pinMode(SS, OUTPUT); SPI.begin(); delay(100); } void loop() { for(value = 0; value < 256; value += 20) { digitalWrite(SS, LOW); delay(10); SPI.transfer(value); delay(10); digitalWrite(SS, HIGH); delay(100); } }
  9. I have a CC3200 LAUNCHPAD and I'm using Code Composer Studio v6.1 with an Energia example. I try to build the WifiWebClient example and the lpcc3200_core library keeps giving me grief. It says that it can't find some header files but they're clearly in the project tree. Any thoughts on why this might be happening?
  10. Hello Everyone, I have a simple email client in my CC3200 launchpad. I need to get data from serial which could be as large as 10 mega bytes. I print the data as chunks of 1024 bytes (1kb) in a loop until I get all the data sent . The problem is that each 1Kb takes about 5 seconds. When I send an email that is 1 mega bytes. It takes about two hours! the code works fine but the slowness is the biggest problem. According to the datasheet, the cc3200 is cabable of 12 Mbps rate. One thing to node, when I fetch data from the internet or from imap, it's so fast and no issue it all when downloading anything. The problem happens when I write to smtp server. inside the while loop below, you find the normal println I use to send data over smtp to gmail. I hope you help me finding a solution for this problem. if (socket.sslConnect("smtp.gmail.com", 465)) { // user & pass -> base64 smtpLogin(Username_buff,Password_buff,Username_length,Password_length); socket.print("MAIL FROM: <"); socket.print(Username); socket.println(">"); socket.print("RCPT TO: <"); socket.print(TO); socket.println(">"); socket.println("DATA"); socket.print("Subject: "); socket.println(SUBJECT); while (Serial.available) { unsigned long time1 = millis(); // The line below takes about 5 seconds for each 1024 bytes (1 kb) socket.println(inputString); unsigned long time2 = millis(); Serial.print(time2 - time1); Serial.println(" milliseconds - OK"); } socket.println("."); Serial.println("Sending..."); }
  11. I am working with a simplified version of the Galaxia_Task example. For some reason the rtosSetup() function does not seem to be firing. My code: TaskTest.ino #include "Energia.h" #include "rtosGlobals.h" void setup() { Serial.begin(115200); } void loop() { Serial.println("Hello from test loop"); delay(1000); } rtosGlobals.h #include "Energia.h" #include "Task.h" void functionTask(); Task myTask; void functionTask() { while(true) { Serial.println("hello from task"); delay(500); } } void rtosSetup() { myTask.begin(functionTask, Task_numPriorities - 1); } The only serial output I get is
  12. Hi there I have been testing CC3200 launchpad for IOT applications. Have been able to sucessfully post temperature data message using mqtt to iot.eclipse.org:1883 and read on Bluemix. Having difficulties to post data to SAP hana cloud platform that accepts HTTP Push with authentication header in json format. Have made setting on SAP side and tested using Postman (Chrome) and Hurl to push HTTP messages. Does any one have an idea on the code using Energia. Thanks Sunny
  13. The feature list for the redbear cc3200 includes a hardware crypto engine with aes functionality. I am having a hard time figuring out how to access those libraries. Can someone point me in the right direction or perhaps to an example of usage?
  14. Hi, I 've made a new custom cc3200 board with the same 8Mbit SFlash memory. The Chip used is CC3200 R1M2, new ordered one from TI. So I've assembled everything and voltages across inductors seems to be same as per the ones recommended TI. After I connect SOP2 jumper as like that in launchpad and Try to upload this error shows up.
  15. Hi everyone. I just got a cc3200 launchpad and am coding on a Mac with Energia. I'm impressed with what this setup can do. I'm trying to get a handle on how on how to how to use the timer functions to create one-shots or functions called at specific intervals. I can find references in Energia.h and driverlib/timer.h but no docs or samples. If anyone has any tips on getting started please pass them on, I'd appreciate it. Looking forward to coding... - eric
  16. Hello all. I'm new to CC3200 and trying to develop an application for the launchpad using a Timer. Energia has the timer.h module, and I've found TI's documentation for the General Purpose Timer module, along with a few code snippets. My code dies when calling TimerConfigure(base, type). I think that this is because the timer peripherals need need to be enabled as a system peripheral before they can be manipulated. It looks like SysCtlPeripheralEnable(SYSCTL_PERIPH_TIMERx) is what you'd call before calling the TimerXxx functions. However, the cc3200 driverlib doesn't have a sysctl.h (or .c), and thus the method is not available. Is there an alternate approach to using the timer facilities? Thanks for any insights! - eric
  17. I've got a brand new CC3200-LAUNCHXL, Rev 4.1. I'm running the latest stable release on Energia on Win8 64 bit. I compiled the APWatchConnectDisconnect example for testing. I can connect and disconnect a single client just fine. However, I can't figure out how to configure it to accept multiple connections -- it accepts a single connection and then rejects all others. What is going on here? -p
  18. dear all: we use wificlient library for cc3200 launchpad . how do we get remote ip address ? arduino ethernet library have getRemoteIP method. but wificlient library is no. ###############code############################## WiFiServer localserver = WiFiServer(localPort); WiFiClient socketclient; socketclient = localserver.available(); socketclient.getRemoteIP(clientip); ###############code############################## #################compile error output################ 'class WiFiClient' has no member named 'getRemoteIP' #################compile error output################
  19. I am trying to upload a sketch but am unable to, as there is no way to set the port, as the Serial Port option is greyed out in the Tools menu. I am running OSX 10.9.5, my device (CC3200 LaunchPad) is being recognised on the USB bus (see details below). USB <-> JTAG/SWD: Product ID: 0xc32a Vendor ID: 0x0451 (Texas Instruments) Version: 5.00 Serial Number: cc3200 Speed: Up to 12 Mb/sec Manufacturer: FTDI Location ID: 0xfa130000 / 6 Current Available (mA): 500 Current Required (mA): 500 I have tried installing the VCP drivers from FTDI. I am using the latest version of Energia. Any other suggestions?
  20. kael

    CCS stupid error

    Hi everyone, I'm trying to fix a bug on CCS. As attached filed, we can recognize that 'SlNetAppEvent_t' was defined. But CCS noticed some confusing errors. Plz help to fix. Thanks in advanced.
  21. Hi, I am trying to get the ADC sample timestamp on Energia, but I can not figure it out how it works. From the TI API I know that the ADC data saved on the register is made by two parts. bits [13:0] : ADC sample bits [31:14]: time stamp per ADC sample So I took the Energia library. From <driverlib/adc.h> and I found a method that returns only the time stamp. //***************************************************************************** // //! Gets the current value of ADC internal timer //! //! \param ulBase is the base address of the ADC //! //! This function the current value of 17-bit ADC internal timer //! //! \returns Return the current value of ADC internal timer. // //***************************************************************************** unsigned long ADCTimerValueGet(unsigned long ulBase) { return(HWREG(ulBase + ADC_O_adc_timer_current_count)); } So I have modified the wiring_analog.c library: uint16_t analogRead(uint8_t pin) { uint16_t channel, val; uint16_t pinNum = digitalPinToPinNum(pin); switch(pinNum) { case PIN_57: {channel = ADC_CH_0;}break; case PIN_58: {channel = ADC_CH_1;}break; case PIN_59: {channel = ADC_CH_2;}break; case PIN_60: {channel = ADC_CH_3;}break; default: return 0; } while(ADCFIFOLvlGet(ADC_BASE, channel)) { // flush the channel's FIFO if not empty ADCFIFORead(ADC_BASE, channel); } PinTypeADC(pinNum,0xFF); ADCChannelEnable(ADC_BASE, channel); ADCTimerConfig(ADC_BASE,2^17); ADCTimerEnable(ADC_BASE); ADCEnable(ADC_BASE); while(!ADCFIFOLvlGet(ADC_BASE, channel)); val = ADCFIFORead(ADC_BASE, channel) & 0x3FFF; // ***** TIME STAMP FIELD **** timestamp = ADCTimerValueGet(ADC_BASE); // ***** TIME STAMP FIELD **** ADCDisable(ADC_BASE); ADCChannelDisable(ADC_BASE, channel); ADCTimerDisable(ADC_BASE); val = val >> 2; return val; } // Return the ADC sample time stamp unsigned long ADCGetTime() { return timestamp; } And this is my test sketch #include <wiring_analog.c> int sensorPin = 2; // select the input pin for the potentiometer uint16_t long sensorValue[5] = {0}; // variable to store the value coming from the sensor unsigned long time[5] = {0}; unsigned long m = 0; unsigned int seconds = 0; unsigned int minutes = 0; unsigned int hours = 0; void setup() { Serial.begin(115200); } void loop() { // read the value from the sensor: for (int i = 0; i< 5; i++) { sensorValue [i] = analogRead(sensorPin); time[i] = ADCGetTime(); delay(1); } for(int i = 0; i < 5; i++) { minutes = ( time[i] / 1000 / 60); seconds = ( time[i] / 1000) % 60; m = ( time[i] % 100); Serial.println("ADC VALUE: "); Serial.print(sensorValue[i]); Serial.print(" --- TIME STAMP: "); Serial.print(minutes); Serial.print(":"); Serial.print(seconds); Serial.print(":"); Serial.println(m); Serial.print("\n"); } delay(5000); } The problem is that the value of the variable time do not change. It's always the same. What is wrong with my test sketch? How can I access to the time stamp of my samples? Thank you in advance.
  22. Hi, I'm using a cc3200 Launchpad. On my first run, I provided the SSID and Passphrase to connect to my router as shown below: char ssid[] = "testrouter"; char passphrase[] = "testpassphrase"; WiFi.begin(ssid, passphrase); I've noticed that there was a recent addition into the WiFi.begin(ssid, pass) method in the WiFi.cpp file which seems to add the SSID and Passphrase into its own profile. if (iRet == 0) { sl_WlanProfileAdd(ssid, NameLen, 0, &SecParams, 0, 6, 0); _connecting = true; return status(); } else { return WL_CONNECT_FAILED; } I'm having issues when I'm trying to retrieve the profile using the "int sl_WlanProfileGet()" method. I'm able to retrieve the SSID but unable to retrieve the Passphrase correctly. Following is the code I'm using to retrieve the SSID and Passphrase: char pName[32]; int pNameLen; unsigned char pMacAddr[8]; SlSecParams_t *pSecParams; SlGetSecParamsExt_t *pSecExtParams; unsigned long pPriority; sl_WlanProfileGet(0, pName, &pNameLen, pMacAddr, pSecParams, pSecExtParams, &pPriority); // index 0 pName[pNameLen] = '\0'; pSecParams->Key[pSecParams->KeyLen] = '\0'; Serial.println(pName); // prints "testrouter" -CORRECT Serial.println(pSecParams->Type); // prints 2 -CORRECT (SL_SEC_TYPE_WPA) Serial.println(pSecParams->Key); // prints "" -WRONG WiFi.begin(pName, pSecParams->Key); // doesn't connect successfully Please let me know if I'm doing something wrong or if there is another way to connect to a past profile? Thanks! Edit: My actual problem is that, if I do Smartconfig and I successfully send the SSID and Passphrase to the CC3200 and it connects to WiFi router but the CC3200 powers OFF and then powers ON again, how do I make it connect to the last known SSID and passphrase without having to do Smartconfig again?
  23. Greetings, I'm almost at the end of my project with my CC3200 sensor board, and I want to thank again people who helped me here, for the SFLS lib and my printf issues. From the begining with energia, I had (minor) issues of bricking my board with no real understanding of WHAT was causing it. I finally took (had) the time to narrow it down to a very specific scheme, so I'd like to pick your brains about it. background : - started with a launchpad (of the first revisions), tried different service pack, never got issues. That's only when I started with my own board and the CC3200 mod that I had this problem. - we like to work with static IP with our sensor installs (though we might also use static / reserved addr with DHCP) as we need our programs to talk to specific / individual boards using their IP address. While it's not difficult to setup static DHCP, it becomes attached to the router itself, which makes part replacement and modularity more complicated for what we need. - The problem persists with energia 0013. As its loader isn't compatible with the CC3200 MOD, I've made a customized version of the energia dev package that uses ALL the 0014 source file, loader and even the GCC version but keeps the 0013 software, and it bricks too. symptoms : - load up the program which configures the system with static IP and connects to the ssid (no security). - reboot the board, starts normally & connects. Display of the local IP and current net is ok - a UDP packet has been setup, the program sends a packet every xx ms ** IF the AP is disconnected from the LAN or if the recipient IP (destIP in the code below) isn't found or if no packet can be sent (successfully I assume), then further reboot of the board locks up the program when it reaches the WIFI.begin or anything related to the wifi stack (it seems.). Re uploading the program doesnt' change a thing. The only way to get it to work again is to use uniflash to format the FLASH. Flashing the mcuimg via uniflash produces the same thing, so it's not linked to the cc3200prog in energia vs uniflash. Flashing the board with uniflash produces the same : board boots, connect but if the destination computers isn't seen, the board stalls on the next reboot. ** IF the recipient IP exist and is found on the network and if at least ONE UDP packet is sent it's fine. If the AP on which the CC3200 mod connects to is there and connected to the destination computer but NO UDP packet is sent (commented in the main / loop) then it bricks too. ** IF I use DHCP, it works all the time, never got issues Once at least one packet has been sent to the destination IP / computer, further reboot will always work even if the destination computer isn't reachable and further updates of the code will always work. Sometimes, even after I got it right, I still have to format the flash with uniflash and start over. My guess is that my increasing program size ends overwriting things in the flash. I don't know the details, but I'm afraid the WIFI internals store profiles or non volatile data that energia / cc3200prog never deals with. When in uniflash, the mcuimg is always written first then additional system files and also the new profile / config group files that I haven't messed with. I initially thought that I had to re format / re organize the flash from time to time as my program was growing and was altering somehow the other files. Now, I don't even re upload / update the config group after erasing the flash and re uploading my program and I still can reproduce the behavior above, if a packet is sent ok on the first boot, further boots work, otherwise, it's bricked. In the code below, I've even tried removing the wificlient and wifiudp libs and calls: it would brick each time (on the second reboot after upload) as the program would not send a thing. I know that most people don't use static IP... so maybe this issue is new to most people. Or I've simply forgotten something super important in the code. I've narrowed the program to its simplest form, very close to the tutorials. Ideas ? thanks #include <stdio.h> #include <SPI.h> #include <WiFi.h> #include <WiFiClient.h> #include <WiFiUdp.h> // your network name also called SSID char ssid[] = "myssid"; IPAddress LocalIP(192,168,1,40); IPAddress SubnetMask(255,255,255,0); IPAddress GatewayIP(192,168,1,1); IPAddress DestIP(192,168,1,100); uint16_t DestPort = 8888; WiFiUDP MyPacket; void setup() { //Initialize serial and wait for port to open: Serial.begin(115200); Serial.println("Booo"); // attempt to connect to Wifi network: Serial.print("connecting to: "); // print the network name (SSID); Serial.println(ssid); // If fixed IP WiFi.config(LocalIP, GatewayIP, GatewayIP, SubnetMask); //WiFi.config(LocalIP); WiFi.begin(ssid); while ( WiFi.status() != WL_CONNECTED) { // print dots while we wait to connect Serial.print("."); delay(300); } Serial.println("\nConnected to the network"); // If DHCP /*Serial.println("Waiting for an ip address"); while (WiFi.localIP() == INADDR_NONE) { // print dots while we wait for an ip addresss Serial.print("."); delay(300); } Serial.println("\nIP Address obtained");*/ // you're connected now, so print out the status printCurrentNet(); printWifiData(); MyPacket.begin(8888); MyPacket.beginPacket(DestIP, DestPort); } void loop() { MyPacket.write((uint8_t*)"/a\0\0,iiiiiiiii\0\0", 52); MyPacket.endPacket(); delay(5); } void printWifiData() { // print your WiFi IP address: IPAddress ip = WiFi.localIP(); Serial.print("IP Address: "); Serial.println(ip); // print your MAC address: byte mac[6]; WiFi.macAddress(mac); Serial.print("MAC address: "); Serial.print(mac[0], HEX); Serial.print(":"); Serial.print(mac[1], HEX); Serial.print(":"); Serial.print(mac[2], HEX); Serial.print(":"); Serial.print(mac[3], HEX); Serial.print(":"); Serial.print(mac[4], HEX); Serial.print(":"); Serial.println(mac[5], HEX); // print your subnet mask: IPAddress subnet = WiFi.subnetMask(); Serial.print("NetMask: "); Serial.println(subnet); // print your gateway address: IPAddress gateway = WiFi.gatewayIP(); Serial.print("Gateway: "); Serial.println(gateway); } void printCurrentNet() { // print the SSID of the network you're attached to: Serial.print("SSID: "); Serial.println(WiFi.SSID()); // print the received signal strength: long rssi = WiFi.RSSI(); Serial.print("signal strength (RSSI):"); Serial.println(rssi); // print the encryption type: byte encryption = WiFi.encryptionType(); Serial.print("Encryption Type:"); Serial.println(encryption, HEX); }
  24. I'm posting in the RedBearLab support as well - but I wanted to post the error I'm getting from Energia in the forums to see if anyone can help. I got the software from RedBearLab installed as well as the MBED serial driver. When I try to upload - I just get "upload failed" with no other detail. I tried Energia 0014 and 0015. OS is Windows 7 Professional, x64. This is the error I get when I try to send something via Serial Monitor. I'm hoping this might be helpful as to why my uploads fail. java.io.IOException: Bad file descriptor in nativeDrain at gnu.io.RXTXPort.nativeDrain(Native Method) at gnu.io.RXTXPort$SerialOutputStream.flush(RXTXPort.java:1201) at processing.app.Serial.write(Serial.java:494) at processing.app.Serial.write(Serial.java:516) at processing.app.SerialMonitor.send(SerialMonitor.java:201) at processing.app.SerialMonitor.access$100(SerialMonitor.java:32) at processing.app.SerialMonitor$4.actionPerformed(SerialMonitor.java:97) at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1995) at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2318) at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:387) at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:242) at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:236) at java.awt.Component.processMouseEvent(Component.java:6263) at javax.swing.JComponent.processMouseEvent(JComponent.java:3267) at java.awt.Component.processEvent(Component.java:6028) at java.awt.Container.processEvent(Container.java:2041) at java.awt.Component.dispatchEventImpl(Component.java:4630) at java.awt.Container.dispatchEventImpl(Container.java:2099) at java.awt.Component.dispatchEvent(Component.java:4460) at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4574) at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4238) at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4168) at java.awt.Container.dispatchEventImpl(Container.java:2085) at java.awt.Window.dispatchEventImpl(Window.java:2475) at java.awt.Component.dispatchEvent(Component.java:4460) at java.awt.EventQueue.dispatchEvent(EventQueue.java:599) at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:269) at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:184) at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:174) at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:169) at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:161) at java.awt.EventDispatchThread.run(EventDispatchThread.java:122) I did try using Putty to transmit serial data - the "tx" light on the board flashes when I'm transmitting, something that doesn't seem to happen when I try to upload with Energia. I'm not getting errors from any other serial ports. Help?
  25. greetings, my wireless sensor project using the CC3200(mod) is coming up great and progressing fast. As I'm porting some code from my previous platform (pic + CC3000), I'm having trouble with the usual suspect printf. on the one hand, I've used simplified variants of printf in some arduino programs but I would definitely have the use of the full versatility of the stock printf as I'm far from the code size limit. In my previous platform / compiler, I just needed to provide the low level function that maps the output of printf to the UART, like putc or putchar. I've also read a similar post / question with the suggestion to redefine / override putchchar in the main code, however, this doesn't compile as I'm trying to redefine something that is a #define and not a function. my printf calls compile, they just don't output anything. What would be the best practice to have printf properly redirected to the UART ? I've read that it's not so good to try to override stock functions from the standard libraries, so I feel a bit stuck there. thank you for your help, Erv'
  • Create New...