Jump to content

Search the Community

Showing results for tags 'millis'.



More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • 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

Calendars

There are no results to display.


Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Website URL


Location


Interests


Sparkfun


Github

Found 3 results

  1. I've written a 7-segment refresh routine that runs every 2 millis at the beginning of loop(). It starts this way: void loop() { CURmillis = millis(); if ((CURmillis - PREVmillis) > 1) { // 2ms refresh period = 71 Hz per segment digitalWrite(18,HIGH); PREVmillis = CURmillis; // Turn the current segment OFF while making changes - prevents ghosting digitalWrite(SEGARRAY[SEGCOUNT], SEGOFF); The digitalWrite to pin 18 has been added so I can measure how long the refresh routine takes to run. Pin 18 is turned off as the last instruction in loop(). So the idea is to put my scope on pin 18, and see how much time the routine takes to run, and make sure there's no chance of an overrun. The good news is that the routine runs in about 25 uSec, so it will never overrun the next milli. But the bad news is that the scope shows that millis do not occur regularly. Pin 18 generally triggers the scope at 2 ms intervals, but there are occasional triggers at other points. I can't tell if the extra triggers are early or late, but they never go away. When I did this test on the assembler version of this code, with the Watchdog timer in interval mode, and the clock running at 1 MHz, the pin 18 triggers are absolutely regular. So Energia is doing something in the background that's causing this behavior. Of course it has to execute whatever is done to update the millis value, but I can't iimagine that this would take much time. But I guess there could be some "beat" in the interaction of the background millis interrupt and the loop() execution frequency. Is there any way to get rid of this millis flutter? Is it possible to hook into the interrupt that Energia uses for millis? If so, I could put my routine into the ISR, and loop() would be empty.
  2. rycco

    strange millis() overflow

    Hello, i have some strange problem while using Energia on my Stellaris Launchpad. On reference sites is written that millis overflows after approximately 50 days, but mine wont last longer then 53 seconds. Here is the code used just for displaying int blueL = 40; int blueState = 0; unsigned long time; unsigned long test_time; void setup() { Serial.begin(9600); pinMode(blueL,OUTPUT); time = millis(); } void loop() { if (millis() - time > 1000) { digitalWrite(blueL,blueState); blueState = !blueState; time = millis(); } test_time = millis(); Serial.print("current time in millis : "); Serial.print(test_time); Serial.print("\tlast blinked time in millis : "); Serial.println(time); } And here is what i get in time of overflow current time in millis : 53176 last blinked time in millis : 52790 current time in millis : 53247 last blinked time in millis : 52790 current time in millis : 53319 last blinked time in millis : 52790 current time in millis : 53391 last blinked time in millis : 52790 current time in millis : 53463 last blinked time in millis : 52790 current time in millis : 53535 last blinked time in millis : 52790 current time in millis : 53607 last blinked time in millis : 52790 current time in millis : 53679 last blinked time in millis : 52790 current time in millis : 63 last blinked time in millis : 37 current time in millis : 129 last blinked time in millis : 37 current time in millis : 196 last blinked time in millis : 37 current time in millis : 262 last blinked time in millis : 37 current time in millis : 329 last blinked time in millis : 37 current time in millis : 396 last blinked time in millis : 37 current time in millis : 462 last blinked time in millis : 37 Its just about 53 seconds before overflow. Does anyone have some advice ? Thanks
  3. sirri

    Timing in Energia Code ?

    Hello is there a similar library in energia ? http://playground.arduino.cc/Code/SimpleTimer or how can i execute a piece of code for X seconds. Thanks sirri
×