Re: Question regarding AMX (only for experts!!!)

> I am running AMX on ARM processor. > In order to reduce power consumption, I would like to halt almost all > of the chip (including the ARM processor) when it is possible.

While I haven't used AMX in years, so don't consider myself an AMX or ARM expert, I think the questions are more fundamental. Also, note that by labelling the question for experts only, you tend to limit your responses, even from people who really are experts. It is better to be open to a wider range of responses and do your own filtering.

These are the main problems: > 1) How to find the maximum time I can go to sleep and still no harm my > application. (I thought about checking all timers and tasks TCBs).

That's a reasonable approach. Basically two issues: each task should only schedule execution when it really has something to do, using interrupts to trigger most execution (as opposed to periodic execution) and, as you mention, checking to see when the first scheduled timeout is.

2) While the chip is "asleep", nothing is running, so AMX doesn't get > its "tick", so after waking up - I will have to "imcrement the > time...".

If you don't have a processor timer running, you will need an external timer, probably a clock chip, which can be used for both wakeup at a designated time and for restoration of the internal timer, although probably at a lower resolution. If you are sleeping for long periods of time, and concerned over the power difference, it could be worthwhile. You might, instead, leave the processor oscillator and timer running, then use a timeout interrupt for the first timeout event, though that will require more power. This is common for realtime operating systems.

One thing to note: if you turn off the processor crystal oscillator, you will need to allow sufficient time for it to stabilize after starting again. For high frequency crystals, this is usually several milliseconds.

Thad

Reply to
Thad Smith
Loading thread data ...

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.