Jump to content
43oh

SmokinGrunts

Members
  • Content Count

    18
  • Joined

  • Last visited

  • Days Won

    1

Reputation Activity

  1. Like
    SmokinGrunts got a reaction from energia in Watchdog Timer for TIVA TM4C1294ncpdt   
    Depends on how fast you're running the core clock.
     
    Example: For a clock frequency of 120 MHz, (120,000,000 Hz) it will take 120,000,000 'ticks' to elapse 1 second of real world time. 
     
    All you're doing with 
    WatchdogReloadSet(WATCHDOG0_BASE, MAP_SysCtlClockGet() * 2); is setting the load value of the watchdog timer, which runs at the system clock frequency. A watchdog is geared more towards recovery from catastrophic failure in embedded systems. I would recommend using a software reset for as many cases as you can muster. Otherwise, you could set up a basic timing system like the following: (Note that I use floating point on my Tiva 'cuz... Well why not! Haven't run into memory issues yet...)
     
    volatile uint32_t AppStartTime; // Application Start time in microseconds volatile uint32_t AppEndTime; // Application End time in microseconds volatile uint32_t AppRuntime; // Application Run time in microseconds // Take Application Start Time (Whenever you feel is necessary, you could do it in setup() or loop() if you wanted) AppStartTime = millis(); // Blah blah program code here ... // Take Application End Time AppEndTime = millis(); // Buffer for snprintf char ptimeBuf[6];  // Calc Run Time AppRuntime = AppEndTime - AppStartTime; // Convert to Seconds float32_t AppRuntimeSecs = AppRuntime / 1000.0;   // Parse Float into Char Buffer snprintf(ptimeBuf, 6, "%.2f", AppRuntimeSecs); // This is a custom wrapper I made combining Serial.print() and UARTprintf() functionality... And then some. // Probably just use UARTprintf() in place of term.println() // Also note the ANSI terminal escape codes. I like coloring output. I set up some eclipse hotkeys to make for // some groovy/easy function timing. Colors really help with tons of output. term.println("Complete Program Time (Main Loop Entry -> Finish: \e[38;5;220;1;4m%s Seconds\033[m", ptimeBuf); Anyhow, if your entire application takes for instance an average of 30 seconds, and the code is frozen, why not set the watchdog at something like 1 min. 30 secs?
     
  2. Like
    SmokinGrunts got a reaction from electrotwelve in WiFi encryption type keeps showing zero   
    Correct, 
    uint8_t WiFiClass::encryptionType() and 
    uint8_t WiFiClass::encryptionType(uint8_t networkItem) Two functions, with the same name, but different parameters. This is called Function Overloading. 
     
    Your compiler determines the best fit for which function definition to process based on the types you give to said function.
     
    For more information, see here: http://www.tutorialspoint.com/cplusplus/cpp_overloading.htm
  3. Like
    SmokinGrunts got a reaction from electrotwelve in .bin file location in Energia   
    If you're ready to move beyond the Arduino-esque IDE that is Energia, but still want to make use of the easy-to-read Energia Libraries, I'd recommend setting up something like Code Composer Studio (really just Texas Instrument's re-branded version of Eclipse) and getting to know the GNU GCC toolchain. The latest version of CCS just came out, has Energia sketch/library support built in, and has a number of other great features.
     
    I haven't used the Energia IDE for some time, but I do attempt to maintain using the libraries. So, I can't give you the answer you're looking for, but if you do decide to make the switch, all output files for CCS are generated in your project's 'Debug' folder.
     
    There is a learning curve, but the experience is worth having under your belt if you are serious about programming.
  4. Like
    SmokinGrunts got a reaction from energia in Broadcasting UDP packets   
    Gotta see more code to really know what's going on. 
     
    Do you have your UDP object properly initialized? something like:
    do { // Detect if we've started the UDP server     Serial.print("."); // print dots while we wait     delay(300);     }     while(!BroadcastSendUDP.begin(localPort)); Notice that BroadcastSendUDP.beginPacket() will *not* get a socket and bind it to a port for you, you must call begin() first.
     
    Relevant snippet for reference:
    int WiFiUDP::beginPacket(IPAddress ip, uint16_t port) { // //make sure a port has been created //!! this doesn't create a port if one doesn't exist. Is that ok? <--------- Look here // if (_socketIndex == NO_SOCKET_AVAIL) { return 0; } ...
  5. Like
    SmokinGrunts got a reaction from Fmilburn in Broadcasting UDP packets   
    Gotta see more code to really know what's going on. 
     
    Do you have your UDP object properly initialized? something like:
    do { // Detect if we've started the UDP server     Serial.print("."); // print dots while we wait     delay(300);     }     while(!BroadcastSendUDP.begin(localPort)); Notice that BroadcastSendUDP.beginPacket() will *not* get a socket and bind it to a port for you, you must call begin() first.
     
    Relevant snippet for reference:
    int WiFiUDP::beginPacket(IPAddress ip, uint16_t port) { // //make sure a port has been created //!! this doesn't create a port if one doesn't exist. Is that ok? <--------- Look here // if (_socketIndex == NO_SOCKET_AVAIL) { return 0; } ...
×
×
  • Create New...