Alert icon
We're changing our privacy policy. This stuff matters.  Learn more  Dismiss

Microcontroller Bitfields and Time processing

Loading...

Sign in or sign up now!
Alert icon
Upgrade to the latest Flash Player for improved playback performance. Upgrade now or more info.
2,394
Loading...
Alert icon
Sign in or sign up now!
Alert icon

Uploaded by on Nov 6, 2011

Video blog about how to use bitfield structures in C on Microcontrollers to manage time and processing events.

Code available at http://mybitbox.com

Link to this comment:

Share to:

Uploader Comments (s1axter)

  • Thank you for this video, but I've got a few questions :S

    How did you get the ISR to run once every millisecond?

    What if my 1msRoutine takes more than 1millisecond? Will the rest of the code be delayed?

    I'm sorry, I'm quite new to microcontrollers.

  • @GiorgioCapocasa Take a look at the code on the website there is a line in system.c "timer1.attach(&ISR_timer1, 0.001)" to set the timer to 1ms.

    The idea behind this is that you want to write routines that are fast and return quickly. If there is a long routine such as communication I would use a state machine to break it up, and use UART hardware, etc

    Yes, if the routine takes more than 1ms it will block other processing. 1ms is pretty fast, I use the 100ms flag and keep the routines small.

see all

All Comments (3)

Sign In or Sign Up now to post a comment!
  • @s1axter Oops, there I goofed!

    Thank you for your fast reply: I will try to keep the routines small... not that I'm running anything huge anyway :D

Loading...

Alert icon
0 / 00Unsaved Playlist Return to active list
    1. Your queue is empty. Add videos to your queue using this button:
      or sign in to load a different list.
    Loading...Loading...Saving...
    • Clear all videos from this list
    • Learn more