Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
lock attach
Attachments are accessible only for community members.
chme_4646286
Level 4
Level 4
Distributor - Intron(GC)
50 replies posted 100 sign-ins First comment on blog

请教一个问题:

在CYTVII-B-E-1M-SK 上验证SDL7.3中ADC 模块功能,默认P6.0 = > ADC[0]_0功能正常的;

按照相同配置,我把端口改成P13_2 => ADC[1]_14,如果不使用中断,则可以正常转换,且结果也是正常的;

但是我配置中断功能后,执行到NVIC_EnableIRQ()后程序就跑飞,进入Cy_DefaultUserHandler()中;

能否帮忙检查下我配置的中断是哪里有错误吗?

chme_4646286_0-1652176976161.png

 

0 Likes
1 Solution
Alfred_Tsang
Moderator
Moderator
Moderator
50 replies posted 50 sign-ins 10 solutions authored

Hi chem_4646286,

如果要将 ADC 端口从 P6.0 更改为 P13.2,
那么您还应该更改 AdcIntHandler() 中的analog macro (BB_POTI_ANALOG_MACRO -> CY_ADC1_POT_MACRO)

谢谢

Alfred_Tsang_1-1652252282166.png

Alfred_Tsang_2-1652252326262.png

 

 

 

 

View solution in original post

0 Likes
2 Replies
Alfred_Tsang
Moderator
Moderator
Moderator
50 replies posted 50 sign-ins 10 solutions authored

Hi chem_4646286,

如果要将 ADC 端口从 P6.0 更改为 P13.2,
那么您还应该更改 AdcIntHandler() 中的analog macro (BB_POTI_ANALOG_MACRO -> CY_ADC1_POT_MACRO)

谢谢

Alfred_Tsang_1-1652252282166.png

Alfred_Tsang_2-1652252326262.png

 

 

 

 

0 Likes
chme_4646286
Level 4
Level 4
Distributor - Intron(GC)
50 replies posted 100 sign-ins First comment on blog

Hi Alfred_Tsang;

感谢,的确是这个地方的问题;

我原以为是中断配置的问题,因为NVIC_EnableIRQ()使能中断的时候,ADC的通道即没有使能也没有触发转换,所以即使中断服务函数有错误,此时也不会跳入到中断复位函数进行处理;

看来底层还有其他的关联性;

0 Likes