You are here

Capsense design with dual sliders | Cypress Semiconductor

Capsense design with dual sliders

Summary: 5 Replies, Latest post by AMraje on 13 Oct 2014 06:51 AM PDT
Verified Answers: 0
Last post
Log in to post new comments.
craig's picture
User
1 post

I have a design using 2 touch sense sliders (1 with 13 elements, the second with 5). They're sued together to form a touchpad matrix.

This is a rework fo an earlier design on which I used the system level design (so it shoudl work), but as this is no longer recommended, I have swapped over to using the chip level.

My problem is the larger slider only seems to be using 3/4's of its sensors, and the second slider isn't working at all. I thought the paramenter might have fixed it, but I don't seem to be able to get any change in performance. I have inspected the board about a dozen times looking for open or short circuits and foudn nothing, which has left me looking at my code.

Is there something wrong with what I have done? Or is there something else I may have overlooked?

void main(void)

{

int pos_x, pos_y;

BYTE out_data[2];

// Insert your main routine code here.

M8C_EnableGInt;

CAPSENSE_Start();

CAPSENSE_InitializeBaselines();

CAPSENSE_SetDefaultFingerThresholds();

I2C_OUT_Start();

//I2C_OUT_EnableMstr();

while(1) //loop forever

{

CAPSENSE_ScanAllSensors();

CAPSENSE_UpdateAllBaselines();

pos_x =CAPSENSE_wGetCentroidPos(1);

CAPSENSE_ScanAllSensors();

//CAPSENSE_UpdateAllBaselines();

pos_y =CAPSENSE_wGetCentroidPos(2);

//if the colour palette is active

if((pos_x != 0xFFFF) || (pos_y != 0xFFFF))

{

//transmit the position via I2C

out_data[0] = pos_x;

out_data[1] = pos_y;

I2C_OUT_bWriteBytes(1, out_data, 2, I2C_OUT_CompleteXfer);

}

}

}quote>
user_420283366's picture
User
161 posts

Hi Craig, I'm a newbee here; after reading your post here I think you can help me.

mine one is consisting of  few buttons & a slider with few segments (consider 5+5), I'm assigning separate LED's for each of them; while doing this my problem is that I'm getting it worked for 5 buttons, but as I'm going for morebuttons or slider it do not give proper output.

I have specified some default values in my code such as----0x01, 0x02, 0x04, 0x08, 0x10 (for 5 buttons);

can you tell me yhe logic behind it or is it related to increasing the o/p LED's?

I'm attaching my project here please go through it, do the needed & tell me where n what to workout.

thanks n waiting

Regards-

Amit

user_1377889's picture
User
10803 posts

@Amit

The post you are referring to is more than 4 years old. Probably the original poster already works for a different company ;-)

 

Bob

user_420283366's picture
User
161 posts

hi Bob, can you help me with that same thing. I've posted my archived project under the heading CAPSENSE PROGRAMING

for your sake I'm attaching it here also, please go through it & help me out with it, specially coding part.

also explain--

led_Data_ADDR |= led_MASK;  

led_Data_ADDR &= (~led_MASK);  commands

Regards--

Amit

user_1377889's picture
User
10803 posts

What about getting one of the examples to work? You'll find some within the CapSense datasheet, some more explanation is to be found here: www.cypress.com/

 

The code snipped you asked for is the standard approach for setting and resetting a bit, in this case of an IO-pin which sometimes does not work because of a "read-modify-write problem" in PSoC1 chips.

 

Bob

user_420283366's picture
User
161 posts

Thanks Bob I will go through it & get back to you if any further queries emerge.

Regards-

Amit

Log in to post new comments.