[4000S - Kit 041-40xx] Program doesn´t run when starting the CapSense ADC

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

cross mob
lock attach
Attachments are accessible only for community members.
cadi_1014291
Level 6
Level 6
25 likes received 10 likes received 10 likes given

Hi,

   

Have been working with the 41-40xx kit, i would like to read the voltage on the onboard potentiometer and printing the result via UART on the PC.

   

I'm following a code example that does this, so i created a new project and added the components on the schematic, assigned the pins, incremented heap size and placing the -u_printf_float flag on the linker, also enabling the nano lib.

   

Then started to write the C code but when i call the CapSense_ADC_Start() function, the project doesn't run (the red LED doesn't blink), when i comment that CapSense_ADC_Start() function the project works as expected (a blinky red LED).

   

I had changed the stack size to 0x200 (previously it had 0x400, the example code have 0x200).

   

 

   

Attached is the project if someone like to take a look and maybe spot my error.

   

Carlos

0 Likes
5 Replies
Bob_Marlowe
Level 10
Level 10
First like given 50 questions asked 10 questions asked

You did not define any widget (button, slider, proxi) for your capsense component.

   

 

   

Bob

0 Likes
cadi_1014291
Level 6
Level 6
25 likes received 10 likes received 10 likes given

No, just wanted an ADC channel, i defined one.

0 Likes
Bob_Marlowe
Level 10
Level 10
First like given 50 questions asked 10 questions asked

Will probably not work. Define a button at least.

   

 

   

Bob

0 Likes
cadi_1014291
Level 6
Level 6
25 likes received 10 likes received 10 likes given

Yep, adding a dummy capsense button did the trick, now at least the program doesn't get stuck.

   

Is this (adding a button to get the ADC function) documented somewhere on the CapSense_ADC datasheet? I haven't read the whole thing.

   

 

   

Thanks for the help Bob :), will upload the project when i get it running properly.

   

Carlos

0 Likes
Bob_Marlowe
Level 10
Level 10
First like given 50 questions asked 10 questions asked

Well, I did not look for a documentation, but I suspected that to be the cause and looked into the initialization code. Programming for 40 years pays for itself in cases like this 😉

   

 

   

Bob

0 Likes