SAR ADC Config Register not writing in debuger

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

cross mob
JeSy_1305731
Level 4
Level 4
First like received

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.

0 Likes
1 Reply
Anonymous
Not applicable

Hi,

   

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?

   

Regards,

   

- Madhu Sudhan

0 Likes