Internet Explorer no es un explorador compatible con TI.com. Para disfrutar de una mejor experiencia, utilice otro navegador.
Video Player is loading.
Current Time 0:00
Duration 2:35
Loaded: 0%
Stream Type LIVE
Remaining Time 2:35
 
1x
  • Chapters
  • descriptions off, selected
  • en (Main), selected

    The purpose of this lab is to use timers for PWM output and timers to create periodic interrupts. For this portion of the lab, you just need the LaunchPad. The goal of this section is to measure interrupt latency, in other words, how fast does the microcontroller respond to an interrupt? Let me start with Code Composer Studio. And what I have is a very simple multi-threaded system.

    The main program is running most of the time toggling the blue LED. The background task, the periodic task, in this case, is going to run 1,000 times per second. And it toggles the red LED three times. And this triple toggle technique allows us to do some measurements. First, we can ask the question, how long did it take to execute that interrupt service routine? And if you look at the three toggles, you see the first toggle is when the interrupt happened.

    The second toggle is when the service for that interrupt occurred. And the third toggle is at the end of that interrupts, so I can use this to estimate or profile the amount of time this interrupt service team takes. The other thing I can do is because the foreground thread in this very simple program is toggling the blue LED, I can look at the latency or the time between request and service. And I know that right at this point here, the main program was halted, suspended. And I can see the time between suspending the main and executing the interrupt service team is much less than a microsecond, a very low latency.

    If I were to zoom out, you would also be able to see that the interrupts were occurring at 1,000 times per second. In this lab, you learned that time can be used to execute software tasks periodically with very little jitter. And, therefore, the time between the request and the start of the service is much, much less than a microsecond. As your robot becomes more and more complex, periodic interrupts are a way to combine multiple threads into one microcontroller. Remember to use your debugging techniques to measure where and when your software executes. Have fun.