energia

Members
  • Content count

    1,047
  • Joined

  • Last visited

  • Days Won

    35

energia last won the day on February 25

energia had the most liked content!

About energia

  • Rank
    Level 4

Contact Methods

  • Website URL
    http://www.energia.nu
  1. There is no connection from VBUS to any of the pins on the chip. What I would recommend is to tap ICDI_VBUS through a resistor divider to end up with 3.3V and then connect that to one of the pins. You might also be able to just directly connect ICDI_VBUS to the switching regulator control pin either through a resistor divider or directly if it is 5 Volt tolerant.
  2. For the analogRead() part I would take a look at wiring_analog.c which is the place where analogRead() is implemented. For the Serial printing portion, I would suggest to take a look at one of the driverlib examples: http://dev.ti.com/tirex/#/?link=Software%2FMSP430Ware%2FLibraries%2FDriver Library%2FMSP430F5xx_6xx%2FExample Projects%2FUSCI_A_UART
  3. It seems that there is a data type mismatch between whatever code is calling the SPI API's and the SPI library. Where did the ZBooster library come from?
  4. There is a significant amount of SAM and AVR specific code in the library. It does not seem like this is going to be easily portable to Energia. All the AVR / SAM specific code will need to be replaced with CC3200 specific code. Robert
  5. Did you already try using attachInterrupt() http://energia.nu/AttachInterrupt.html. volatile int state = HIGH; volatile int flag = HIGH; int count = 0; void setup() { Serial.begin(9600); pinMode(GREEN_LED, OUTPUT); digitalWrite(GREEN_LED, state); /* Enable internal pullup. * Without the pin will float and the example will not work */ pinMode(PUSH2, INPUT_PULLUP); attachInterrupt(PUSH2, blink, FALLING); // Interrupt is fired whenever button is pressed } void loop() { digitalWrite(GREEN_LED, state); //LED starts ON if(flag) { count++; Serial.println(count); flag = LOW; } } void blink() { state = !state; flag = HIGH; }
  6. I am not sure what you mean with "I want to make this rtc programable on site". Do you mean you would like to set the clock with RTC_setTime() while the system is running verses setting the clock in setup with RTC_init?
  7. It's not clear to me from your last post if the circuit is now working correctly or not.
  8. Below is the replacement WiFiClient::connect() function. Right now the timeout is hardcoded but you can add an extra parameter for the timeout. Please not that if you call WiFiClient::connect(const char* host, uint16_t port) a host lookup is done which eventually results in calling sl_NetAppDnsGetHostByName() this call seems to timeout after 20 sec if you do not have an internet connection (e.g. WAN cable unplugged from the router). Unfortunately this function does not feature a timeout. So to have control over the timeout, use the ip address of the host in the connect rather than the hostname. int WiFiClient::connect(IPAddress ip, uint16_t port) { int iRet = 0; // //this function should only be called once and only on the client side // if (_socketIndex != NO_SOCKET_AVAIL) { return false; } // //get a socket index and attempt to create a socket //note that the socket is intentionally left as BLOCKING. This allows an //abusive user to send as many requests as they want as fast as they can try //and it won't overload simplelink. // int socketIndex = WiFiClass::getSocket(); if (socketIndex == NO_SOCKET_AVAIL) { return false; } int socketHandle = sl_Socket(SL_AF_INET, SL_SOCK_STREAM, SL_IPPROTO_TCP); if (socketHandle < 0) { return false; } // //connect the socket to the requested IP address and port. Check for success // long nonBlocking = 1; iRet = sl_SetSockOpt(socketHandle, SL_SOL_SOCKET, SL_SO_NONBLOCKING, &nonBlocking, sizeof(nonBlocking)); SlSockAddrIn_t server = {0}; server.sin_family = SL_AF_INET; server.sin_port = sl_Htons(port); server.sin_addr.s_addr = ip; iRet = sl_Connect(socketHandle, (SlSockAddr_t*)&server, sizeof(SlSockAddrIn_t)); Serial.print("iRet = "); Serial.println(iRet); if (iRet < 0) { if (iRet != SL_EALREADY) { sl_Close(socketHandle); return false; } SlTimeval_t timeout; timeout.tv_sec = 10; timeout.tv_usec = 500; SlFdSet_t WriteFds; SL_FD_ZERO(&WriteFds); SL_FD_SET(socketHandle, &WriteFds); iRet = sl_Select(socketHandle + 1, NULL, &WriteFds, NULL, &timeout); if (iRet > 0) { if (SL_FD_ISSET(socketHandle, &WriteFds)) { iRet = sl_Connect(socketHandle, (SlSockAddr_t*)&server, sizeof(SlSockAddrIn_t)); if(iRet < 0) { sl_Close(socketHandle); return false; } else { // Success. Nothing to do. } } } else if(iRet == 0) { // Timeout sl_Close(socketHandle); return false; } else { // Connection error sl_Close(socketHandle); return false; } } int enableOption = 1; sl_SetSockOpt(socketHandle, SL_SOL_SOCKET, SL_SO_NONBLOCKING, &enableOption, sizeof(enableOption)); sl_SetSockOpt(socketHandle, SL_SOL_SOCKET, SL_SO_KEEPALIVE, &enableOption, sizeof(enableOption)); // //we've successfully created a socket and connected, so store the //information in the arrays provided by WiFiClass // _socketIndex = socketIndex; WiFiClass::_handleArray[socketIndex] = socketHandle; WiFiClass::_typeArray[socketIndex] = TYPE_TCP_CLIENT; WiFiClass::_portArray[socketIndex] = port; return true; }
  9. I am not quite sure what you are asking. Can you explain what you want interrupt enabled and what should happen in the interrupt service routine?
  10. Which service pack did you install? It might be the service pack that you installed that is causing the issue. Knowing the version you installed will help me in an attempt to reproduce this. I just now did a quick test with service pack 1.0.1.11-2.8.00 and the SimpleWebServerWifi example works as expected. When you say "stuck at the line "Wifi.beign(ssid, password)" does it print dots in the Serial monitor at all?
  11. As far as I know the Arduino Nano is a 5 Volt device. I think the same is true for the Nextion display. The MSP430 however is a 3.3 Volt device. So be very carful with that. The I/O's on the MSP430 are NOT 5 Volt tolerant and you might have burned out the RX pin on the MSP430. To test this you can connect the TX pin to the RX pin on the MSP430 to see if it is still operational. Robert
  12. EMT low power unfortunately is not well documented but quite simple. How low of a power the device goes into depends on what interfaces are open and what device the Sketch runs on. The quick reference: If all Sketches are in delay() the idle loop is entered. The idle loop is a TI-RTOS task that consults the power manager and then determines what level of low power it can go to. Make sure that all unused pins are in the appropriate state according to the datasheet. Usually this is output high. Make sure that sensors that are connected are put into sleep mode if you intend to go to low power. Make sure that you call the .end() function on peripherals. e.g. Wire.end(), SPI.end(), Serial.end(), etc. This releases the constraint that the peripherals .begin() functions sets in the power manager. Use inter task communication interfaces to communicate to other tasks when low power should commence. Examples of the low power intertask communication can be found in the Energia examples under File->Examples->10.MultiTasking. Typically you would want to go for semaphore of Event. Pending on a semaphore also acts as low power mechanism. If you pend, the task stops becoming runnable and wont execute again unless the semaphore is posted. Hope this helps. I do have low power example Sketches in the pipeline but I won't be able to get to the in the next month or so. Robert
  13. Did you perhaps select "Upload using programmer" from the Sketch menu? That is the only way I am able to reproduce it. "Upload using programmer" is not used in Energia. You should either click the upload button or select Upload from the Sketch menu.
  14. This is due to the WiFiClient and ultimately the cc3200
  15. This is currently not supported as posted in this thread: https://e2e.ti.com/support/wireless_connectivity/simplelink_wifi_cc31xx_cc32xx/f/968/p/465212/1670436#1670436 What you can do is to change WiFiClient.ccp's connect function to make the connect non-blocking with sl_SetSockOpt(socketHandle, SL_SOL_SOCKET, SL_SO_NONBLOCKING, &enableOption, sizeof(enableOption)); sl_Connect will then return immediately regardless of successful connection. Then change the code after connect to something like posted here: https://e2e.ti.com/support/wireless_connectivity/simplelink_wifi_cc31xx_cc32xx/f/968/t/473029 It might be a good idea for the WiFi library to support a connect() with optional timeout. Unfortunately I won't be able to get to that in the near future.