Author |
Topic |
|
rpizzo
24 Posts |
Posted - 16 Nov 2006 : 23:37:42
|
Hello, I just wanted to ask if someone can point me to a code example of using the BitsyX I/O pins to detect an interrupt. I simply want to have a switch that toggles a line high/low - this is for detecting a pushbutton that the user will have to press to start a function. I am using Embedded Visual C++ and have Win CE 4.1 on my BitsyX.
Also, I was wondering if I need to worry about debouncing the switch when doing this? Thanks in advance for any help.. |
|
akidder
1519 Posts |
Posted - 17 Nov 2006 : 07:15:05
|
Hi Rich. We've implemented interrupt functionality in the DIO driver, which is available in BitsyX CE 4.2 builds.
There is a limit to the total number of interrupts you can connect, but using one shouldn't be a problem (take a look at the note at topic 1788).
As for hardware debouncing of the switch input, I'd test it out. It may be that the interrupt latency may be enough to do the debounce for you, especially if you don't have a high priority on the interrupt service thread. If you do observe signal bounce, it would be easy to fix by doing a GetTickCount call each time in the IST and ignoring any new inputs within 50 or 100 ms of the previous input. |
|
|
rpizzo
24 Posts |
Posted - 17 Nov 2006 : 11:12:52
|
Thank you for the pointer. I just noticed, J31 on my personality board is a 30 pin connector and is shown as such on the BitsyX Personality board mechanicals. However, the personality board user manual has the J31 pinout as a 40 pin connector! I need to use EIO0-4, and EIO8. Which pins on J31 do these really go to? Which pin is ground?
I also assume these EIO lines are the ones your driver can enable as interrupts?
|
|
|
akidder
1519 Posts |
Posted - 17 Nov 2006 : 11:46:30
|
Thanks, Rich. The document you have refers to revision 1 of the Bitsy personality board. The schematics list the pinouts for the rev A board. See topic 409 for details and links.
You are correct that EIO lines can be used as interrupt inputs (they're PXA255 IOs). The driver spec and the driver itself will tell you which of the bits are supported for interrupt use. You can use the sample application to test your hardware before writing any code yourself. |
|
|
|
Topic |
|
|
|