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.

[参考译文] CC2340R5:ADC_CTL1寄存器 CAN't WRITE

Guru**** 2595805 points


请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

https://e2e.ti.com/support/wireless-connectivity/bluetooth-group/bluetooth/f/bluetooth-forum/1354415/cc2340r5-adc_ctl1-register-can-t-write

器件型号:CC2340R5

您好、专家!

我要配置 CC2340 ADC 以使用自动模式进行重复的单通道转换,并且应该配置 ADC。 CTL1寄存器 CONSEQ 为2h

但当我访问 ADC 时。 写入任何内容都没有效果、即使我回读寄存器的值、它也始终为零。 附上了我的测试代码供您参考。

uint32_t tempCtl;

/*启用转换。 这可以连接外设、现在可以触发*/
HWREG (ADC_base + ADC_O_CTL0)|= ADC_CTL0_ENC_ON|ADC_CTL0_PWRDN_MANUAL;

/*读取电流控制寄存器*/
tempCtl = HWREG (ADC_base + ADC_O_CTL1);

/*清除触发相关的字段*/
tempCtl &=~(ADC_CTL1_SAMPMODE_M | ADC_CTL1_SC_M | ADC_CTL1_TRIGSRC_M);

/*将采样模式设置为自动、并将触发源设置为软件*/
tempCtl |= ADC_CTL1_SAMPMODE_AUTO | ADC_CTL1_TRIGSRC_SOFTWARE|ADC_CTL1_CONSEQ_REPEATSINGLE;

/*写回控制寄存器*/
HWREG (ADC_base + ADC_O_CTL1)= tempCtl;
tempCtl = HWREG (ADC_base + ADC_O_CTL1);

/*触发转换*/
HWREG (ADC_base + ADC_O_CTL1)|= ADC_CTL1_SC_START;

存储器浏览器中的图片。

谢谢、此致