ADC routing in Modus for P6 BLE

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.
GrahamS_21
Employee
Employee
25 replies posted 10 likes received 10 replies posted

Team

i'm trying to get the ADC routing working properly in Modus 2.0 for the PSoC 6 BLE module using the 063 proto board.

i started with the empty psoc project from modus, added LEDs, Button, and uart for printf. all appear to work fine.

i then added the ADC, and through a lot of trial and error got something to work.

i followed the examples from the pdl documentation, and have 2 channels 1 single ended and 1 differential.

the interrupt works ok, but i find if i connect the single ended input to GND or VDD, the differential inputs also change. not to the same scale but there is an affect.

if left floarting the single ended input says ~270mV and the differential one says -1250mV

if i ground the singled ended input that says 0mv where as the diff says -1550mV.

likewise if i gnd P10_1 input of the diff channel, the value reads 760mv, but the single ended input also say 1280mV.

it seems like it's not disconnecting the channels properly.

i have attached my main.c and my config.h file, that's all i've changed, can you advise why i'm getting odd readings?

thanks

Graham

0 Likes
1 Solution
Vasanth
Moderator
Moderator
Moderator
250 sign-ins 500 solutions authored First question asked

Hi Graham,

The acquisition time should be dependent on the input source, 9 times the RC time constant is the recommended value to be given.

pastedImage_0.png

For inputs which are floating we cannot expect the reading to remain constant. But for inputs with proper input signal this should guarantee proper result.

Best Regards,
Vasanth

View solution in original post

0 Likes
3 Replies
Vasanth
Moderator
Moderator
Moderator
250 sign-ins 500 solutions authored First question asked

Hi Graham,

One suggestion could you please reduce the execution time of the ISR. Get the results int the ISR and mark a flag, do the printf action inside the main loop. Also could you try increasing the acquisition time in the code. See sample time (SAMPLE_TIME01) in code.

Best Regards,
Vasanth

0 Likes

Hi Vasanth

the printf in the ISR is lazy coding so i can definitely change that.

however the sample time is exactly that which is set in the documentation in the PDL.(section for Cy_SAR_Init() )

so if we think the sample time is an issue, perhaps we should change the default numbers?

thanks

Graham

0 Likes
Vasanth
Moderator
Moderator
Moderator
250 sign-ins 500 solutions authored First question asked

Hi Graham,

The acquisition time should be dependent on the input source, 9 times the RC time constant is the recommended value to be given.

pastedImage_0.png

For inputs which are floating we cannot expect the reading to remain constant. But for inputs with proper input signal this should guarantee proper result.

Best Regards,
Vasanth

0 Likes