Thanks for correction. Apparently this fix did not completely solve the problem. I got the same results with the following code segment.
volatile int32 sensor_value;
volatile int32 busy_flag;
CyGlobalIntEnable; /* Enable global interrupts. */
/* Place your initialization/startup code here (e.g. MyInst_Start()) */
while( CapSense_1_IsBusy() != 0 )
busy_flag = CapSense_1_IsBusy();
sensor_value = CapSense_1_ReadSensorRaw(0);
sensor_value is 0x3fff and the busy flag is 0 as a sanity check
I found out that my sensors had a lot of capacitance. By change the modulator and clock divider and clock divider from 2 to 10, seems to solve this problem The scan time increased from 1. ms to around 13.6 ms. This larger scan time seems to allow larger capacitances to be accomodated.