ADC with optimisation -Os enabled

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

ADC with optimisation -Os enabled

303 次查看
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by mohsin on Mon Jan 10 10:39:13 MST 2011
Hi All,

         I am using LPC1114 inmy project. I am having some issue with the ADC. I am reading AD1 and AD2 using burst mode. It works fine in debug mode but as I enable optimisation -Os, I am getting a 0 for AD2.

         Regards,
         Mohsin
0 项奖励
回复
3 回复数

294 次查看
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by mohsin on Mon Jan 17 06:02:47 MST 2011
The issue has been resolved. It was because I was not using the "volatile" within the interrupt routine.

Thanks,
Mohsin
0 项奖励
回复

294 次查看
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by NXP_USA on Fri Jan 14 19:42:55 MST 2011

Quote: mohsin
It works fine in debug mode but as I enable optimisation -Os, I am getting a 0 for AD2.



Probably the code is working the same way with optimization, but the variables are not appearing set in the debugger as you expect. Check out the link that Code Red posted, it should help.

-NXP
0 项奖励
回复

294 次查看
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by CodeRedSupport on Mon Jan 10 10:52:53 MST 2011
In the first place, read:

http://support.code-red-tech.com/CodeRedWiki/CompilerOptimization

Regards,
CodeRedSupport
0 项奖励
回复