sampling through timer

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.

Reply to
jackbauer
Loading thread data ...

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
Reply to
Tim Wescott

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

Reply to
jackbauer

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.