Part Number: TMS320F28377D
Other Parts Discussed in Thread: C2000WARE
how to set my ADC sampling rate to 512 KB/S ,which registers i need to change? presently my ADC running with sampling rate of 1MB/S
This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
Part Number: TMS320F28377D
Other Parts Discussed in Thread: C2000WARE
how to set my ADC sampling rate to 512 KB/S ,which registers i need to change? presently my ADC running with sampling rate of 1MB/S
Hi Diji,
ADC SOC frequency depends on the trigger that you're using. For example, if you use EPWM as your SOC trigger, you can adjust your EPWM frequency to get the desired ADC rate.
Thanks,
Aditya
TBPRD register decides the frequency of the PWM signal and CMPA decides the duty. To reduce the ADC sampling rate by half you need to reduce the frequency of the PWM (double the value of TBPRD and CMPA register to maintain the 50% duty cycle).
Thanks,
Aditya
Diji,
Conversion rate is proportional to the EPWM frequency. To reduce the sampling rate, you need to reduce the EPWM frequency.
TBRPD register controls the frequency. The count value of TBPRD has to be doubled to reduce the EPWM frequency to half in turn reducing the conversion rate to half as well.
Thanks,
Aditya
in our present code the register values are given below and i tried doubling value also but still no change in sampling rate.
i need a sampling rate of 512 KB/Second
Present values
DEVICE :TMS320F28377D
HSPCLKDIV = 0
TBPRD = 0x66
CMPA = 0x33
ACQPS = 14
TRIGSEL = 9
ADCCTL2.bit.PRESCALE = 6;
AdcbRegs.ADCCTL2.bit.RESOLUTION = 1;
I already tried values given below
HSPCLKDIV = 0
TBPRD = 0x190
CMPA = 0xC8
ACQPS = 14
TRIGSEL = 9
ADCCTL2.bit.PRESCALE = 6;
AdcbRegs.ADCCTL2.bit.RESOLUTION = 1;
But we are still getting sampling rate of 1 MB/seconds with above values.is there any other register needs to be changed?
Please let me know the details.
This looks pretty much fine. Just the values to reduce the frequency to half should be double of 0x66 and 0x33, i.e. 0xCC and 0x66. But anyways updating to the values you mentioned also should change the frequency.
How are you checking the frequency that you're mentioning? Also, can you check whether the EPWM frequency is getting updated according the set values?
HSPCLKDIV= 0,as per reference manual, sysclock ie 200M in my case will be fed to pwm, i hope its correct. Or is there any other multiplier or divider?ok let me check pwm frequency? Can i get pwm on any pinout? As i am feeding same pwm to adc
Can you refer to the ADC SOC with EPWM trigger example given along with C2000Ware?
Ya i got the 500kB sampling rate now my new issue is need to sample 3 adc input, adc a, b, c. Iam using same configuration mention above but i want to get 1mb sampling rate for other two inputs, as iam using TBPRD value for 500KB ie 400.even iam using differe pwm3,9,1 iam getting 500 KB other channels too, i tried using one channel trigger with CMPB its not working.
Hi my new doubt is iam initialising 3 ADC same time b4 while one loop. So how will get different sampling rate as TBPRDA register is same? I need 2 Adc running at 1MB and 1 adc 512KB. How this can be achived also all adc should run parellel?
Hi Diji,
This requirement is demonstrated in the example adc_ex11_multiple_soc_epwm available with the C2000Ware_3_04 version.
The example demonstrates two ADCs operating in parallel at different frequencies. Request you to refer the example. It is not available with the versions prior to 3_04. Request you to check <C2000Ware_3_04_00_00\driverlib\f2837xd\examples\cpu1\adc>
Thanks,
Aditya
Ok thank you i solved this issue, issue was pwm ownership, i havnt set it for new pwm.
Diji,
You can use the 16 bit feature of ADC for a higher resolution. As far as the accuracy is concerned, please refer to the device datasheet which contains the minumum and maximum error for the ADC module.
The output will be range bound but not exact.
Thanks,
Aditya
It depends on your system clock frequency what acquisition window time you need to set.
Refer to section 8.10.1.2.3 in this datasheet.
Eg: If your System Clock freq is 200MHz and you need an acquisition window of 75ns (from the datasheet), the product of these two will give you 15. The value to be fed in the ACQPS register is one less than 15, i.e. 14.
Thanks,
Aditya
Higher acquistion means you are giving longer time to charge the sampling capacitor. It'll help you gain some % in terms of accuracy but that won't be a big difference.
Aditya
Diji,
Since we haven't heard back from you, I believe this query has been resolved. I am marking this thread as resolved for now. Incase, you still have any questions, feel free to mark it as not resolved and continue the thread. If this thread locks, you can ask a new question.
Thanks,
Aditya