Thread 中讨论的其他器件:LP-MSPM0G3507
工具/软件:
尊敬的 TI 工程师:
我希望此消息能帮您找到答案。 我目前正在根据示例“adc_singlechanel"(“(PA22→ADC0、PA17→ADC1 TI_driver) 开发 ADC 配置。 最初、我设置了 2 通道 (ADC0 和 ADC1)、但我将 ADC0 从 1 通道扩展到 6 通道。 但是、我遇到了将 3.3V 连接到 PA22 会影响除 ADC0_3 之外的所有读数的问题。
观察到的行为如下:
当 3.3V 连接到 PA22 时、除 ADC0_3 之外、所有 ADC 读数都受影响。
当 3.3V 连接到 PA17 时、ADC0_3 显示一个读数。
当 3.3V 连接到 PA15 时、不会观察到任何影响。
引脚到通道映射如下:
A0_7→PA22
A0_12→PA14
A0_0→PA27
A0_1→PA26
A0_2→PA25
A0_3→PA24
A1_0→PA15
您能否提供指导、说明为什么将 3.3V 连接到 PA22 会影响除 ADC0_3 之外的所有通道? 此外、为什么在连接到 PA17 时将 3.3V 连接到 PA17 会导致 ADC0_3 读数、而连接到 PA15 则无效?
感谢您的时间和支持。 我期待着您的见解。
此致、
Pakho
void *adcSrvThread(void *arg) {
AdcSrv_Handle adcSrv; // ADC service handle
// Statistics for 6 ADC0 channels and 1 ADC1 channel
AdcSampleStats stats0; // ADC0 Channel 7 (A0_7 - AMP_ID)
AdcSampleStats stats0_12; // ADC0 Channel 12 (A0_12 - HW_ID)
AdcSampleStats stats0_0; // ADC0 Channel 0 (A0_0 - CH1_FET1_NTC)
AdcSampleStats stats0_1; // ADC0 Channel 1 (A0_1 - CH1_FET2_NTC)
AdcSampleStats stats0_2; // ADC0 Channel 2 (A0_2 - CH2_FET1_NTC)
AdcSampleStats stats0_3; // ADC0 Channel 3 (A0_3 - CH2_FET2_NTC)
AdcSampleStats stats1; // ADC1 Channel
// Initialize ADC service
if (AdcSrv_init(&adcSrv) != 0) {
LOG_PRINT_ERR("ADC service initialization failed");
return NULL;
}
LOG_PRINT_INF("ADC service started with 6 channels");
uint32_t cycle_count = 0;
while (1) {
// Clear statistics for all channels
memset(&stats0, 0, sizeof(AdcSampleStats));
memset(&stats0_12, 0, sizeof(AdcSampleStats));
memset(&stats0_0, 0, sizeof(AdcSampleStats));
memset(&stats0_1, 0, sizeof(AdcSampleStats));
memset(&stats0_2, 0, sizeof(AdcSampleStats));
memset(&stats0_3, 0, sizeof(AdcSampleStats));
memset(&stats1, 0, sizeof(AdcSampleStats));
// Perform ADC sampling cycle with correct parameter order
// Order: stats0 (A0_7), stats0_12 (A0_12), stats0_0 (A0_0), stats0_1 (A0_1), stats0_2 (A0_2), stats0_3 (A0_3), stats1 (ADC1)
if (AdcSrv_sampleCycle(&adcSrv, &stats0, &stats0_12, &stats0_0, &stats0_1, &stats0_2, &stats0_3, &stats1) != 0) {
break;
}
// Display results for all 6 ADC0 channels
if (stats0.avg > 0) {
LOG_PRINT_DBG("ADC0_7(AMP_ID)[%lu]: min=%d, max=%d, avg=%d (%.2f V)",
cycle_count, stats0.min, stats0.max, stats0.avg,
(float)stats0.microvolts / 1000000.0f);
}
if (stats0_12.avg > 0) {
LOG_PRINT_DBG("ADC0_12(HW_ID)[%lu]: min=%d, max=%d, avg=%d (%.2f V)",
cycle_count, stats0_12.min, stats0_12.max, stats0_12.avg,
(float)stats0_12.microvolts / 1000000.0f);
}
if (stats0_0.avg > 0) {
LOG_PRINT_DBG("ADC0_0(CH1_FET1_NTC)[%lu]: min=%d, max=%d, avg=%d (%.2f V)",
cycle_count, stats0_0.min, stats0_0.max, stats0_0.avg,
(float)stats0_0.microvolts / 1000000.0f);
}
if (stats0_1.avg > 0) {
LOG_PRINT_DBG("ADC0_1(CH1_FET2_NTC)[%lu]: min=%d, max=%d, avg=%d (%.2f V)",
cycle_count, stats0_1.min, stats0_1.max, stats0_1.avg,
(float)stats0_1.microvolts / 1000000.0f);
}
if (stats0_2.avg > 0) {
LOG_PRINT_DBG("ADC0_2(CH2_FET1_NTC)[%lu]: min=%d, max=%d, avg=%d (%.2f V)",
cycle_count, stats0_2.min, stats0_2.max, stats0_2.avg,
(float)stats0_2.microvolts / 1000000.0f);
}
if (stats0_3.avg > 0) {
LOG_PRINT_DBG("ADC0_3(CH2_FET2_NTC)[%lu]: min=%d, max=%d, avg=%d (%.2f V)",
cycle_count, stats0_3.min, stats0_3.max, stats0_3.avg,
(float)stats0_3.microvolts / 1000000.0f);
}
// Display results for ADC1 channel
if (stats1.avg > 0) {
LOG_PRINT_DBG("ADC1[%lu]: min=%d, max=%d, avg=%d (%.2f V)",
cycle_count, stats1.min, stats1.max, stats1.avg,
(float)stats1.microvolts / 1000000.0f);
}
LOG_PRINT_DBG("----------------------");
cycle_count++;
usleep(CYCLE_DELAY_MS * 1000);
}
// Cleanup ADC service
AdcSrv_close(&adcSrv);
return NULL;
}
e2e.ti.com/.../AdcDrv.ce2e.ti.com/.../AdcDrv.he2e.ti.com/.../AdcSrv.ce2e.ti.com/.../AdcSrv.he2e.ti.com/.../7534.ti_5F00_drivers_5F00_config.ce2e.ti.com/.../ti_5F00_drivers_5F00_config.h



