(18F4431 QEI +) Can 2x PIC HWs run at the same time?

Thread Starter

camerart

Joined Feb 25, 2013
3,559
Hi,
I've never fully understood PIC HW, although I use it all of the time.
For example: With 18F4431, which has a QEI 2xPIN quadrature encoder. Once the QEI has been set-up to run, can it run at the same time as another piece of HW or at the same time as the program, and in the QEI case, keep counting?
I understand that 2x HW will have an INTERRUPT each, but I would like to know in words, please.
Cheers, Camerart.
 

ericgibbs

Joined Jan 29, 2010
18,027
For example: With 18F4431, which has a QEI 2xPIN quadrature encoder. Once the QEI has been set-up to run, can it run at the same time as another piece of HW or at the same time as the program, and in the QEI case, keep counting?
hi C,
As it is configured as self-contained internal hardware, yes it can run in the background.
Page #160 of the d/s.
E
 

Attachments

Thread Starter

camerart

Joined Feb 25, 2013
3,559
hi C,
As it is configured as self-contained internal hardware, yes it can run in the background.
Page #160 of the d/s.
E
Hi E,
Yes, it's configured like that, and we've used it like that for years, since the TRACKER days.
I've been told by forums, that I don't have INTERRUPT handling, so I suppose it didn't need to be 'handled' as in this project it is running on it's own in it's own PIC.
Now I've added a second section of CODE which has an INTERRUPT after the END
----------------------------------------------------------------
On High Interrupt
Save System
---------------------------------------------------------------
This is for reading a GPS, and is waiting for an input approx 1/5 sec, which I assume triggers the INTERRUPT?

Since this was added, and run: Initially it works with the QEI showing '0', then if I moved to 1+ it increments quickly, until it goes over 359-0, it then stalls. So I need INTERRUPT handling.

I'm now trying to think which FLAG, ENABLE, DISABLE will stop the counting. (I don't want this!)

NOTE: I'll see my mate at the weekend, to go though this with him, so I'm just getting to understand what does what.
Cheers,
C
 

Thread Starter

camerart

Joined Feb 25, 2013
3,559
Hi E,
Following your reply, that the QEI works always in the background, I lowered it's HIGH INTERRUPT to LOW, and used HIGH for the GPS, and now it works.
My CODE is probably not quite 'correct', but it's working, and can be edited later.
Thanks.
C
 
Top