|
Post by Frisbone on Feb 7, 2014 19:41:26 GMT -5
Well, had a lot of problems trying to get my code running without exiting immediately or essentially doing nothing (or locking up).
I had to reduce the ISR to nothing but a counter and then a reading of the data registers. The main loop was reduced to just a 1 second wait and an output of the counter versus the number of seconds elapsed (i.e. sample frequency).
I was able to get reliable results from that and concluded the following:
1. Interrupt frequency higher than 400Hz is not detected by the Pi 2. 400Hz and less seems to be fairly reliable 3. Very odd that it takes a few execution attempts to get the first interrupt. Pretty reliable that the second time the program is run after successfully starting - that it won't. Not sure if its a wiringPi thing or if the interrupts are failing to be generated. 4. The process seems to be: Interrupt pulse, MUST READ DATA. If you don't read the data afterwords, there will not be another interrupt pulse.
Obviously I've got some conflicts going on that are mucking up the whole process. Guess I'll have to start process of elimination. For now though I think I'm going to set things at 50Hz and work out the bugs.
|
|