Re: HEDS5540 optical encoder
"
Code:
If I try to use only portA to operate the LCD (with internal 4MHz oscillator) and on the PORTB pin RB.6 and RB.7 hang only the encoder A and B channel, rest pins configured to output the reading is perfect.
yes , makes sense . unfortunately setting or clearing a bit on a pic port entails a read of that port first , any read of portb clears the mismatch condition state for the rbc interrupt.
so even though only the bits 4 to 7 that are set as inputs can cause an interrupt on change a write to your "e" pin can cause changes to be missed .
if it won't keep up with the encoder using the int osc then use an i2c lcd display or a different pic
Warning I'm not a teacher
Bookmarks