Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Fastest clock on a PIC32

Status
Not open for further replies.

Kisen

Member
Hi,

What would be the fastest clock on a PIC32?

I am looking to use a PIC32 to measure the arrival of an event. The PIC has a max speed of 120MHz - PIC32MK0256GPG048

I understand that there is a free running core timer in the PIC32 that can be read.. I believe this runs at Fosc/2 = 60MHz in my case. This gives me each tick at 16.6666nS.

Can this clock be reset on command?
If it cant is there anything equivalent in the PIC32 that can be, that is as quick?

I plan to use 4 MCUs each running independently, but i need to be able to sync their clocks from a central controller.
 
Hi,

What would be the fastest clock on a PIC32?

I am looking to use a PIC32 to measure the arrival of an event. The PIC has a max speed of 120MHz - PIC32MK0256GPG048

I understand that there is a free running core timer in the PIC32 that can be read.. I believe this runs at Fosc/2 = 60MHz in my case. This gives me each tick at 16.6666nS.

Can this clock be reset on command?
If it cant is there anything equivalent in the PIC32 that can be, that is as quick?

I plan to use 4 MCUs each running independently, but i need to be able to sync their clocks from a central controller.

Why not just use a separate common clock?, or can the PIC32 be set to output it's clock signal on one of the pins?.
 
There are 4 signals that i want to read. There is a possibility that 2 or more of these signals can occur in the same instance, or very soon after one another (within nS). So if i use a common clock, by the time i have read a pin to say that an event occured, process it, store the time it occured etc, then one of the other 3 signals may be missed. I am attempting to triangulate a point of impact in steel, 300nS translates into roughly 1mm distance. So i am trying to get the best possible chance of getting an accurate time stamp.

So my plan is to have an MCU deal with 1 signal each. And flag as data ready, when all 4 are data ready i can read all the times from each device.
 
You do not need to read the clock / timer like that, or use multiple MCUs!
See the "Input capture" docs I linked earlier.

You can use a single DSPIC33 series, with four separate input captures and an ADC all included (rather more, in fact).

The captures are pure hardware and will "grab" the count from the same timer, so you can calculate the relative times directly from the capture registers, once you read them all.

The counter can run at 60 - 70 MHz; no multi-chip sync required - doing things between different MCUs just loses accuracy.

My favourite for general use is the dsPIC33EP512GP502 - a 28 pin dual-in-line IC, so simple for prototyping on stripboard.
Even that has four input captures available. Plus 512K flash memory and 48K RAM...

 
I didnt realise that the input capture worked like that. I was on the mindset that i would be using change of state on a pin toggled by an external comparator.
I need to look at how these input capture pins work, I have never used them before.

If i can understand and make them work as you have described, then this will be perfect.
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top