Burst Sleep Mode in Embedded C: Cooling & Interrupts

  • Thread starter Thread starter rama1001
  • Start date Start date
  • Tags Tags
    Mode Sleep
AI Thread Summary
The discussion revolves around implementing a Burst sleep mode in Embedded C code, specifically focusing on managing a user-defined cool time. The initial query raises concerns about using the Sleep function and its ability to respond to interrupts during the sleep period. It is noted that the handling of sleep functions and interrupts is dependent on the operating system used in the embedded environment, emphasizing the importance of consulting the OS documentation for clarity on these functionalities.Participants highlight that many embedded multi-tasking operating systems allow tasks to wait for events triggered by other tasks or interrupts, suggesting that a message queue could be utilized for better event handling. Additionally, a user seeks advice on implementing a precise 600ms cool time after producing current for 1500ms. Suggestions include using an accurate timer if available, or alternatively, coding a tight loop for precise timing, although this approach may hinder 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.
 
Dear Peeps I have posted a few questions about programing on this sectio of the PF forum. I want to ask you veterans how you folks learn program in assembly and about computer architecture for the x86 family. In addition to finish learning C, I am also reading the book From bits to Gates to C and Beyond. In the book, it uses the mini LC3 assembly language. I also have books on assembly programming and computer architecture. The few famous ones i have are Computer Organization and...
I have a quick questions. I am going through a book on C programming on my own. Afterwards, I plan to go through something call data structures and algorithms on my own also in C. I also need to learn C++, Matlab and for personal interest Haskell. For the two topic of data structures and algorithms, I understand there are standard ones across all programming languages. After learning it through C, what would be the biggest issue when trying to implement the same data...
Back
Top