sampling through timer

May 16, 2007 2 Replies

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.



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

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

Join the Discussion

Have something to add? Share your thoughts — no account required.

Didn't find your answer?

Ask the community — no account required