Timer triggered on external source.
Hi, I'm using TMR5 on a dspic33E device, and it's configured to count up on an external source. The datasheet states that the timer is triggered on a positive edge.
But.... not so for me.
I'm detecting a 6Mhz clock-source, and I must detect the first 16 bit-clocks and immediately turn the bit-stream off after the 16'th. So I'm using an assembly routine that has a maximum lag of around 50ns before it turns off the stream.
My oscilloscope tells me that the stream is turned off around 50 ns after the falling edge. I'm using TMR5 and detects when it has reached 16 by checking bit 4. Actually it suites me well, but I don't like sloppy documentation, so perhaps someone can clarify this, usually I am the one that makes mistakes, not Microchip, after all.pink:
Why is it always a major pain in the *** to make a SPI work? Every time I'm about to do something with the SPI's, I know there will be a full circus. As I see it, the documentation sucks. Very many aspects works in a way that seems to be without logic. So the only way to get it to work is to be entirely empirical.
The problem is that Microchip tries to describe what happens in words, where it would be much more illuminating if they had some sort of detailed "schematics" over the whole SPI thing.