Using GPS timing instead of Interrupts

Thread Starter

camerart

Joined Feb 25, 2013
3,724
Hi,
I have an an idea floating in my head, regardig timing with GPS clocks.
I'm working on a project that uses PICs, and INTERRUPTS.
These interrupts have various timings, and is difficult for me to visualise.
There are 4xPICs on 2x PCBs all talking in different ways, radio etc, and timing can be an issue.

As both PCBs have a GPS, which has an accurate clock, what I want to know is: could a program be timed all the way through, so interrupts aren't needed?

Here's an Oscilloscope view of the 1sec time plus the 200Ms times of the GPS sentences. The Sentences at the bottom, start in the centre of the 1sec time.
Camerart
 

Attachments

cmartinez

Joined Jan 17, 2007
8,220
could a program be timed all the way through, so interrupts aren't needed?
Yes it could. You could use an external waveform as a clock source for your pic, and write the firmware accordingly. But I'd really like for you to elaborate on your idea, because I'm not 100% sure of understanding what you're asking for.
 

Thread Starter

camerart

Joined Feb 25, 2013
3,724
Yes it could. You could use an external waveform as a clock source for your pic, and write the firmware accordingly. But I'd really like for you to elaborate on your idea, because I'm not 100% sure of understanding what you're asking for.
Hi C,
Yes it could, that's encouraging.
When I get an idea, I don't think it through, I move forward hopefully refining as I go.

e,g, Take the GPS as an example. This receives a sentence 5/sec, and as you can see from #1 image, the first message starts (I think) 50Ms from the start of the 1/sec, if the program 'looks' for the GPS input at the start of the 1sec, I assume it would capture it, so could move to the next peripheral to read, at 'say' 60Ms? I'm guessing!

EDIT: I can see that my times are incorrect!
C.
 

cmartinez

Joined Jan 17, 2007
8,220
Again, I'm not 100% sure of understanding what you want. Unless you're willing to disclose your full idea and perhaps show us a flow chart of sorts.

But from what you're describing, a simple program that would poll (as opposed to wait for interrupts) the waveforms' particular states could do the trick.
 

Thread Starter

camerart

Joined Feb 25, 2013
3,724
Again, I'm not 100% sure of understanding what you want. Unless you're willing to disclose your full idea and perhaps show us a flow chart of sorts.

But from what you're describing, a simple program that would poll (as opposed to wait for interrupts) the waveforms' particular states could do the trick.
Hi C,
I've been working on for years, it's long and complicated, but you maty be able to skim through and see the peripherals and interrupts, I'm talking about: https://forum.allaboutcircuits.com/threads/master-and-slave-pics-using-spi-in-oshonsoft.156175/

There are radio control transmissions backwards and forward between 2x pcbs, that would benefit by being synched.
The GPS reception also.
I'm having issues with different interrupt priorities, mainly because I'm not a programmer.
I'm afraid it not easy to be clear.
As you said it is possible, I'll give it more thought, thanks.
C
 

cmartinez

Joined Jan 17, 2007
8,220
I'm having issues with different interrupt priorities, mainly because I'm not a programmer.
Most seasoned programmers would argue that using interrupts is a superior and more efficient form of programming. And I won't argue with that. However, writing a polling routine in an orderly way is oftentimes easier, and it's also simpler to understand and to follow its logic flow.

I'll take a look at the link you've posted and contribute some more if I can.
 

Thread Starter

camerart

Joined Feb 25, 2013
3,724
Most seasoned programmers would argue that using interrupts is a superior and more efficient form of programming. And I won't argue with that. However, writing a polling routine in an orderly way is oftentimes easier, and it's also simpler to understand and to follow its logic flow.

I'll take a look at the link you've posted and contribute some more if I can.
Hi C,
Good, thanks.
I've been working on this for ages, getting lots of fantastic help from forums, as I'm pretty amateur when it comes to programming, but have been drawn along, and leant a lot.
There are 4x programs 2x on each PCB, all talking to each other, and it's got more complicated as it's gone along.
Cheers, C.
 
Top