+ Reply to Thread
Results 1 to 13 of 13
  1. #1
    Join Date
    Dec 2010
    Location
    Melbourne Australia
    Posts
    91

    Default Port Fall>Rise & Rise>Fall time

    I have 2 flavours of PIC that claim to produce a port output rise to fall (and vice versa) time of 5-6ns – well, the 18F26K83 claims it will theoretically produce it with slew rate disabled. Scoping both the 18F26K83 & 18F27J53 yields a fall to rise time of about x10 that and a rise to fall that’s a similar order of magnitude more. Also tried loading the pin as per the recommendations in the 18F27J53’s DS.
    Anyone else experienced similar disappointment with this or have advice to share?

    Thanks,

    Troy
    Last edited by rocket_troy; - 27th October 2019 at 22:47.

  2. #2
    Join Date
    Apr 2014
    Location
    Northeast
    Posts
    320

    Default Re: Port Fall>Rise & Rise>Fall time

    I'm not sure if Fosc setting would affect rise/fall times. Try playing with Fosc and see what happens.

    Second thought; are you writing to PORTB or LATB? Writing to PORTx initiates Read/Modify/Write, which will take time. Without looking up the data sheets for the 2 PICs you mentioned (neither of which I have ever used), I'm not sure if they have LATx registers. Older PICs don't, but ALL newer PICs do.

    Third thought; how are you testing rise/fall times? What hardware do you have attached? If you are adding capacitance to the PORT Pin, you are adding slew mechanically.

    With the limited information provided, if none of these thoughts seem to offer proper guidance, post more information.
    I don't need the world to know my name, but I want to live a life so all my great-grandchildren proudly remember me.

  3. #3
    Join Date
    Dec 2010
    Location
    Melbourne Australia
    Posts
    91

    Default Re: Port Fall>Rise & Rise>Fall time

    Mike,
    Yeah, tried playing with the Fosc, but I can verify (as per the datasheetís statements) that the rise<->fall times are independent of the Fosc.
    I was writing to PORTB, not LATB. I considered that, but assumed it wouldnít make much of a difference for the rise-fall times. I will try writing to the LAT reg next.

    The testing has been done 3 ways:
    (1) with the chip and pins in a 28pin holder with nothing else attached
    (2) in the same holder but with a 50p ground cap as per suggested in the 18F27J53 DS
    (3) 50p ground cap & 470R pullup resistor to a VDD/2 rail as per option 1 suggestion in the same DS
    (4) in the same chip holder but with the measured port pin bent upwards so I can connect the probe directly to it without contact to any part of the chip holder

    The code for the test is
    Main:
    PortB.5 = 1 '(1 instruction cycle - x4 osc ticks)
    PortB.5 = 0 '(1 instruction cycle - x4 osc ticks)
    Goto main '(2 instruction cycles - x8 osc ticks)

    Running at 64Mhz on the 18F26K83 and 48Mhz on the 18F27J53
    So the pulse frequency is 4MHz on the 18F26K83 and 3Mhz on the 18F27J53

    Iím also assuming that running the pulse continually at high frequency is not affecting the rise & fall timing?

    If anyone does look at the DS, search for ďI/O TimingĒ to see the specs.

    Thanks

    Troy

  4. #4
    Join Date
    May 2013
    Location
    australia
    Posts
    1,746

    Default Re: Port Fall>Rise & Rise>Fall time

    but what are you measuring and what with ? and what vcc ?
    i suspect mc rise time is vol_max to voh_min as per their diagram [ which specifies very little that i can see]
    fall time would be voh_min to vol_max
    This is more entertaining than Free to Air TV

  5. #5
    Join Date
    Dec 2010
    Location
    Melbourne Australia
    Posts
    91

    Default Re: Port Fall>Rise & Rise>Fall time

    Richard,
    generally the rise-fall times are measured by Vmin+10% to VMax -10% yeah? By those parameters I'm seeing about a 40-50ns span which is wildly outside the DS claims IMHO. I'm measuring the pulse profile on a scope (1 Ghz sample rate).

    Regards,

    Troy

  6. #6
    Join Date
    Apr 2014
    Location
    Northeast
    Posts
    320

    Default Re: Port Fall>Rise & Rise>Fall time

    Are you determining the rise/fall times by the output frequency?!? You need to look at a scope pattern and check the slope of the digital square wave.
    I don't need the world to know my name, but I want to live a life so all my great-grandchildren proudly remember me.

  7. #7
    Join Date
    Dec 2010
    Location
    Melbourne Australia
    Posts
    91

    Default Re: Port Fall>Rise & Rise>Fall time

    Quote Originally Posted by mpgmike View Post
    Are you determining the rise/fall times by the output frequency?!? You need to look at a scope pattern and check the slope of the digital square wave.
    No, definitely not. The output frequency provides a timing verification that there's nothing funny going on with my setup or the scope, but nothing much more than that. I'm purely counting up the scope's grid divisions against the displayed slope as per standard practice for measuring such things. Unfortunately I don't have photos available at the moment to post.

    Regards,

    Troy
    Last edited by rocket_troy; - 28th October 2019 at 01:39.

  8. #8
    Join Date
    May 2013
    Location
    australia
    Posts
    1,746

    Default Re: Port Fall>Rise & Rise>Fall time

    to prove your measurement run the output through a 74f04 and compare edges
    74f series typical 5ns rise/fall times. 40-50ns is hct cmos timing
    probes and the scope add c and need to be properly calibrated too.
    1 Ghz sample rate is about a 100mhz scope i have a rigol 100mmhz 1gs/s scope i'm not sure mine would measure ns intervals all that accurately. when you approach the nyquist limit , screen aliasing products ,filtering etc all introduce doubt about absolute measurement.
    a signal comparison between chip an 74f would be interesting.

    This is more entertaining than Free to Air TV

  9. #9
    Join Date
    Dec 2010
    Location
    Melbourne Australia
    Posts
    91

    Default Re: Port Fall>Rise & Rise>Fall time

    Richard,
    yeah, I hear ya re: the bandwidth limitations of the scope and it was a point I considered. I'm ordering a bunch of fast logic and fast AD comparators to ensure I get a fast edge so there'll be lots to verify against coming up later in the week.

    Cheers,

    Troy

  10. #10
    Join Date
    Oct 2005
    Location
    Sweden
    Posts
    3,269

    Default Re: Port Fall>Rise & Rise>Fall time

    Do you have bypass capacitor(s) straight across the supply pins on the PIC?
    How do you provide ground connection for the probe/scope?

    Do not use the long wire with the alligator clip, use the ground "spring" that came with the probe or make up your own.

    /Henrik.

  11. #11
    Join Date
    Dec 2010
    Location
    Melbourne Australia
    Posts
    91

    Default Re: Port Fall>Rise & Rise>Fall time

    Problem solved. It was indeed a bandwidth issue with the scope, but it was the probe that was the culprit. It has 2 attenuation settings and I didn't realise it was on the one that limited the bandwidth to 6Mhz. I learnt something new. Thanks again for all the help.

    Cheers,

    Troy

  12. #12
    Join Date
    Apr 2013
    Posts
    305

    Default Re: Port Fall>Rise & Rise>Fall time

    Don't you love that, when you actually learn something from your errors/assumptions/misunderstandings, rather than in my case just realizing how dumb I am.
    George

  13. #13
    Join Date
    Apr 2014
    Location
    Northeast
    Posts
    320

    Default Re: Port Fall>Rise & Rise>Fall time

    Nuts and Volts published an article recently covering this topic of scope probes. I remember the scope images from the article and how different probes produced RADICALLY different patterns. I was going to try to find a link to the article, but looks like you got it solved. Good work rocket_troy, and excellent intuition HenrikOlsson.
    I don't need the world to know my name, but I want to live a life so all my great-grandchildren proudly remember me.

Similar Threads

  1. Replies: 4
    Last Post: - 5th October 2007, 10:25
  2. Time & Simulation
    By weirdjim in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 16th August 2007, 18:45
  3. 16f877 port configuration & interrupts
    By Rob Martin in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 15th April 2005, 17:30
  4. wiegand & com port
    By ARES in forum General
    Replies: 0
    Last Post: - 31st May 2004, 07:45

Members who have read this thread : 13

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts