question about CapSense(I2C failed)

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

cross mob
Anonymous
Not applicable

Dear guys,

   

     I am a newer about Psoc4,  Yesterday , I attened  cypress   seminar at hangzhou , and I had not pass the third   experiment about  CapSense with your  PSOC4 Pioneer Kit.

   

   The aim of this experiment  is make developers to familiar with the CapSense module, and the experiment seems very simple , but I have not past  .

   

   The experiment  only have one componment --- CapSense ,   I add a CapSense to the project,  and  add a linearSlider to the module , then  enable tune helper ,set the I2C data Rate to 100kbps, and set I2C address to  8.

   

  Then configure the IO port .

   

Last , add source code to main.c

   

#include <device.h>

   

void main()
{
   
    CapSense_1_TunerStart();
 //   CapSense_1_EnableSensor();  //Not sure where to put this??

   


    /* Place your initialization/startup code here (e.g. MyInst_Start()) */
    CapSense_1_InitializeAllBaselines();
    /* CyGlobalIntEnable; */ /* Uncomment this line to enable global interrupts. */
    for(;;)
    {
        /* Place your application code here. */
        CapSense_1_TunerComm();
    }
}
 

   

But  when I run the application ,  open  laucher  panel . Configuration the I2C , and start ,  It reports failed !!!!!

   

The error information is "Read operation"  failed ! Check I2C bus connection.

   

 

   

can sb tell me why?  

0 Likes
9 Replies
Bob_Marlowe
Level 10
Level 10
First like given 50 questions asked 10 questions asked

Welcome in the fsacinating world of PSoCs!

   

You simply forgot to enable global interrupts. I2C and CapSense rely on interrupts. Uncomment the CyGlobalIntEnable.

   

 

   

Happy coding

   

Bob

0 Likes
Bob_Marlowe
Level 10
Level 10
First like given 50 questions asked 10 questions asked

I do like to see an edit-function!

   

Bob

0 Likes
Anonymous
Not applicable

Dear sir,

   

   Thank you for you hint, however the same error also occurs after I add the statement " CyGlobalIntEnable" .

   

 

   

   I have seen the datasheet from IDE (CapSense) ,It seems there are no different points between my simple project and the project in datasheet except in the datasheet the "button" have been added , while in my project there is only have a CapSense componment!  

   

 

   

 I2C failed ? i do not why?  From the bridge panel the voltage has been put . And the address has been set to same as the  project.

   

  pls refer to attachment!

0 Likes
Bob_Marlowe
Level 10
Level 10
First like given 50 questions asked 10 questions asked
        Please try to upload attachments using internet explorer, some other browsers may fail. Use "Create Workspace Bundle" and upload the archive here.   
   
Bob (STILL Small window!)   
0 Likes
Anonymous
Not applicable
        my attach file   
0 Likes
Anonymous
Not applicable

pls refer to this attachment, 3ks

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

Dear Bob ,

   

   I do not know why I can not uploaded my project (rar file ) to the froum,  I have tried to use internet explore (MS in XP and Win7) and Chrome browser , but failed !

   

 

   

 May be your froum have some issues.

   

 

   

 BTW ,  Can you upload a project that in the project there is only a CapSense module and there is only a LinearSlider in the module , then I can see why my I2C can not be read!

   

Thanks

0 Likes
ETRO_SSN583
Level 9
Level 9
250 likes received 100 sign-ins 5 likes given

If you right click the CSD component, "Find Example Project",

   

pick procject with tuner and open in new workspace option, you

   

will have a working basic project to start from.

   

 

   

0 Likes