Strictly necessary cookies are on by default and cannot be turned off. Functional, Performance and Tracking/targeting/sharing cookies can be turned on below based on your preferences (this banner will remain available for you to accept cookies). You may change your cookie settings by deleting cookies from your browser. Then this banner will appear again. You can learn more details about cookies HERE.
Strictly necessary (always on)
Functional, Performance and Tracking/targeting/sharing (default off)
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.
First off, once you're done with the pin as an interrupt in the first task, you should disable the interrupt. This prevents useless (and possibly erroneous) CPU processing. There are multiple ways of disabling the interrupt. It is usually best to disable it from an API call from the component that originally enabled it. If you share your project, I believe I can help here.
For the second task, ALL port pins are accessible as direct reads. The best way is to use the name you assigned to the pin with the following command. I believe you called it INT_WAKE. Therefore in this case use: INT_WAKE_Read().
There is a generic way to read the pin digital value by accessing it by the port number. However then you need to parse the specific bit you're using.
I hope this helps.
Len "Engineering is an Art. The Art of Compromise."