ADC with optimisation -Os enabled

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

ADC with optimisation -Os enabled

400 Views
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 Kudos
Reply
3 Replies

391 Views
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 Kudos
Reply

391 Views
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 Kudos
Reply

391 Views
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 Kudos
Reply