• AVR Freaks

PIC32MZ1024EFK064 External Clock Suggestion.

Author
Kartha
New Member
  • Total Posts : 22
  • Reward points : 0
  • Joined: 2017/07/14 21:44:40
  • Location: 0
  • Status: offline
2020/06/29 00:29:37 (permalink)
0

PIC32MZ1024EFK064 External Clock Suggestion.

Hello all,
As described in the silicon errata of PIC32MZ1024EFK064, it is said that for silicon revision A1, primary oscillators on oscillator inputs are not supported. And as a work around they said that either an external clock or the internal FRC can be used.
The problem am facing is I need to generate a timer interrupt at a very high frequency and extreme precision in time. for testing the timing stability I configured the system clock as 100 MHz and Configured the REFCLK3 for generating 1 MHz, and viewed the output an a DSO in persistence mode. After few seconds I can see the transition is get broad around 20 nS wide. And which will definitely affect my timing requirement (when considering a long time). 
So as the second suggestion, am going to use an external clock. Can some one suggest a precise external clock IC or module?
I think some one have gone through the same situation.
Thanks in advance.
#1

4 Replies Related Threads

    ric
    Super Member
    • Total Posts : 27652
    • Reward points : 0
    • Joined: 2003/11/07 12:41:26
    • Location: Australia, Melbourne
    • Status: offline
    Re: PIC32MZ1024EFK064 External Clock Suggestion. 2020/06/29 01:45:44 (permalink)
    0
    "very high frequency" and "extreme precision" are not engineering terms.
    Try supplying some real numbers for your requirements.
     

    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
    Kartha
    New Member
    • Total Posts : 22
    • Reward points : 0
    • Joined: 2017/07/14 21:44:40
    • Location: 0
    • Status: offline
    Re: PIC32MZ1024EFK064 External Clock Suggestion. 2020/06/29 02:25:42 (permalink)
    0
    Ok Ric, 
    The requirement is to sample an analog signal at a sampling rate of 220 KHz, that is on every 4.545 uS I need to run a SPI routine to access an external ADC to get the data. The whole process of SPI operation and storing the data in ram takes a minimum of 2.26 uS, and at any time it wont go beyond 2.5 uS. So it is well under 4.545 uS, thus I assume there wont be any timing problems. 
    When I toggle a GPIO inside the timer ISR am getting a frequency half of the sampling frequency, which makes sure every thing works fine.
    The problem am facing is, when the toggling GPIO is probed and put in persistence mode of DSO, it is getting broader within few seconds time. I don't know whether this is normal or not!!
    The exact problem is explained here :  I sample a square wave (12 KHz bipolar -3.3 to 3.3), generated from a square wave generator (Analog discovery is used), for few seconds at 220 KSPS, and plot it on an excel sheet. And used the "if else" function of excel to make the sampled wave in to a square wave of amplitude 1 and -1. Then Find the average value of  few number of complete cycles (partial starting and ending samples were removed). So if sampling time is correct, the average should be zero for any number of complete cycles. But I didn't get the average as zero, it is always some positive value.
    I dont know whether this method of analysis is correct. 
    In this experiment I totally believe in the output produced by Analog discovery.
    Please share your thoughts and experience in this problem.
    Thanks in advance.
    #3
    ric
    Super Member
    • Total Posts : 27652
    • Reward points : 0
    • Joined: 2003/11/07 12:41:26
    • Location: Australia, Melbourne
    • Status: offline
    Re: PIC32MZ1024EFK064 External Clock Suggestion. 2020/06/29 02:31:03 (permalink)
    2 (1)
    Toggling a GPIO pin inside an ISR is likely to have some jitter on it.
    You would be better monitoring a direct output from the timer.
    Also, does your external ADC only sample when it receives an SPI command, or can you get the sample triggered by a single pin, and then read it when the converison is complete?
     

    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!
    #4
    Kartha
    New Member
    • Total Posts : 22
    • Reward points : 0
    • Joined: 2017/07/14 21:44:40
    • Location: 0
    • Status: offline
    Re: PIC32MZ1024EFK064 External Clock Suggestion. 2020/06/29 05:25:45 (permalink)
    0
    Hi ric,
    Actually the process inside the timer ISR is as written below:
    1. make a GPIO pin high for starting a conversion.
    2. Waiting a time specified in the datasheet of ADC, it is 500nS
    3. Read the sample from ADC using SPI.
    All the three process took around 2.26 uS in total.
    and the timer is running at 220 KSPS which means a time = 4.54 uS.
    Remaining issue I have explained in my previous question.
    The broadening of the GPIO pulse is normal, Thanks for that information.
    The real problem is the mismatch in the sampling time. Do you have any suggestion in that.
    Thanks in advance.
     
    post edited by Kartha - 2020/06/29 05:27:20
    #5
    Jump to:
    © 2020 APG vNext Commercial Version 4.5