对不起,我的参考手册版本不是最后一本(修订版6 RM0349)
表12在rev 3上不正确。
在与专家核实后。
这是答案。
'问题与主管ADC的错误地址无关(
SAR_ADC_12BIT_B0
),但它与时钟门控有关。
每次驱动器启动(xxx_lld_start)时,都会写入正确的PTCL寄存器,以便将时钟门控到外设。使用未包含在spc5studio中的驱动程序时
访问寄存器之前要做的第一个操作是使用该函数对时钟进行门控,否则会产生IVOR1。
SPCSetPeripheralClockMode(PCTL NUMBER,(SPC5_ME_PCTL_RUN(2)| SPC5_ME_PCTL_LP(2)));
在这种情况下,PCTL NUMBER为
SAR_ADC_12BIT_B0
是112(RM中的表658)。
最好的祝福
二万
以上来自于谷歌翻译
以下为原文
Sorry , i was on a bad revision of the reference manual not the last one (Revision 6 RM0349)
Table 12 was not correct on rev 3.
after checking with expert.
here is the answer.
'The problem is not related to wrong address of the supervisor ADC (
SAR_ADC_12BIT_B0
), but It is related to clock gating.
Every time a driver is start (xxx_lld_start) the correct PTCL register is written in order to gate the clock to the peripherals. When using a driver not included in spc5studio
The first operation to do before accessing register is to gate the clock using the function, otherwise IVOR1 is generated.
SPCSetPeripheralClockMode(PCTL NUMBER, (SPC5_ME_PCTL_RUN(2) | SPC5_ME_PCTL_LP(2)));
In this case the PCTL NUMBER for
SAR_ADC_12BIT_B0
is 112 (table 658 in the RM).'
Best regards
Erwan