Burst Sleep Mode in Embedded C: Cooling & Interrupts

  • Thread starter Thread starter rama1001
  • Start date Start date
  • Tags Tags
    Mode Sleep
Click For Summary

Discussion Overview

The discussion revolves around implementing a Burst sleep mode in Embedded C, focusing on the management of cooling periods and interrupt handling. Participants explore how to effectively manage sleep durations based on user input while ensuring responsiveness to interrupts and maintaining precise timing for operational requirements.

Discussion Character

  • Technical explanation
  • Debate/contested
  • Mathematical reasoning

Main Points Raised

  • One participant questions whether the Sleep function can respond to interrupts during the sleep period and seeks alternative ideas for managing this.
  • Another participant notes that the handling of sleep functions and interrupts is dependent on the operating system used in the embedded code, suggesting that documentation may provide insights into this behavior.
  • There is a discussion about the possibility of using a timer for managing cool time, with one participant suggesting that if the timer is accurate, it could be utilized for precise delays.
  • Another participant expresses concern that using a tight loop for timing may hinder interrupt handling and multi-tasking capabilities, as it may require disabling interrupts for accuracy.

Areas of Agreement / Disagreement

Participants express differing views on the best approach to manage sleep and cooling periods, with no consensus reached on the optimal method for ensuring responsiveness to interrupts while maintaining precise timing.

Contextual Notes

Participants mention the need for accurate timing and the implications of using tight loops versus timers, highlighting potential trade-offs in interrupt handling and multi-tasking capabilities.

rama1001
Messages
130
Reaction score
1
Hi,
I am correcting a Embedded C code which requires Burst sleep mode. This sleep period is purely depend on the user input cool time and this is really to coll the machine. I thought of using Sleep function for this user input time but is it able to respond to other interrupts in this period? or any other idea to make it would be highly appreciated.

Thank you.
 
Technology news on Phys.org
If this is embedded code, then the sleep function and interrupt handling are part of the operating system used for the embedded code. Hopefully there is sufficient documentation for the operating system to determine how it handles this situation.

It is common for embedded multi-tasking operating systems to allow a task to pend (wait) for an event that can be set by another task or an interrupt routine. This basic functionality may be extended so that a task can pend on a message queue (normally fifo), where other tasks and/or interrupts can add messages to a message queue.
 
Last edited:
rcgldr said:
If this is embedded code, then the sleep function and interrupt handling are part of the operating system used for the embedded code. Hopefully there is sufficient documentation for the operating system to determine how it handles this situation.

It is common for embedded multi-tasking operating systems to allow a task to pend (wait) for an event that can be set by another task or an interrupt routine. This basic functionality may be extended so that a task can pend on a message queue (normally fifo), where other tasks and/or interrupts can add messages to a message queue.

HI,
i have a doubt about wating time(blank time or cool time or zero current) in my system. The current C code was not working without this blank period. Suppose, i would like to produce current for 1500ms and 600ms as cool time. I can stop the transformer until this 600ms period but how can i wait exactly 600ms or how to write a piece of code to make it work? Please give me any suggestions.
 
rama1001 said:
The current C code was not working without this blank period. Suppose, i would like to produce current for 1500ms and 600ms as cool time. I can stop the transformer until this 600ms period but how can i wait exactly 600ms or how to write a piece of code to make it work? Please give me any suggestions.
If the device has a timer, and the timer is accurate enough, then use the timer. Otherwise, you may need to code a tight loop and calibrate the loop so it's timing can be programmed to very precise delays. This defeats any interrupt handling or multi-tasking since you'd probably need to do this with interrupts disabled to get the precise timing.
 

Similar threads

Replies
8
Views
2K
Replies
7
Views
2K
Replies
1
Views
2K
  • · Replies 8 ·
Replies
8
Views
6K
  • · Replies 2 ·
Replies
2
Views
3K
  • · Replies 6 ·
Replies
6
Views
2K
  • · Replies 8 ·
Replies
8
Views
2K
  • · Replies 6 ·
Replies
6
Views
4K
  • · Replies 7 ·
Replies
7
Views
4K
  • · Replies 5 ·
Replies
5
Views
2K