- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi everyone,
I've got a little problem, i use one pin to detect two fronts, like that in a up front my variable take 1 , and on the down front my variable take 0.
But that only works when the time between up&down are very small like 3/4min but i want it to work with a time between up and front of 1 Hour.
Here is my code :
CY_ISR (SW2_Handler)
{
if (SW2_Read()==0)
{
branchement=1;
Pin_Green_Write(ON);
}
else if (SW2_Read()==1)
{
branchement=0;
cycles=cycles+1;
Pin_Green_Write(OFF);
}
SW2_ClearInterrupt();
}
Could you help me ?
thanks
- Labels:
-
PSoC 4 Architecture
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Did you configure the pin drive mode as open drain driving high or low? Otherwise when your switch is open there is no real signal on the pin to read.
Bob
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
It was configured on a Strong drive.
But i don't know if the problem come from that. I detect all the up&down front but only when the time between an Up and a Down are less than 4 minutes.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Can you please post your complete project so that we all can have a look at all of your settings. To do so, use
Creator->File->Create Workspace Bundle (minimal)
and attach the resulting file. Some schematic for the external connections would be helpful.
And please explain what you mean with the word "front", I don't know what it means in this context.
Bob
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content