|
Re: Using gyro.c with other analog sensors no go
After reading some more out of the PIC18C manual, and doing some testing, here's what I did:
Using the EDU, I made meassurements of how long it takes to read the analog input, from start to finnish. (Using timer 1 with 1:8 prescaler.) It averaged around 138.8586 clock cycles to go through, or about 0.111087 milliseconds (which is a bit long with all the extra instructions and the overhead to get the timer value).
Based on this value, and the relative rarity that the gyro timer goes off (about 400Hz if the comments are correct), we decided it was ok to switch channels and wait and everything inside the interupt. If anyone encounters problems doing this, please say so.
|