Part Number: TMS320F28379D
Hi,
I'm using CPU1 and CPU2 on my device.
Is it possible to use ADC-A on CPU1, then on CPU2 using CPUSEL11 register ? (not simultaneously of course)
If yes, how to proceed please ?
Regards,
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: TMS320F28379D
Hi,
I'm using CPU1 and CPU2 on my device.
Is it possible to use ADC-A on CPU1, then on CPU2 using CPUSEL11 register ? (not simultaneously of course)
If yes, how to proceed please ?
Regards,
Hello,
The SME for this topic is currently out of office, please expect a reply within a couple of days.
Thanks,
Anu
Hello,
I'm using ADC-A, ADC-B, ADC-C and ADC-D.
I do all the ADC settings on CPU1, then I use these 4 ADC for a first conversion on CPU1.
Then, I transfer ownership of the 4 ADCs to CPU2 :
EALLOW;
DevCfgRegs.CPUSEL11.bit.ADC_A = 1; // Connected to CPU2
DevCfgRegs.CPUSEL11.bit.ADC_B = 1; // Connected to CPU2
DevCfgRegs.CPUSEL11.bit.ADC_C = 1; // Connected to CPU2
DevCfgRegs.CPUSEL11.bit.ADC_D = 1; // Connected to CPU2
EDIS;
Then, I want to use these 4 ADCs for a conversion on CPU2 ; conversion works for ADC-A & ADC-B, but not for ADC-C and ADC-D.
Do you know why ?
Thanks for your feedback.
Regards,
electrocc,
What you are trying to do is a supported use case.
Can you describe how ADC-C and ADC-D behave when trying to use CPU2?
Are you configuring PCLKCR13 as well?
Here is a related discussion that might help: https://e2e.ti.com/support/microcontrollers/c2000-microcontrollers-group/c2000/f/c2000-microcontrollers-forum/1032698/tms320f28377d-requirements-for-adcinltrim-and-adcofftrim-when-adc-is-controlled-by-cpu2/3829574#3829574
-Tommy
Hello tlee,
First, I didn't configured PCLKCR13 register. Is it mandatory or not ?
I solved the issue (it was not an issue with the ADC conversion, it was a memory error : I wrote the conversion results in a shared memory with CPU2, and it didn't worked).
It seems it works without configuring PCLKCR13 register, but is is the right way to proceed ? Or I have to like this :
EALLOW;
CpuSysRegs.PCLKCR13.bit.ADC_A = 0;
CpuSysRegs.PCLKCR13.bit.ADC_B = 0;
CpuSysRegs.PCLKCR13.bit.ADC_C = 0;
CpuSysRegs.PCLKCR13.bit.ADC_D = 0;
EDIS;
EALLOW;
DevCfgRegs.CPUSEL11.bit.ADC_A = 1; // Connected to CPU2
DevCfgRegs.CPUSEL11.bit.ADC_B = 1; // Connected to CPU2
DevCfgRegs.CPUSEL11.bit.ADC_C = 1; // Connected to CPU2
DevCfgRegs.CPUSEL11.bit.ADC_D = 1; // Connected to CPU2
EDIS;
EALLOW;
CpuSysRegs.PCLKCR13.bit.ADC_A = 1;
CpuSysRegs.PCLKCR13.bit.ADC_B = 1;
CpuSysRegs.PCLKCR13.bit.ADC_C = 1;
CpuSysRegs.PCLKCR13.bit.ADC_D = 1;
EDIS;
Thanks for your feedback.
Regards,
electrocc,
I'm glad you were able to resolve the issue. From my understanding, PCLKCR13 will need to be set (1) on the CPU that has use privileges for the ADC, but you do not need to clear (0) the settings for the other CPU.
-Tommy
tlee,
I don't understand what you explain. From my understanding,CPUSEL11 and PCLKCR13 registers can only be configured by CPU1, so this is how I proceed (this is a loop) :
Beginning of the loop :
On CPU1 :
EALLOW;
CpuSysRegs.PCLKCR13.bit.ADC_A = 0;
CpuSysRegs.PCLKCR13.bit.ADC_B = 0;
CpuSysRegs.PCLKCR13.bit.ADC_C = 0;
CpuSysRegs.PCLKCR13.bit.ADC_D = 0;
EDIS;
EALLOW;
DevCfgRegs.CPUSEL11.bit.ADC_A = 0; // Connected to CPU1
DevCfgRegs.CPUSEL11.bit.ADC_B = 0; // Connected to CPU1
DevCfgRegs.CPUSEL11.bit.ADC_C = 0; // Connected to CPU1
DevCfgRegs.CPUSEL11.bit.ADC_D = 0; // Connected to CPU1
EDIS;
EALLOW;
CpuSysRegs.PCLKCR13.bit.ADC_A = 1;
CpuSysRegs.PCLKCR13.bit.ADC_B = 1;
CpuSysRegs.PCLKCR13.bit.ADC_C = 1;
CpuSysRegs.PCLKCR13.bit.ADC_D = 1;
EDIS;
- Conversion on CPU1
- On CPU 1 :
EALLOW;
CpuSysRegs.PCLKCR13.bit.ADC_A = 0;
CpuSysRegs.PCLKCR13.bit.ADC_B = 0;
CpuSysRegs.PCLKCR13.bit.ADC_C = 0;
CpuSysRegs.PCLKCR13.bit.ADC_D = 0;
EDIS;
EALLOW;
DevCfgRegs.CPUSEL11.bit.ADC_A = 1; // Connected to CPU2
DevCfgRegs.CPUSEL11.bit.ADC_B = 1; // Connected to CPU2
DevCfgRegs.CPUSEL11.bit.ADC_C = 1; // Connected to CPU2
DevCfgRegs.CPUSEL11.bit.ADC_D = 1; // Connected to CPU2
EDIS;
EALLOW;
CpuSysRegs.PCLKCR13.bit.ADC_A = 1;
CpuSysRegs.PCLKCR13.bit.ADC_B = 1;
CpuSysRegs.PCLKCR13.bit.ADC_C = 1;
CpuSysRegs.PCLKCR13.bit.ADC_D = 1;
EDIS;
- Then Conversion on CPU2
- Then back to the beginning of the loop
Is it the good way to proceed ?
Regards,
tlee,
In my software, I proceed like I described in my previous post. I didn't configured PCLKCR13 register on CPU2 and it seems to works.
- Is it possible that even if the ADC conversion is started on CPU2, it's in reality CPU1 which is driving the conversion ?
- How to be sure that CPU2 drives really the conversion ?
Thanks for your support.
Regards
electrocc,
What is your ADC trigger source?
If you are reusing snippets of TI example software, it's likely that you are calling a function like InitSysCtrl() that enables all of the clocks in the system.
The ADC configuration registers will only be accessible by one CPU for a given instance. You can verify the CPU assignment by reading back the configuration registers. The behavior is described in this other thread: https://e2e.ti.com/support/microcontrollers/c2000-microcontrollers-group/c2000/f/c2000-microcontrollers-forum/1032698/tms320f28377d-requirements-for-adcinltrim-and-adcofftrim-when-adc-is-controlled-by-cpu2/3829574#3829574
-Tommy