SAR ADC Modustoolbox

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.
jepaz
Level 4
Level 4
25 replies posted 10 replies posted 10 questions asked

Hello Everyone, I am just getting my head around Modustoolbox, It is a very powerful tool. I guess the problem we face with PSoC devices is shortage of simple examples to get a head start.

I am trying to get SAR ADC to read 3 analog single ended signals on the psoc 6 BLE PROTOTYPING KIT (cy8cproto-063-ble) I cant find a working example, been putting some code together sort of works I am getting an interrupt triggered by the EOS routine. The SAR conversion is triggered with the user button, and the UART is used for preview the values.

surely I am missing something. .chanEn = 7UL,? seems ok, Cy_SAR_Init(ADC_HW, &ADC_config); then enable and start convert.

the program runs I am not getting any values that can relate to the voltage.

any help is appreciated

0 Likes
1 Solution
lock attach
Attachments are accessible only for community members.
Vasanth
Moderator
Moderator
Moderator
250 sign-ins 500 solutions authored First question asked

Hello Juan,

Could you please enable the Aref block too before using the SAR ADC.

    cy_en_sysanalog_status_t status_aref;

    status_aref = Cy_SysAnalog_Init(&Cy_SysAnalog_Fast_Local);

    /* Turn on the hardware block. */

    Cy_SysAnalog_Enable();

    /*

I have attached one sample code I have generated too which was tested to be working at my end.

Best Regards,
Vasanth

View solution in original post

2 Replies
lock attach
Attachments are accessible only for community members.
Vasanth
Moderator
Moderator
Moderator
250 sign-ins 500 solutions authored First question asked

Hello Juan,

Could you please enable the Aref block too before using the SAR ADC.

    cy_en_sysanalog_status_t status_aref;

    status_aref = Cy_SysAnalog_Init(&Cy_SysAnalog_Fast_Local);

    /* Turn on the hardware block. */

    Cy_SysAnalog_Enable();

    /*

I have attached one sample code I have generated too which was tested to be working at my end.

Best Regards,
Vasanth

jepaz
Level 4
Level 4
25 replies posted 10 replies posted 10 questions asked

Thank you Vasanth,

I was trying to get AREF enabled but it was asking me for an OPAMP reference I didn't realize the reference can be local.

and enabling the hardware block was missing

thanks

0 Likes