Cypress Perform

Home > Design Support > Cypress Developer CommunityTM > Cypress Forums > PSoC® 1 > How to enable/disable sensor autoreset by soft on CY8C24994,?

Bookmark and Share
Cypress Developer CommunityTM
Forums | Videos | Blogs | Training | Rewards Program | Community Components



How to enable/disable sensor autoreset by soft on CY8C24994,?
Moderator:
ARVI

Post Reply
Follow this topic



How to enable/disable sensor autoreset by soft on CY8C24994,?

romrom posted on 21 Jun 2012 2:31 AM PST
Member
2 Forum Posts

Hi,

I would like to be able to allow a long button touch detection time (>15s) but i also must keep the sensor autoreset as enable.

I tried it by setting the baseline_update_threshold at its max (255) but it's not sufficient enough.

So my idea is to disable the sensor autoreset each time  a long touch is detected (by a timer).

I searched on cypress datasheet, applications notes, forums and google but didn't found any information on how to do that.

So my questions are : is it possible ? is there any register, variable or function to access the sensor autoreset setting ?

Thanks,




Re: How to enable/disable sensor autoreset by soft on CY8C24994,?

prkr posted on 04 Jul 2012 09:22 PM PST
Cypress Employee
12 Forum Posts

 Unfortunately, you can't do it without changing the code. Is there a particular reason for keeping the autoreset on ?

You can always keep a software baseline reset for an unwanted condition.

-Prakhar



Re: How to enable/disable sensor autoreset by soft on CY8C24994,?

romrom posted on 06 Jul 2012 01:21 AM PST
Member
2 Forum Posts

Hi, Thanks for your help.

 

I must keep the autoreset on because of environnementals electromagnetismes conditions.

But if i could turn the autoreset off for 15sec (time needed for long touch) and then turn it on it would be OK.

The thing is, I don't know how to turn it on/off by soft.

So my question is which register should i write ? and how to access it ?

Any documentation or weblink would be helpfull.

 

Regards,



Re: How to enable/disable sensor autoreset by soft on CY8C24994,?

arvi posted on 20 Jul 2012 12:09 AM PST
Cypress Employee
119 Forum Posts

 Hi,

 

You can use the Macro, "CSD_AUTORESET", where CSD is your user module name.



Re: How to enable/disable sensor autoreset by soft on CY8C24994,?

arvi posted on 20 Jul 2012 02:22 AM PST
Cypress Employee
119 Forum Posts

Hi,

I think I misunderstood your requirement. The macro is read-only and can't be used to ALTER autoreset status.

 

If you're requirement is to change the Autoreset function (enable/disable) during runtime from within the firmware, you'll have to make some minor modifications to your usermodule code as follows:

 

 

1. Open CSD_1hl.asm from lib>Library Source Files folder

 

2. Find the following section -> 

 

;@PSoC_UserCode_INIT@ (Do not change this line.)

;---------------------------------------------------

; Insert your custom declarations below this banner

 

and add the following lines after the above banner:

 

export CSD_1_AUTORESET_custom

export _CSD_1_AUTORESET_custom

 

 

3. Also allocate some space for the variables:

;------------------------

; User Variable Allocation

;------------------------

CSD_1_AUTORESET_custom: BLK 1

_CSD_1_AUTORESET_custom: BLK 1

 

 

4. In the same file, search for "CSD_1_AUTORESET" and replace it with the variable name "CSD_1_AUTORESET_custom"

 

 

5. Now in your code, you can invoke your variable by adding a reference declaration "extern CSD_1_AUTORESET_custom"

Autoreset function can be toggled ON/OFF with CSD_1_AUTORESET_custom = 1 or CSD_1_AUTORESET_custom = 0;

 

 

Please try this out and let me know how it goes.

 

 

Regards,

Arvind

 



Re: How to enable/disable sensor autoreset by soft on CY8C24994,?

arvi posted on 20 Jul 2012 02:26 AM PST
Cypress Employee
119 Forum Posts

 Another change which I missed, is to replace the "IF" statements with "tst"

 

See the code snippets as follows (in CSD_1hl.asm) :

 

Original:

 

 

IF (CSD_1_AUTORESET)

   cmp [X+CSD_1_waSnsDiff+MSB], 0

   jz   .AddBucketLSB

   mov  A, 255

   jmp  .AddBucketConst

ELSE

   ; Compare to Noise Threshold

   cmp [X+CSD_1_waSnsDiff+MSB], 0

   jnz  .InitLowBaselineReset

   mov A, [CSD_1_bNoiseThreshold]

   cmp A, [X+CSD_1_waSnsDiff+LSB]

   jc .InitLowBaselineReset

ENDIF

 

 

 

 

Modify to:

 

 

tst [CSD_1_AUTORESET_custom], 0

jz .ARST_disabled

   cmp [X+CSD_1_waSnsDiff+MSB], 0

   jz   .AddBucketLSB

   mov  A, 255

   jmp  .AddBucketConst

.ARST_disabled:

   ; Compare to Noise Threshold

   cmp [X+CSD_1_waSnsDiff+MSB], 0

   jnz  .InitLowBaselineReset

   mov A, [CSD_1_bNoiseThreshold]

   cmp A, [X+CSD_1_waSnsDiff+LSB]

   jc .InitLowBaselineReset

 

-Arvind

 

 

 






ALL CONTENT AND MATERIALS ON THIS SITE ARE PROVIDED "AS IS". CYPRESS SEMICONDUCTOR AND ITS RESPECTIVE SUPPLIERS MAKE NO REPRESENTATIONS ABOUT THE SUITABILITY OF THESE MATERIALS FOR ANY PURPOSE AND DISCLAIM ALL WARRANTIES AND CONDITIONS WITH REGARD TO THESE MATERIALS, INCLUDING BUT NOT LIMITED TO, ALL IMPLIED WARRANTIES AND CONDITIONS OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT OF ANY THIRD PARTY INTELLECTUAL PROPERTY RIGHT. NO LICENSE, EITHER EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, IS GRANTED BY CYPRESS SEMICONDUCTOR. USE OF THE INFORMATION ON THIS SITE MAY REQUIRE A LICENSE FROM A THIRD PARTY, OR A LICENSE FROM CYPRESS SEMICONDUCTOR.

Content on this site may contain or be subject to specific guidelines or limitations on use. All postings and use of the content on this site are subject to the Terms and Conditions of the site; third parties using this content agree to abide by any limitations or guidelines and to comply with the Terms and Conditions of this site. Cypress Semiconductor and its suppliers reserve the right to make corrections, deletions, modifications, enhancements, improvements and other changes to the content and materials, its products, programs and services at any time or to move or discontinue any content, products, programs, or services without notice.

Spec No: None; Sunset Owner: GRAA; Secondary Owner: RAIK; Sunset Date: 01/01/20