Re: QEI Hardware Quadrature Encoder Inputs PIC 18F4431

Originally Posted by
HenrikOlsson
Hi,
No, POSCNT contains the actual count. MAXCNT controls how "far" POSCNT counts before rolling over. That way you can have it wrap around at 1000 or 2000 or 34567 instead of 65535 if you want.
The interrupt flag gets set whenever it rolls over, going in both directions.
/Henrik.
Ok, I have been looking at your answer for about 3 weeks, and it has taken most of that time to understand what you said, mostly because it addresses my problem, not my question.
I was having "difficulty" getting MCS and PBP tp accept any input into those registers. To summarize what you posted so you know I understand, POSCNT tracks the number of changes and distance from zero counts and MAXCNT "SETS" the number of counts before rollover, almost like preloading a timer, except opposite.
I resolved my difficulties by reinstalling MCS Pro, Oh and using POSCNTH & POSCNTL as there is no actual POSCNT listed in the P18F4431.inc . When I assemble a good working encoder example I will post the code.
And Henrik, Thanks for the nudge !
If you do not believe in MAGIC, Consider how currency has value simply by printing it, and is then traded for real assets.
.
Gold is the money of kings, silver is the money of gentlemen, barter is the money of peasants - but debt is the money of slaves
.
There simply is no "Happy Spam" If you do it you will disappear from this forum.
Bookmarks