You are here

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

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

Summary: 5 Replies, Latest post by Bob Marlowe on 12 Oct 2016 05:02 AM PDT
Verified Answers: 1
Last post
Log in to post new comments.
user_365962704's picture
User
163 posts

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

user_1377889's picture
User
9581 posts

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

 

Bob

user_365962704's picture
User
163 posts

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

user_1377889's picture
User
9581 posts

Will probably not work. Define a button at least.

 

Bob

user_365962704's picture
User
163 posts

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

user_1377889's picture
User
9581 posts

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

Log in to post new comments.