Capsense Uart and Tuner by Bluetooth

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

cross mob
almc_4008691
Level 3
Level 3
First like received

Hello,

I have red that I can use the UART transmission with the last version (6) of Capsense using the Tuner.

So basically I'am using a small Bluetooth HC-06 module to send the data through the block software Tx UART call : TX

pastedImage_0.png

But I can connect to the tuner.

Here is the basic code example:

pastedImage_1.png

I found the right COM12 for the Bluetooth Module but I get a message when I try to connect it:

pastedImage_0.png

Then :

pastedImage_1.png

Thank you in advance,

Alex

0 Likes
1 Solution

Hi,

So right now I'm using the board CY8CKIT-040 with a proximity sensor(p0.5) pcb and a shield on the shield pin (p0.6).

The Bluetooth HC-06 module is connected on the pin ( 3.3V / GND/ TX(P0.1))

The Bluetooth is only sending data not receiving but I dont think it's a problem for the application because the data are sent by the board via the UART ( Bluetooth module) to the tuner on the laptop.

It's working well with the bridge control panel when I'm sending my data through it.

At the moment I'm only using the UART tuner code example since the beginning.

The tuner say when I try to connect :" The device was not properly configured" and after an other windows with : "Object reference not set to an instance of an object."

Update: IT'S working when I connected to the bridge and then directly connected to the tuner, I think the tuner have some problem to find the bluetooth module maybe

View solution in original post

0 Likes
18 Replies
LiDo_2439176
Level 5
Level 5
First question asked 50 replies posted 50 sign-ins

Hi,

I don't see the message you get when you try to connect.

Have you Right-click the CapSense Component in the schematic and select Launch Tuner from the context menu ?

Best regards,

Liviu

0 Likes

I updated my post sorry

Alex

0 Likes

Hi Alex,

In the picture above you selected I2C interface and not COM12.

Best regards,

Liviu

0 Likes
lock attach
Attachments are accessible only for community members.

Hi Liviu,

It was just for the screenshot but I tried with my COM12.

I'm using a board CY8CKIT-040 with CY8C4014LQI-422 on PSoC

Same Baud rate at 9600

Nothing else on the COM12

Thank you

Alex

0 Likes
Hari
Moderator
Moderator
Moderator
750 replies posted 500 replies posted 250 solutions authored

Hi

Can you please share the project that you are using?

Or please try with the code example that is provided in PSoC creator to check if the device is working properly.

Thanks and regards

Harigovind

0 Likes

Hi ALex,

CapSense Tuner waits for data in a specific format. You have removed exactly those lines and added your code that mean nothing for tuner. This is the reason for the message.

You can't use this UART for other purpose. This must be used only for debugging and tuning the CapSense system.

So the right main code is:

//*****************************************************************************

// Application: AMC 

// Author:      Alexandre Michel

// Version:     1.00

// Date:        March 29/2019

// Target:      CY8C4014LQI-422

// IDE tool:    PSoC Creator 4.2

// Comments:    Bluetooth and UART version

//*****************************************************************************

#include "project.h"

uint8 header[] = {0x0Du, 0x0Au};

uint8 tail[] = {0x00u, 0xFFu, 0xFFu};

int main()

{

    __enable_irq(); /* Enable global interrupts. */

   

    TX_Start(); /* Start UART SCB Component */

   

    CapSense_Start(); /* Initialize Component */

   

    CapSense_ScanAllWidgets(); /* Scan all widgets */

   

    for(;;)

    {

    /* Do this only when a scan is done */

    if(CapSense_NOT_BUSY == CapSense_IsBusy())

    {

        CapSense_ProcessAllWidgets(); /* Process all widgets */

        CapSense_RunTuner(); 

        /* SENDING DATA BEGIN*/

       

        /* Send packet header */

        TX_PutArray((uint8 *)(&header), sizeof(header)); /*delete TX_SpiUartPutArray*/

       

        /* Send packet with CapSense data */

       

        TX_PutArray((uint8 *)(&CapSense_dsRam), sizeof(CapSense_dsRam));//????

       

        /* Send packet tail */

        TX_PutArray((uint8 *)(&tail), sizeof(tail));

       

        /* End delimiter of a packet */

        if (CapSense_IsAnyWidgetActive()) /* Scan result verification */

       

        /*SENDING DATA END*/

      {

       

       /* add custom tasks to execute when touch detected */

        }

        CapSense_ScanAllWidgets(); /* Start next scan */

       }

    }

}

Best regards,

Liviu

0 Likes

Hey,

Yeah sorry I changed the code to send my data but anyway I tried as my first post and with your same code and it's impossible to connect to the right COM12. And it's the right one because with the bridge I'm connecting perfectly to it.

Even if I test on the kitprog usb-uart I got that:

pastedImage_0.png

Thanks for your help

Alex

0 Likes

Have you checked with a serial terminal if you receive data on COM12 ?

0 Likes
Hari
Moderator
Moderator
Moderator
750 replies posted 500 replies posted 250 solutions authored

Hi.

Did you try out the code? Were you able to obtain tuner output?

Thanks and regards

Harigovind

0 Likes
Hari
Moderator
Moderator
Moderator
750 replies posted 500 replies posted 250 solutions authored

Hi!

This code is correct. I verified it and it is working. Make sure that you are using this code only.

Please clean and build you project by selecting Build->Clean and Build Test_Self_cap_ALEX_Bluetooth and then program to the device.

If you are using the Cy8CKIT-040, you need an external connection from the software UART pin to PSoC 5LP's pin P12.6. Provide a jumper connection from pin P0.0 of the PSoC to P12.6 of PSoC 5LP. Make sure this connection is present.

Close all other applications that might use the serial port so that COM12 is free for tuner to use.

Do let us know if it solves the problem.

Thanks and regards

Harigovind

0 Likes

Hi,

Thanks for your reply first.

Then, I have check with the jumper and it's working the UART with the cable.

But with my Bluetooth module HC-06 on the COM12 I cant connect.
I can only connect my Bluetooth on the Bridge Panel but not on the Tuner and I'm wondering why?

I have tried with a serial terminal and I cant connect to it too... So I guess it's the problem

I would love to use that Bluetooth module cause I cant have access to the board when my machine is running.

Thank you

0 Likes
Hari
Moderator
Moderator
Moderator
750 replies posted 500 replies posted 250 solutions authored

Hi

Can you please explain your system setup?

How is the tuner receiving information? Is there another Bluetooth module connected to the system that provides the data through UART?

The tuner software can only accept information sent via I2C or UART. Please make sure that the bluetooth device at the receiver side (the one connected to system running Tuner) is also providing information through UART.

Also, make sure that the information (CapSense data structure) sent from the PSoC device is correctly received at the host. CapSense tuner operates only on CapSense data structure. Hence, confirm that the data sent from the PSoC device and the data received by the system are the same.

Thanks and regards

Harigovind

0 Likes

Hi,

So right now I'm using the board CY8CKIT-040 with a proximity sensor(p0.5) pcb and a shield on the shield pin (p0.6).

The Bluetooth HC-06 module is connected on the pin ( 3.3V / GND/ TX(P0.1))

The Bluetooth is only sending data not receiving but I dont think it's a problem for the application because the data are sent by the board via the UART ( Bluetooth module) to the tuner on the laptop.

It's working well with the bridge control panel when I'm sending my data through it.

At the moment I'm only using the UART tuner code example since the beginning.

The tuner say when I try to connect :" The device was not properly configured" and after an other windows with : "Object reference not set to an instance of an object."

Update: IT'S working when I connected to the bridge and then directly connected to the tuner, I think the tuner have some problem to find the bluetooth module maybe

0 Likes
Hari
Moderator
Moderator
Moderator
750 replies posted 500 replies posted 250 solutions authored

Hi

Is there a bluetooth module connected to the laptop also? And is that providing data to the laptop through UART only?

Can you please verify if the data structure sent is correctly received by the system through any terminal software?

Regards

Harigovind

0 Likes
Hari
Moderator
Moderator
Moderator
750 replies posted 500 replies posted 250 solutions authored

Hi

So when you connect the tuner after connecting to the bridge, the tuner is working? Are you able to get the CapSense information over bluetooth now?

0 Likes
Hari
Moderator
Moderator
Moderator
750 replies posted 500 replies posted 250 solutions authored

Hi

Is there any update?


Regards

Harigovind

0 Likes
Hari
Moderator
Moderator
Moderator
750 replies posted 500 replies posted 250 solutions authored

Hi

Can you please attach the project so that we can debug better? Also, please specify the exact device that you are using.

You can find details of archiving a project in this link: Archiving a PSoC Creator Design​.

Also, verify if the UART connections and pin configurations are correct as per your product.

Check the baud rate and ensure that they are the same in top design and in tuner configuration.

Make sure that no other application is using the com port other than tuner.

Thanks and regards

Harigovind

0 Likes
almc_4008691
Level 3
Level 3
First like received

Hey,

Sorry I updated my last answer.

It's working when I connect to the COM12 on the bridge panel control and then directly disconnect and connect it to the tuner.

So I can send the data by bluetooth to the tuner!

Thanks a lot for your answers and your help !

Alex

0 Likes