Skip to main content
Visitor II
March 6, 2008
Question

Timer

  • March 6, 2008
  • 8 replies
  • 1731 views
Posted on March 06, 2008 at 07:55

Timer

    This topic has been closed for replies.

    8 replies

    Visitor II
    November 23, 2007
    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

    Visitor II
    November 23, 2007
    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

    Visitor II
    November 24, 2007
    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

    Visitor II
    November 26, 2007
    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

    Visitor II
    December 5, 2007
    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!!

    Visitor II
    December 6, 2007
    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

    Visitor II
    March 6, 2008
    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.

    Visitor II
    March 6, 2008
    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.