cancel
Showing results for 
Search instead for 
Did you mean: 

Timer

pulvirenti
Associate II
Posted on March 06, 2008 at 07:55

Timer

8 REPLIES 8
pulvirenti
Associate II
Posted on November 23, 2007 at 07:05

Dear forum, I want to acquire from my analog input one sample/minute so to not make full eeprom in few ms. How can I use timer for this application?

I can't understand how to use it.

Thanks to all

Eng. Pulvirenti Salvatore

fggnrc
Associate II
Posted on November 23, 2007 at 08:23

Salvatore,

your task is either simple and somewhat complicated.

If you do not bother power consumption, you can use a timebase counter that overflows every ms or two.

Some ST7, I mean ST7FLITE3x family, can even cascade the timebase counter with the auto-reload timer to measure long time periods.

From the overflow interrupt handler you can acquire the analog input and store it into the eeprom.

This simple algorithm can be improved:

- acquire more samples and average the samples to reduce noise.

- stop the micro between the ADC conversions to reduce power consumption.

The former is an easy task when you take 256 samples (to divide by 256 all you need is to discard the lower byte), whilst the latter one needs the Auto-Wakeup Timer to be calibrated and programmed.

Please, keep in mind that, while you are writing a byte to EEPROM (it may take some ms), the counter can overflow, so you must pay attention to what you do in the interrupt handler.

Ciao

EtaPhi

pulvirenti
Associate II
Posted on November 24, 2007 at 05:58

Dear EtaPhi,

I have ST72334, thanks for the answer. Can u give ur email address so to speak Italian? I have some questions!!!Thanks

fggnrc
Associate II
Posted on November 26, 2007 at 09:02

Salvatore,

if you have some questions, I'll reply to them if I can.

The aim of this forum is to share knowledge between ST7 users, so if your questions are worth a reply, why do you not share them with the others?

I know, English is not our mothertoungue, but the translation effort overpays the information value that you may receive...

Ciao

EtaPhi

pulvirenti
Associate II
Posted on December 05, 2007 at 11:28

My st has not auto wake timer. How can I do?

I tried with Main Clock Control Status Register but not works

Help!!

fggnrc
Associate II
Posted on December 06, 2007 at 08:40

Salvatore,

the application note AN1605 shows how a microcontroller can be waked-up from the halt state without the need of an internal auto wakeup oscillator.

The strategy to minimize power consumption depends however on the requirements of your application. If some time error is tolerated, you can halt the microcontroller and wake it up by some method; otherwise it is better to use the active-wait state where the CPU is stopped but the periferals work.

Ciao

EtaPhi

pasquale
Associate
Posted on March 06, 2008 at 07:53

Hi Salvatore, please contact me at

mailto:pasquale.trn@alice.it

to define some aspect of ST7 MCU. I can't contact you from the forum. Thank You.

pasquale
Associate
Posted on March 06, 2008 at 07:55

Quote:

On 06-03-2008 at 12:23, Anonymous wrote:

Hi Salvatore, please contact me at

mailto:pasquale.trn@alice.it

to define some aspect of ST7 MCU. I can't contact you from the forum. Thank You.