Connect with us

sampling through timer

Discussion in 'Electronic Design' started by jackbauer, May 16, 2007.

Scroll to continue with content
  1. jackbauer

    jackbauer Guest

    Hi,

    I'm using microC/OS on MSP430F1611 and have used semaphores in all of
    my SPI functions. Both the spi Tx and Rx use DMA.

    I have an 8 channel external ADC and I want to sample my channels at
    some rate using interrupt and Timer B. But I can't request a semaphore
    in ISR.... So I was wondering if anyone has a good idea of
    implementing a stable sample rate on an external ADC while using
    microC/OS tasks (I don't need to use timers if there is a more
    efficient method.)

    Thanks a lot.
     
  2. Tim Wescott

    Tim Wescott Guest

    The best way to do that is drive the ADC's start-conversion pin from the
    timer output pin, and drive an external interrupt from the ADC's
    end-of-conversion pin. That way you're controlling the sampling with a
    hardware timer.

    --

    Tim Wescott
    Wescott Design Services
    http://www.wescottdesign.com

    Posting from Google? See http://cfaj.freeshell.org/google/

    Do you need to implement control loops in software?
    "Applied Control Theory for Embedded Systems" gives you just what it says.
    See details at http://www.wescottdesign.com/actfes/actfes.html
     
  3. jackbauer

    jackbauer Guest

    I'm using ADS8345 which triggers a conversion whenever SPI receives
    one byte. So to sample a channel, I write a byte to SPI. So I'm not
    sure how to implement your method... Please advise
     
Ask a Question
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.
Electronics Point Logo
Continue to site
Quote of the day

-