• AVR Freaks

Hot!PIC16F18877 Timer0 Input Requirements

Page: 123 > Showing page 1 of 3
Author
rbuck
Super Member
  • Total Posts : 349
  • Reward points : 0
  • Joined: 2005/04/28 12:48:11
  • Location: Phoenix, AZ
  • Status: offline
2019/06/14 09:58:11 (permalink)
0

PIC16F18877 Timer0 Input Requirements

I'm using a PIC16F18877 in a project and have a question about Timer0 input requirements.

Figure 27-1 is the block diagram for Timer0. It appears that when using an external clock for Timer0 the input is a Schmitt Trigger. I cannot find where that is stated in the specifications.

If I look at the block diagram for Timer1, Note 1 indicates that the input is a Schmitt Trigger buffer. Is the same thing true for Timer0?

Table 37-4 shows the Schmitt Trigger buffer needs a 0.8 VDD input level. Is there a specification anywhere that shows the amount of current required? I have 100 uA available to drive Timer0. I'm guessing the Schmitt Trigger is a CMOS buffer since the table shows a specification for a TTL buffer. If it is CMOS the input current should be 1uA or less.

Can anyone confirm that is the case? Table 37-4 is for I/O Ports but maybe TMR0 is the same spec? The input threshold levels for the I/O Ports state the Schmitt Trigger is a CMOS input.
#1

44 Replies Related Threads

    ric
    Super Member
    • Total Posts : 24222
    • Reward points : 0
    • Joined: 2003/11/07 12:41:26
    • Location: Australia, Melbourne
    • Status: offline
    Re: PIC16F18877 Timer0 Input Requirements 2019/06/14 15:00:05 (permalink)
    +2 (2)
    rbuck
    Figure 27-1 is the block diagram for Timer0. It appears that when using an external clock for Timer0 the input is a Schmitt Trigger. I cannot find where that is stated in the specifications.

    No it doesn't.
    It shows an optional inverter on the T0CKIPPS signal that is coming from the PPS block
    The default PPS assignment is to RA4, but it can come from nearly any pin.
     

    Table 37-4 shows the Schmitt Trigger buffer needs a 0.8 VDD input level. Is there a specification anywhere that shows the amount of current required?

    Yes, it is in the same table. All IO Ports are listed as +/- 5nA.
     
    I have 100 uA available to drive Timer0. I'm guessing the Schmitt Trigger is a CMOS buffer since the table shows a specification for a TTL buffer. If it is CMOS the input current should be 1uA or less.

    "CMOS" and "TTL" refer to the input threshold voltage, NOT to the underlying technology. They are all CMOS, and have the stated leakage specifications.



    I also post at: PicForum
    Links to useful PIC information: http://picforum.ric323.co...opic.php?f=59&t=15
    NEW USERS: Posting images, links and code - workaround for restrictions.
    To get a useful answer, always state which PIC you are using!
    #2
    NKurzman
    A Guy on the Net
    • Total Posts : 17924
    • Reward points : 0
    • Joined: 2008/01/16 19:33:48
    • Location: 0
    • Status: offline
    Re: PIC16F18877 Timer0 Input Requirements 2019/06/14 16:49:22 (permalink)
    0
    Is it parameter D340?
    #3
    rbuck
    Super Member
    • Total Posts : 349
    • Reward points : 0
    • Joined: 2005/04/28 12:48:11
    • Location: Phoenix, AZ
    • Status: offline
    Re: PIC16F18877 Timer0 Input Requirements 2019/06/14 19:42:49 (permalink)
    0
    D340 specifies leakage current.
     
    What I was trying to do was drive Timer0 with the muxout of an ADF4002. I am only using the N counter as a divide by 10 and not using anything else in the ADF4002. I am driving it with a signal that varies between 50 MHz and 400 MHz. My spectrum analyzer shows the signal level out of the muxout dropping above 100 MHz.
     
    I was able to drive the PIC up to 10 MHz (100/10) but nothing above that. I tack soldered in a NC7SZ04 inverter between the ADF4002 muxout and the PIC Timer0 pin. Now I can drive the PIC all the way up to 41 MHz (410/10). Maybe the NC7SZ04 squares the signal up enough that the PIC can respond to it.
     
    I don't know if the ADF4002 output is actually dropping. The RG58 cable on the spectrum analyzer has 100pF capacitance per meter. I have 1 meter into and 1 meter out of the spectrum analyzer. The capacitance of the cable is probably why I see the signal level drop above 100 MHz.
    #4
    NKurzman
    A Guy on the Net
    • Total Posts : 17924
    • Reward points : 0
    • Joined: 2008/01/16 19:33:48
    • Location: 0
    • Status: offline
    Re: PIC16F18877 Timer0 Input Requirements 2019/06/14 21:17:50 (permalink)
    +1 (1)
    So your actual Problem is you can’t clock Timer 0 above 10MHz?
    What does the data sheet say it’s max speed is?
    #5
    rbuck
    Super Member
    • Total Posts : 349
    • Reward points : 0
    • Joined: 2005/04/28 12:48:11
    • Location: Phoenix, AZ
    • Status: offline
    Re: PIC16F18877 Timer0 Input Requirements 2019/06/14 23:51:37 (permalink)
    0
    So your actual Problem is you can’t clock Timer 0 above 10MHz?

    No, the actual problem is with drive level. Without the buffer between the ADF4002 and the PIC, the PIC will not respond above 10 MHz. The level at 10 MHz is probably borderline but it works. With the buffer in place, the PIC responds all the way up to 41 MHz which is more than I need. That is why my initial inquiry was about drive level requirements.
     
    The PIC Timer0 max speed is 50 MHz according to the data sheet. In actuality most of the PIC16 family will respond up to 60 MHz or so. Timer1 max speed is 33.3 MHz according to the data sheet. This pattern is the same for most of the PIC16 family as Timer0 is usually the only one that can hit 50 MHz.
    #6
    ric
    Super Member
    • Total Posts : 24222
    • Reward points : 0
    • Joined: 2003/11/07 12:41:26
    • Location: Australia, Melbourne
    • Status: offline
    Re: PIC16F18877 Timer0 Input Requirements 2019/06/15 00:12:26 (permalink)
    +1 (1)
    So you initial question focused on current, implying it was a DC current requirement.
    In actual fact it is "slew rate" you should have been paying attention to, which is governed by the peak current drive and the total capacitance of the PCB and chip input. Very little to do with the leakage current.
    Observing the signal with a good storage scope would probably let you see what is going on.
     

    I also post at: PicForum
    Links to useful PIC information: http://picforum.ric323.co...opic.php?f=59&t=15
    NEW USERS: Posting images, links and code - workaround for restrictions.
    To get a useful answer, always state which PIC you are using!
    #7
    rbuck
    Super Member
    • Total Posts : 349
    • Reward points : 0
    • Joined: 2005/04/28 12:48:11
    • Location: Phoenix, AZ
    • Status: offline
    Re: PIC16F18877 Timer0 Input Requirements 2019/06/15 10:57:11 (permalink)
    0
    I was concerned about current because I only had 100 uA drive available from the ADF4002. I never mentioned leakage current except in response to NKurzman. The reason the circuit works with the added buffer is probably due to the higher drive capability of the NC7SZ125 being able to overcome the board and PIC input capacitance.

    My Tektronix scope shows the following numbers:

    4.32v Pk-Pk into the buffer and 4.92v Pk-PK out @ 5 MHz. The output shape is more or less square with some ringing and wave distortion. Rise time out of the buffer is 20 ns.

    2.16v Pk-Pk into the buffer and 1.86v Pk-Pk out @ 40 Mhz. The input into the buffer is a 28 ns positive pulse due to the divider action of the ADF4002. The output shape is a square wave with a low time of 30 ns. The rise time is 24 ns. The 1.86 Pk-Pk out of the buffer would indicate the board capacitance and the PIC are loading the output at 40 MHz.

    The total trace length from the ADF4002 muxout pin to the PIC is 2.86 inches. The muxout does go through a TS5A3159A SPDT RF switch with the common pin feeding the PIC. The N counter input of the ADF4002 is being driven by a MMIC amplifier chip. I am going to redo the layout for the MMIC circuit to add a 50 ohm stripline into and out of the amp. Maybe that will help increase the drive into the ADF4002 above 100 MHz. I will also slightly increase the width of the traces from the muxout into and out of the buffer feeding the PIC. The entire bottom side of the board is a ground plane.

    The other pole of the TS5A3159A switch is used for signals between 20 Hz and 50 MHz. The input for that range has conditioning circuits that drive a SN74LVC1G14 inverter. I can successfully drive the PIC up to 63 MHz when using this range. The input circuits have the advantage of running at 5 volts that helps drive the PIC which is also running at 5 volts. The ADF4002 circuits are all running at 3.3 volts so drive levels are much closer to minimum specs for the PIC.
    #8
    mpgmike
    Super Member
    • Total Posts : 313
    • Reward points : 0
    • Joined: 2014/01/23 17:27:06
    • Location: NJ
    • Status: online
    Re: PIC16F18877 Timer0 Input Requirements 2019/06/16 11:42:37 (permalink)
    0

    The PIC Timer0 max speed is 50 MHz according to the data sheet. In actuality most of the PIC16 family will respond up to 60 MHz or so.

    I just checked the PIC16F18877 just in case it happened to be an anomaly, but sure enough, the speed limit is still the typical PIC16F 32 MHz Fosc.  This means instructions execute at a maximum of 16 MHz.  Not sure where you got that.

    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.
    #9
    jtemples
    عُضْوٌ جَدِيد
    • Total Posts : 11396
    • Reward points : 0
    • Joined: 2004/02/13 12:31:19
    • Location: Southern California
    • Status: offline
    Re: PIC16F18877 Timer0 Input Requirements 2019/06/16 12:14:42 (permalink)
    0
    This means instructions execute at a maximum of 16 MHz.

     
    Fosc / 4 = 8 MHz.
    #10
    1and0
    Access is Denied
    • Total Posts : 9874
    • Reward points : 0
    • Joined: 2007/05/06 12:03:20
    • Location: Harry's Gray Matter
    • Status: offline
    Re: PIC16F18877 Timer0 Input Requirements 2019/06/16 12:18:31 (permalink)
    +1 (1)
    mpgmike

    The PIC Timer0 max speed is 50 MHz according to the data sheet. In actuality most of the PIC16 family will respond up to 60 MHz or so.

    I just checked the PIC16F18877 just in case it happened to be an anomaly, but sure enough, the speed limit is still the typical PIC16F 32 MHz Fosc.  This means instructions execute at a maximum of 16 MHz.  Not sure where you got that.

    Instruction frequency = Fosc/4 = 8 MHz.
     
    As for the 50 MHz, check out Param # 40 and 41 (T0CKI pulse width) in the back of the datasheet.
    #11
    jtemples
    عُضْوٌ جَدِيد
    • Total Posts : 11396
    • Reward points : 0
    • Joined: 2004/02/13 12:31:19
    • Location: Southern California
    • Status: offline
    Re: PIC16F18877 Timer0 Input Requirements 2019/06/16 12:21:58 (permalink)
    +1 (1)
     
    The PIC Timer0 max speed is 50 MHz according to the data sheet

     
    Where do you see that?  I see Tcy + 40 ns as the max speed, which is ~ 6MHz, assuming Fosc is 32 MHz.
    #12
    1and0
    Access is Denied
    • Total Posts : 9874
    • Reward points : 0
    • Joined: 2007/05/06 12:03:20
    • Location: Harry's Gray Matter
    • Status: offline
    Re: PIC16F18877 Timer0 Input Requirements 2019/06/16 12:31:28 (permalink)
    0
    jtemples
     
    The PIC Timer0 max speed is 50 MHz according to the data sheet

     Where do you see that?  I see Tcy + 40 ns as the max speed, which is ~ 6MHz, assuming Fosc is 32 MHz.

    Using its prescaler, Timer0 can read up to 1/(20 ns) = 50 MHz. I have personally tested it up to 58 MHz.
    #13
    jtemples
    عُضْوٌ جَدِيد
    • Total Posts : 11396
    • Reward points : 0
    • Joined: 2004/02/13 12:31:19
    • Location: Southern California
    • Status: offline
    Re: PIC16F18877 Timer0 Input Requirements 2019/06/16 12:36:09 (permalink)
    0
    Using its prescaler

     
    Ah, I was ignoring the prescaler.
     
    #14
    rbuck
    Super Member
    • Total Posts : 349
    • Reward points : 0
    • Joined: 2005/04/28 12:48:11
    • Location: Phoenix, AZ
    • Status: offline
    Re: PIC16F18877 Timer0 Input Requirements 2019/06/16 15:51:58 (permalink)
    +1 (1)
    As I said in my previous post, the current PIC16F18877 I am using can read a 63 MHz signal. And I am not using the prescaler. To be safe I would not count on the PIC Timer0 to be able to clock above 50 MHz. I have seen literally 10's of frequency counter articles online based on PIC16s that all count up to 50 MHz. Data sheet specs should be used for design purposes if you want to be sure your project will work.
     
    I can clock the particular ADF4002 I am using at 475 MHz and it divides it by 10 down to 47.5 MHz all day long according to my frequency counter. If I increase the input to 475.5 MHz it goes nuts with all kinds of random output frequencies. I would not count on any other ADF4002 I pull out of the drawer to clock at 475 MHz. The data sheet says 400 MHz and that is the only thing Analog Devices will guarantee.
    #15
    1and0
    Access is Denied
    • Total Posts : 9874
    • Reward points : 0
    • Joined: 2007/05/06 12:03:20
    • Location: Harry's Gray Matter
    • Status: offline
    Re: PIC16F18877 Timer0 Input Requirements 2019/06/16 17:02:21 (permalink)
    0
    rbuck
    As I said in my previous post, the current PIC16F18877 I am using can read a 63 MHz signal. And I am not using the prescaler. 

    Are you sure you're NOT using the Timer0 prescaler?  Without the prescaler, it is ~6 MHz max.
    #16
    ric
    Super Member
    • Total Posts : 24222
    • Reward points : 0
    • Joined: 2003/11/07 12:41:26
    • Location: Australia, Melbourne
    • Status: offline
    Re: PIC16F18877 Timer0 Input Requirements 2019/06/16 17:28:07 (permalink)
    0
    I am a bit suspicious of the datasheet figures.
    Why is there no distinction between "asynchronous" and "synchronous" mode for Timer 0?
    I suspect those figures are for synchronous mode.
     

    I also post at: PicForum
    Links to useful PIC information: http://picforum.ric323.co...opic.php?f=59&t=15
    NEW USERS: Posting images, links and code - workaround for restrictions.
    To get a useful answer, always state which PIC you are using!
    #17
    1and0
    Access is Denied
    • Total Posts : 9874
    • Reward points : 0
    • Joined: 2007/05/06 12:03:20
    • Location: Harry's Gray Matter
    • Status: offline
    Re: PIC16F18877 Timer0 Input Requirements 2019/06/16 17:39:27 (permalink)
    0
    From the datasheet:
     
    27.1.6 SYNCHRONOUS MODE
    When the T0ASYNC bit of the T0CON1 register is clear (T0ASYNC = 0), the counter clock is synchronized to the system oscillator (FOSC/4). When operating in Synchronous mode, the counter clock frequency cannot exceed FOSC/4.
     
    27.2.2 EXTERNAL CLOCK SOURCE
    When an external clock source is selected, Timer0 can operate as either a timer or a counter. Timer0 will increment on multiples of the rising edge of the external clock source, as determined by the Timer0 prescaler.
    #18
    ric
    Super Member
    • Total Posts : 24222
    • Reward points : 0
    • Joined: 2003/11/07 12:41:26
    • Location: Australia, Melbourne
    • Status: offline
    Re: PIC16F18877 Timer0 Input Requirements 2019/06/16 17:53:57 (permalink)
    0
    I read that, but it is not reflected in the specifications page, so no help.
    Note that Timer 1 DOES distinguish between the two modes, and can do up to 16MHz in asynchronous mode.
     

    I also post at: PicForum
    Links to useful PIC information: http://picforum.ric323.co...opic.php?f=59&t=15
    NEW USERS: Posting images, links and code - workaround for restrictions.
    To get a useful answer, always state which PIC you are using!
    #19
    jtemples
    عُضْوٌ جَدِيد
    • Total Posts : 11396
    • Reward points : 0
    • Joined: 2004/02/13 12:31:19
    • Location: Southern California
    • Status: offline
    Re: PIC16F18877 Timer0 Input Requirements 2019/06/16 18:58:41 (permalink)
    +1 (1)
    Why is there no distinction between "asynchronous" and "synchronous" mode for Timer 0?

     
    I looked at a much older enhanced midrange data sheet (16F1823), and that section in the specs was identical.  I'm guessing it's cut-and-pasted into all of them.
    #20
    Page: 123 > Showing page 1 of 3
    Jump to:
    © 2019 APG vNext Commercial Version 4.5