Need help with IO Pin used as interrupt

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

cross mob
DaHu_285096
Level 5
Level 5
10 likes received 250 replies posted 100 replies posted

I have a pin that is used for dual function.

At startup the pin is used to calibrate a clock (so I have set the pin up as digital input with interrupt that increments a count. I measure frequency by number of count in sample window) - this works fine.

After setup, the pin is used to read synchronous data (This is the data pin and another pin is the clock). However, I cannot figure out how to read the pin when it is set up as interrupt? What is the syntax to read the value of this pin, is it accessed by name of the component (in this case "INT_WAKE", which has several other interrupt pins assigned also in this port 2).

I did consider changing pin and using a counter to measure frequency and then use as normal input later but could not figure out how to set up the counter.

If using port as interrupt and digital input is tricky, is there a simply example of using the counter? In this case I would hope to simply start timer in code, wait a sample time and then read a value of how many pulses counted.

Thanks in advance.

0 Likes
1 Solution
GeonaP_26
Moderator
Moderator
Moderator
250 solutions authored 100 solutions authored 50 solutions authored

Please refer Digital Pins code example available in PSoC Creator. It demonstrates using interrupt and <Pin_name>_Read() together.

View solution in original post

0 Likes
2 Replies