Re: CCPR 16 bit read corruption
I just knew a clever chap would point out "yes, but you're losing captures either way". And yes, it is a concern that my code can't keep up, but in this particular case, as long as I get the last capture time correctly and associated with the correct transition, it's fine.
Without going into all the details and reasons why, I am reading both transitions and captures in a fast timer ISR rather than in a capture ISR. I did find a way around the problem, but it still has me baffled. This is for a multi-quadrature decoder and I changed the capture to trigger on every fourth transition, instead of every second like before. The strange thing is that I was not missing quadrature transitions, yet I was apparently missing captures running at half that rate.
I'm using an 8-bit PIC16F18857 and almost every peripheral on it. :P It's a bit mad.