Re: PIC32MZ1024EFK064 External Clock Suggestion.
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.