• AVR Freaks

Hot!PIC32 eval board

Author
Geomeo
Starting Member
  • Total Posts : 37
  • Reward points : 0
  • Joined: 2010/02/01 18:34:27
  • Location: 0
  • Status: offline
2020/02/18 21:30:21 (permalink)
0

PIC32 eval board

I have a PIC32 evaluation board and I’m wondering what I would need to do to make the following program work with it.  https://www.john.geek.nz/2011/01/avr-pulse-per-second-nmea-simulator/  Do I need the external crystals or would the internal ones work?  Will the internal ones be accurate enough For pulse per second?  
#1

15 Replies Related Threads

    Jim Nickerson
    User 452
    • Total Posts : 6659
    • Reward points : 0
    • Joined: 2003/11/07 12:35:10
    • Location: San Diego, CA
    • Status: offline
    Re: PIC32 eval board 2020/02/19 07:55:50 (permalink)
    +1 (1)
    Geomeo
    I have a PIC32 evaluation board and I’m wondering what I would need to do to make the following program work with it.  https://www.john.geek.nz/...-nmea-simulator/  Do I need the external crystals or would the internal ones work?  Will the internal ones be accurate enough For pulse per second?  


    what accuracy/repeatability  do you require ?
    #2
    Geomeo
    Starting Member
    • Total Posts : 37
    • Reward points : 0
    • Joined: 2010/02/01 18:34:27
    • Location: 0
    • Status: offline
    Re: PIC32 eval board 2020/02/19 09:57:16 (permalink)
    0
    The same accuracy as the example /link.  
    #3
    Jim Nickerson
    User 452
    • Total Posts : 6659
    • Reward points : 0
    • Joined: 2003/11/07 12:35:10
    • Location: San Diego, CA
    • Status: offline
    Re: PIC32 eval board 2020/02/19 09:59:45 (permalink)
    +1 (1)
    I see no where in the example /Link where the accuracy / repeatability is mentioned.
    #4
    Geomeo
    Starting Member
    • Total Posts : 37
    • Reward points : 0
    • Joined: 2010/02/01 18:34:27
    • Location: 0
    • Status: offline
    Re: PIC32 eval board 2020/02/19 12:53:43 (permalink)
    0
    You're not seeing this statement:
    I’m using a 32.768kHz real time clock crystal as I’m needing somewhat accurate PPS signals for testing.
    #5
    Mysil
    Super Member
    • Total Posts : 3670
    • Reward points : 0
    • Joined: 2012/07/01 04:19:50
    • Location: Norway
    • Status: offline
    Re: PIC32 eval board 2020/02/19 13:44:36 (permalink)
    0
    Which PIC32 evaluation board?  there have been several types made.
    And What PIC32 device type is mounted on the board?
     
    There are Oscillator Amplifier circuits inside PIC32 devices, for connection to an external crystal.
    There may, or may not be an external 32.768 kHz crystal on the board.
    There is no 'Internal Crystal'  in any PIC32 microcontroller chip.
     
    There are Internal Oscillators  in PIC32 microcontroller devices, they are Not crystal controlled.
    Internal FRC oscillator in PIC32 have typical frequency 8 MHz and tolerance +-1%.
    Internal LPRC oscillator in PIC32 have typical frequency 30 kHz and tolerance +-15%,
    internal LPRC is there mainly to be able to check if anything is alive at all.
     
    Oscillators using external Crystal depend upon tolerance of the actual crystal used,
    and the circuit connecting it.
     
    See Datasheet for the microcontroller device mounted on the board.
     
        Mysil
     
    #6
    Geomeo
    Starting Member
    • Total Posts : 37
    • Reward points : 0
    • Joined: 2010/02/01 18:34:27
    • Location: 0
    • Status: offline
    Re: PIC32 eval board 2020/02/19 13:57:58 (permalink)
    0
    Pic32MX795F512L It's a USB Starter Kit 2.  So is the internal oscillator going to do what I need it to?
     
    Thanks
    #7
    NKurzman
    A Guy on the Net
    • Total Posts : 18678
    • Reward points : 0
    • Joined: 2008/01/16 19:33:48
    • Location: 0
    • Status: offline
    Re: PIC32 eval board 2020/02/19 14:04:11 (permalink)
    +1 (1)
    If you want an accurate time No you will need a 32Khz secondary oscillator too.
    The Internal on is 1%, That is +/- 432 minutes a month.  Standard CPU crystals are better, but still a few minutes per month.
    #8
    Geomeo
    Starting Member
    • Total Posts : 37
    • Reward points : 0
    • Joined: 2010/02/01 18:34:27
    • Location: 0
    • Status: offline
    Re: PIC32 eval board 2020/02/19 14:19:23 (permalink)
    -1 (1)
    Ok there are two holes on this board I guess that's for 32khz crystal.   There are 2 x 22pf capacitors on the example.  At a guess any idea what exact crystal I would use?  There's tons on mouser.  What is PPM?
    #9
    Mysil
    Super Member
    • Total Posts : 3670
    • Reward points : 0
    • Joined: 2012/07/01 04:19:50
    • Location: Norway
    • Status: offline
    Re: PIC32 eval board 2020/02/19 16:44:36 (permalink)
    +1 (1)
    Hi,
    PPM is parts per million.
    Is used to express small tolerances: 20 ppm = 20 / 1000000;
    is same as 0.002 %.
     
    PIC32MX795F512L   still have a robust and tolerant secondary oscillator amplifier,
    any cheap watch crystal in round can ø3 mm x 8 mm, or round can dia 2 mm x 5 mm length,
    may be expected to work.
     
    When the crystal and the 2 small capacitors are in place,
    secondary oscillator amplifier may be enabled by configuration setting:
    #pragma config FSOSCEN = ON  /* Secondary oscillator enable. */ 

     
        Mysil
     
    #10
    Jim Nickerson
    User 452
    • Total Posts : 6659
    • Reward points : 0
    • Joined: 2003/11/07 12:35:10
    • Location: San Diego, CA
    • Status: offline
    Re: PIC32 eval board 2020/02/19 18:06:03 (permalink)
    +1 (1)
    Geomeo
    You're not seeing this statement:
    I’m using a 32.768kHz real time clock crystal as I’m needing somewhat accurate PPS signals for testing.


    Indeed I saw that statement.
    "Somewhat accurate" is rather difficult to measure or quantify, it depends on what the signal is to be sent to.
    Maybe you can share what you intend to use this signal for ?
     
    #11
    Geomeo
    Starting Member
    • Total Posts : 37
    • Reward points : 0
    • Joined: 2010/02/01 18:34:27
    • Location: 0
    • Status: offline
    Re: PIC32 eval board 2020/02/19 20:33:22 (permalink)
    0
    The signal is intended to test various equipment.  underwater sonar and multi beam mainly. I need 20 nano seconds in accuracy.  Normally we use pps with a zda string from a hemisphere vs331.  But this is very time consuming to set up just to test.  So I’m kinda hoping to put all this circuitry in a small rs232 Dtype connector.  And maybe power it from rs232 as well.  Hmmmm what are my chances this will work?
    #12
    Geomeo
    Starting Member
    • Total Posts : 37
    • Reward points : 0
    • Joined: 2010/02/01 18:34:27
    • Location: 0
    • Status: offline
    Re: PIC32 eval board 2020/02/19 20:36:36 (permalink)
    0
    Mysil
    Hi,
    PPM is parts per million.
    Is used to express small tolerances: 20 ppm = 20 / 1000000;
    is same as 0.002 %.
     
    PIC32MX795F512L   still have a robust and tolerant secondary oscillator amplifier,
    any cheap watch crystal in round can ø3 mm x 8 mm, or round can dia 2 mm x 5 mm length,
    may be expected to work.
     
    When the crystal and the 2 small capacitors are in place,
    secondary oscillator amplifier may be enabled by configuration setting:
    #pragma config FSOSCEN = ON  /* Secondary oscillator enable. */ 

     
        Mysil
     


    How do I know what value of caps to use?
    #13
    simong123
    Lab Member No. 003
    • Total Posts : 1391
    • Reward points : 0
    • Joined: 2012/02/07 18:21:03
    • Location: Future Gadget Lab (UK Branch)
    • Status: offline
    Re: PIC32 eval board 2020/02/19 22:09:46 (permalink)
    +2 (2)
    Geomeo
    I need 20 nano seconds in accuracy.

    Another statement completely lacking in specificity. 20ns in how much?
    If you mean 20ns in a second then you are SOL. That is 0.05ppm (50ppb). You are going to need an OXCO, which will not be cheap. An Abracon AOCJYR-24.576MHZ-M6069LF is ~£30 ($38) will get you 50ppb after calibration.
     
    Edit:- Heh, you could also look at another Microchip product, the SA.45s Chip Scale Atomic Clock.....That has a 1s PPS Output...
    post edited by simong123 - 2020/02/19 22:13:48
    #14
    Mysil
    Super Member
    • Total Posts : 3670
    • Reward points : 0
    • Joined: 2012/07/01 04:19:50
    • Location: Norway
    • Status: offline
    Re: PIC32 eval board 2020/02/19 22:22:27 (permalink)
    +1 (1)
    Hi,
    Read Datasheet from the Crystal Manufacturer, it will specify Load Capacitance CL value,
    that was used when when the crystal was trimmed during production.
    Manufacturers may deliver very similar crystals trimmed to be used with customer specified values of load capacitance.
     
    What may make it confusing, is that CL value specified is the effective capacitance of load,
    as seen by the crystal.
    When a Pierce oscillator circuit is used, as in most microcontrollers, the 2 capacitors are acting as connected in series, so you must calculate the resulting capacitance of the 2 capacitors, then add capacitance of wiring, PCB traces, pins and bonding wires inside the IC package.
     
    A good oscillator amplifier circuit have some kind of gain control (AGC).
    It usually will tolerate a wide range of load capacitance, the main effect beeing that different load capacitance will pull resonance frequency a little away from trimmed nominal frequency.
    Thus, there are some circuits that may use 2 voltage controlled capacitance diodes to trim oscillator frequency.
     
    Then microcontroller designers and manufacturers, compete in making crystal oscillator amplifier circuits that may run with low power consumption, so much that Secondary Crystal oscillator circuits in PIC32MZ and PIC32MK devices are not expected to work at all. See errata documents for those devices.
     
    20 nanoseconds accuraccy as mentioned in message #12 is meaningless. 
    20 nanoseconds in what time interval?
    20 nanoseconds in 1 second, cannot be achieved with a crystal oscillator, without a lot of trickery,
    or probably not at all.
     
    https://www.microchip.com/design-centers/clock-and-timing/atomic-clocks
     
        Mysil
    #15
    Geomeo
    Starting Member
    • Total Posts : 37
    • Reward points : 0
    • Joined: 2010/02/01 18:34:27
    • Location: 0
    • Status: offline
    Re: PIC32 eval board 2020/02/20 08:36:18 (permalink)
    0
    My apologies <20ns every second is the required accuracy.  Unfortunately space within a DB9 connector shell would not allow me the atomic clocks.  Since they are rather large.  I'm liking the OCXO idea however there's an SOL part in Simons statement.  So is the OXCO going to work?  30GBP isn't so bad. I'm fairly sure my company would be ok with that.  Any examples with an OXCO going around?  I'm currently seeing some timer circuits, but not seeing one with OCXO.
    #16
    Jump to:
    © 2020 APG vNext Commercial Version 4.5