Skip navigation
Home > All Places > MCU & PSoC > PSoC 4 MCU Community > Blog
RyanZ_36

10-bit ADC CSD Code Example

Posted by RyanZ_36 Moderator Dec 3, 2018

Hello Everyone!

 

10-bit ADC for PSoC 4 is a triggered analog to digital converter. The Component includes a customizer to configure the initial state and APIs to control the Component from application firmware.

Some one may want to use 10-bit ADC CSD Component, but doesn't find its code example in PSoC Creator.

Here is a code example of the component for your reference.

You just need to drag the component to your TopDesign.cysch, give it an instance name, select 10-bit or 8-bit you want to use. Ah! Don't forget to select its number of input channels (If you have read its datasheet carefully, you will find that the channel number is up to 10 ). Then add the following code(easy code, right?).

 

#include "project.h"

volatile uint16 ADC_CSD_result;

int main(void)
{
    CyGlobalIntEnable; /* Enable global interrupts. */

    /* Place your initialization/startup code here (e.g. MyInst_Start()) */    
    ADC_CSD_Start();
    
    for(;;)
    {
        /* Place your application code here. */
        while(ADC_CSD_Calibrate());
        ADC_CSD_result = ADC_CSD_ReadResult_mVolts(0);
        CyDelay(1);
    }
}

 

I tested the code on KIT-041-40XX. There is a sliding resistor(The pin should be P2.4) on the kit.

Built and Programmed successfully. Entered in PSoC Creator debug mode. I got the result of the ADC:

Note that:

1. Don't need Cmod for this component;

2. CapSense Component uses same internal resource with the 10-bit ADC, so you can only choose one between these two in one project.

 

Hope it can help you!

ShanmathiN_06

MBR 3xxx CapSense design

Posted by ShanmathiN_06 Moderator Jul 11, 2018

Hello everyone!

 

Here is some information on how to design CapSense sensors while developing Capacitive sensing applications in MBR 3xxx.

 

Schematic design:

After selecting MBR3 device, while designing schematic you can refer to the following documents:

 

1) MBR3 datasheet (http://www.cypress.com/file/46236/download )

2) CapSense schematic design section in AN90071 - MBR3xxx CapSense Design Guide (http://www.cypress.com/file/46366/download)

 

Layout design:

While designing PCB, refer to the following documents:

 

1) While designing any CapSense sensor, you can refer to MBR3 design Toolbox (http://www.cypress.com/file/46361/download) to decide on the sensor dimensions.

2) CapSense layout guidelines section in AN90071 - MBR3xxx CapSense Design Guide (http://www.cypress.com/file/46366/download)

3) Design considerations section in AN64846 - Getting Started with CapSense (http://www.cypress.com/file/41076/download)

 

Following the above mentioned guidelines in various documents will help achieve high SNR, better performance and electromagnetic compatibility.

 

Feel free to leave comments and ask questions, we appreciate the feedback!

ShanmathiN_06

PSoC 4 CapSense design

Posted by ShanmathiN_06 Moderator Jul 11, 2018

Hello everyone!

 

Here is some information on how to design CapSense sensors while developing Capacitive sensing applications in PSoC 4.

 

Schematic design:

After selecting PSoC device, while designing schematic you can refer to the following documents:

 

1) PSoC 4 datasheet (depends on the selected device)

2) Schematic Rule checklist section in AN85951 - PSoC 4 and PSoC 6 MCU CapSense Design Guide (http://www.cypress.com/file/46081/download)

3) AN88619 - Hardware design considerations http://www.cypress.com/file/141176/download

 

Layout design:

While designing PCB, refer to the following documents:

 

1) Design considerations section in AN85951 - PSoC 4 and PSoC 6 MCU CapSense Design Guide (http://www.cypress.com/file/46081/download)

2) Specifically, layout rule checklist section in AN85951

3) For proximity sensor design, refer to AN64846 - Getting Started with CapSense (http://www.cypress.com/file/41076/download) and AN92239 - Proximity Sensing with CapSense (http://www.cypress.com/file/46741/download)

 

Following the above mentioned guidelines in various documents will help achieve high SNR, better performance and electromagnetic compatibility.

 

In case you use Altium designer software, then you can also refer to Cypress Touch Controls | Online Documentation for Altium Products

 

Feel free to leave comments and ask questions, we appreciate the feedback!