You are here

SAR ADC Config Register not writing in debuger | Cypress Semiconductor

SAR ADC Config Register not writing in debuger

Summary: 1 Reply, Latest post by Madhu Sudhan on 13 Mar 2016 07:37 AM PDT
Verified Answers: 0
Last post
Log in to post new comments.
jetro570's picture
27 posts

I am using PRoC on BLE-KIT-042 and running BLE_Battery_Level example, I am seeing that the SAR ADC Config register is not being written to during debug stepping, but works while running.  

1) just wondering if this is something wrong with the tool?   

2) or is this some function of the BLE component stack?

3) or is some function of some other register needs to be enabled first, or some other register is effecting my ability to write in debugger.

In particular,  I am trying to write 0x70 to config register to set up Vref as VDDA (3.3v) and Instead I get 0x00 in the debugger.  and ADC conversion do not work / never change while stepping through the debugger,  but If I run the code, it works? (I can read ADC, put the value into variable, and send it out API over bluetooth, and see battery level go up and down as it should.

4) I recommend not posting sample projects that do not work. (Battery Level).   Just for reference, I am using a pot connected to ADC to change signal from 0 to 100% battery level, on P3.0 is not connected to Vref as on Pioneer board example suggests.

mady's picture
Cypress Employee
964 posts


For systems such as ADC, the behavior during debug won't be the same as how they run.

I see that you have connected the p3.0 to a POT and varying the voltage. You should be able to notice the change the adcResults and mVolts variables on the project. Based on these two values, you can measure the actual Battery level VDDA. Can you please print these two values and see if they change as expected when you change the POT Voltage?


- Madhu Sudhan

Log in to post new comments.