SinelaboreRT Header Logo

SinelaboreRT

As simple as possible, but not any simpler!

User Tools

Site Tools


wiki:news:02jan2015

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
Next revisionBoth sides next revision
wiki:news:02jan2015 [2015/05/14 15:57] – [How to treat with longer lasting tasks] pmuellerwiki:news:02jan2015 [2015/11/28 14:50] – [Discussion] pmueller
Line 192: Line 192:
 Execution time for handling events should be as short as possible. Longer lasting tasks should be split into chunks. Take the temperature measurement as an example. The temperature sensor TMP100 requires about 320ms conversion time according to the data sheet. The uC shouldn't wait and burn CPU cycles but either wait in low-power mode or process other events. This can easily be done by starting the conversion in one state (''Step1'') and then start a timer and enter low-power mode. If the timer fires we pick-up the conversion result (''Step2'') and process it further. Execution time for handling events should be as short as possible. Longer lasting tasks should be split into chunks. Take the temperature measurement as an example. The temperature sensor TMP100 requires about 320ms conversion time according to the data sheet. The uC shouldn't wait and burn CPU cycles but either wait in low-power mode or process other events. This can easily be done by starting the conversion in one state (''Step1'') and then start a timer and enter low-power mode. If the timer fires we pick-up the conversion result (''Step2'') and process it further.
  
-Another example is the wake-up procedure of the radio. After finishing low-power mode it takes a while before it is ready. Readiness is signalled via a transition of the RTS pin from high to low. After switching on the radio in state ''Step2a'' the level change crenate an irq and sends the event ''evFallingEdgeRTS'' +Another example is the wake-up procedure of the radio. After finishing low-power mode it takes a while before it is ready. Readiness is signalled via a transition of the RTS pin from high to low. After switching on the radio in state ''Step2a'' we enter low-power mode again. The level change creates an irq and sends the event ''evFallingEdgeRTS''Now the radio is ready to transmit data. 
 ===== Object Diagram ===== ===== Object Diagram =====
 The software design  is shown in the next figure as UML object diagram. You can clearly see how the ''queues decouple the event sources from the event consumers''. The main-loop serves as event dispatcher being only active if events are available in one of the queues. The main loop can also be used to prioritize one state machine over an other or ensure the order in which state machines are executed. The software design  is shown in the next figure as UML object diagram. You can clearly see how the ''queues decouple the event sources from the event consumers''. The main-loop serves as event dispatcher being only active if events are available in one of the queues. The main loop can also be used to prioritize one state machine over an other or ensure the order in which state machines are executed.
Line 221: Line 221:
 ~~DISCUSSION|Leave your comments~~ ~~DISCUSSION|Leave your comments~~
    
 +{{tag>[MSP430 Application_Example]}}
wiki/news/02jan2015.txt · Last modified: 2023/03/12 17:50 by webmin

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki