• AVR Freaks

Hot!Timer triggered on external source.

New Member
  • Total Posts : 23
  • Reward points : 0
  • Joined: 2008/09/27 23:55:51
  • Location: 0
  • Status: offline
2019/02/17 22:22:46 (permalink)

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: pink
Subject #2:
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.

1 Reply Related Threads

    Starting Member
    • Total Posts : 39
    • Reward points : 0
    • Joined: 2011/03/22 08:20:17
    • Location: 0
    • Status: offline
    Re: Timer triggered on external source. 2019/02/18 16:19:28 (permalink)
    Why is it always a major pain in the *** to make a SPI work? 

    Lol! That's funny. So true. Its amazing to me how the documentation isn't worse. Putting all that into English with the proper grammar!?! Not only an Engineering degree better have an English degree also. Both reader and writer.
    Jump to:
    © 2019 APG vNext Commercial Version 4.5