To reset the PSoC3 device through code

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

cross mob
ShBa_282106
Level 3
Level 3
25 replies posted 10 replies posted 5 replies posted

Hi!

   

I've burnt a simple program for counting pulses per second at input pin on a CY8C001 kit. The problem is that it picks up random counts sometimes even if the ground is secured at input (when i expect counts to be seen as '0'). The counter is back to its accuratekeep hitting the 'reset' switch time to time.   can i schedule this 'reset' action in my firmware, maybe once after every 10 seconds ? is there any API call for this?

0 Likes
20 Replies
Anonymous
Not applicable

 Hi Neha,

   

There is a API for doing a software reset. You can schedule CySoftwareReset() API based on your requirement.

   

Thanks,

   

srim

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

Seems to me there is a more important issue here, where are
the counts coming from when the input is  grounded to the
counter ? You should not have to reset a part like this to
get its counter reset.

   

You might use a DSO and set it up for normal mode triggering,
and set the trigger voltage to Vdd/2 for starters, to see if
you get a trigger on a "grounded" input. Or Vdd or Vss rails.

   

The input pin is configued properly, not "HiZ Analog" ? If you
are trying to count an analog like signal, use a comparator with
hysterisis to eliminate spurious noise triggers to your counter.

   

Regards, Dana.

0 Likes
Anonymous
Not applicable

Hi neha,

   

 

   

As Dana has already said, resetting the device periodically is not the right solution to the problem.

   

If you are using Timer / Counter for counting, make sure that the analog front end of the input to Timer doesn't pass the noise resulting in spurious counts when grounded.

0 Likes
ShBa_282106
Level 3
Level 3
25 replies posted 10 replies posted 5 replies posted

Thnx Srim, Danaa and Gautam!

   

am using CY8C001 kit's prototyping area to give the input from fixed pulse generator.In absence of input it picks up random counts .In presence of input also sometimes redundant counts are picked up. Already have a comparator with hysteresis enabled at the input. How to have a permanet solution to this if not reset? alternatively, how to set up a DSO? never used it..

0 Likes
Anonymous
Not applicable

Hi Neha,

   

 

   

If the analog front end consists of a comparator whose threshold is close to midpoint of the input signal, the possibility of the noise affecting the readings is lesser.

   

It will be easier for us to help you to get to the root cause of the issue if you can upload your project here.

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

A schematic of the input signal path might help as well.

   

 

   

Regards, Dana.

0 Likes
lock attach
Attachments are accessible only for community members.
ShBa_282106
Level 3
Level 3
25 replies posted 10 replies posted 5 replies posted

here it is..

0 Likes
lock attach
Attachments are accessible only for community members.
Bob_Marlowe
Level 10
Level 10
First like given 50 questions asked 10 questions asked

Neha,

   

when doing a Clean and Build I get two warnings about not synchronous clocks.

   

You should uswe a synchronizer component to sync the divided 32kHz clock to busclock and then route it to your counters. See attached example, but untested.

   

 

   

Bob

0 Likes
ShBa_282106
Level 3
Level 3
25 replies posted 10 replies posted 5 replies posted

Thnx Bob!

   

Those warnings are not found nw.

   

Late feedback is regretted.. 😞

   

Neha

0 Likes
ShBa_282106
Level 3
Level 3
25 replies posted 10 replies posted 5 replies posted

 Sadly...the pickup has not reduced after synchronisation as well. Am uploading another project.It duplicates the previous project in another schematic page . So we have 2 independent channels for counting. If someone can check counts in absence of input on CY8C001 kit , it'll be great help.. 

   

Thnx in advance

   

neha

0 Likes
ShBa_282106
Level 3
Level 3
25 replies posted 10 replies posted 5 replies posted
0 Likes
ShBa_282106
Level 3
Level 3
25 replies posted 10 replies posted 5 replies posted
0 Likes
ShBa_282106
Level 3
Level 3
25 replies posted 10 replies posted 5 replies posted

 hope its attached dis time..

0 Likes
ShBa_282106
Level 3
Level 3
25 replies posted 10 replies posted 5 replies posted
0 Likes
ShBa_282106
Level 3
Level 3
25 replies posted 10 replies posted 5 replies posted

 pictures of 2 schematic pages

0 Likes
lock attach
Attachments are accessible only for community members.
ShBa_282106
Level 3
Level 3
25 replies posted 10 replies posted 5 replies posted

 pictures of 2 schematic pages

0 Likes
lock attach
Attachments are accessible only for community members.
ShBa_282106
Level 3
Level 3
25 replies posted 10 replies posted 5 replies posted
0 Likes
Anonymous
Not applicable

1) Are you using extrenal 32kHz (crystal) oscillator?

   

 

   

2) Is the frequency of the analog input signal to the comparator greater than 32kHz? If not, then you'll end up capturing the same  Counter value multiple times before it is incremented by the Comparator's output.

0 Likes
ShBa_282106
Level 3
Level 3
25 replies posted 10 replies posted 5 replies posted

 Hi Gautam!

   

Yes 32 KHz external crystal was used keeping accuracy in view. But when used as a capture input, i've divided the frequency by 1000 so that count rate in CPS is measured directly. Interrupt in counter is raised only on CAPTURE. 

   

The input pulses can be below 32 KHz in frequency ...

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

Neha, when you have troubles uploading a project file here, try to switch to ms internet explorer, some guys reported having problems with chrome.

   

 

   

Bob

0 Likes