MCH 0 Posted April 16, 2019 Share Posted April 16, 2019 I would like to trigger the sampling from a timer, but somehow cannot find the required information about the ADC12SHS bits in the ADC12CTL1 register. The family manual tells me to look in the specific device datasheet for that information, but I can't find it there (the MSP430F5529 datasheet). Also looked into the mspware C examples, but none uses timer triggered A/D. Where should I look for that info (which timers can be used, and how to set ADC12SHS bits to use them)? Quote Link to post Share on other sites
NurseBob 111 Posted April 17, 2019 Share Posted April 17, 2019 Hi MCH, Basically, the timer(s) and ADC are indpendent peripherals. So, what you do is set a timer at the interval you're interested in and either: 1) In the timer event handler trigger the ADC to read Or, 2) Set a flag that's read in a main loop to trigger the ADC You might find some guidance here. HTH Quote Link to post Share on other sites
MCH 0 Posted April 17, 2019 Author Share Posted April 17, 2019 Hello NurseBob, There is a hardware connection between timers and ADC, that allows you to trigger the ADC directly from a timer, no need to do it "by hand" in a timer interrupt. This provides constant sampling intervals, independent of any software latencies. I have been successfully using this feature on MSP430G2553. Now I am porting to F5529, and ran into this problem. In the mean time, by trial and error, I found that ADC12SHS_1 in ADC12CTL1 will trigger from timer A0.1, but can't find out from which timer ADC12SHS_2 and ADC12SHS_3 trigger. (The family manual clearly says from some timer, but does not specify which,. It refers to the specific device datasheet, but neither can I find the info there.) I need timers A0 and B (many CCRs) for other tasks, and would like to trigger the ADC from one of the "small" timers, A1 or A2. Quote Link to post Share on other sites
MCH 0 Posted April 17, 2019 Author Share Posted April 17, 2019 I found the answer here: https://e2e.ti.com/support/microcontrollers/msp430/f/166/p/93961/326902#326902 SHS_1 is TA0 CCR1, as I already found out SHS-2 is TB CCR0 and SHS_3 is TB CCR1. Bljah, I'll have to redesign my PCB 😞 Quote Link to post Share on other sites
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.