Could you please add CSD_ScanSensor(bCtr) before CSD_InitializeSensorBaseline(bCtr); to act as a dummy scan? Since Vref setting is changed, CMOD needs settling time.
I will do a test on your project. Also please let me know whether you are testing this on Development kit or your custom board?
I'm using this project on my custom board. I will test your solution soon and let you if it is solved.
I tested your suggestion, but it doesn't solve the problem. The raw count is still about 2200 units lower then the baseline value for buttons 1 and 2.
For the other buttons, the raw count matches the baseline value.
Any other suggestions?