Hey, It's me again :-)
Still working on this problem - and since I think I am not the only one who wants to get this encoder working,
I am keeping to this thread.
My next approach to this problem was switching to an I2C adapter.
This way I could free up some digital pins, formerly used by the parallel connection of the display.
The idea was that maybe another rotary encoder libray works better than the standard solution. If thats is not sufficient,
maybe there is still the possibility of using a pin change interrupt libray or port mapping.
So I started making adjustments in the code and inserted the quite popular rotary libray by ,
but it is not working correctly yet. As soon as power is applied the frequency starts going up.
If I push the button I am able to get into the menue. There I can choose within the first layer of
options "Select band, "select VFO"... but as soon as I enter the second layer (80m, 40m, etc)
all band start changing permanently, as If soneone would turn the encoder very fast.
And if the putton is pushed again, a random band is choosen and the VFO starts running up again.
Turning the rotary encoder again does nothing - whatever direction or speed I use. It's still running up.
I assume the problem is caused by the interaction of the two functions
in file ubitx.ui (which I modified to
??????????? and
in file ubitx_20
I thought I understood? vaguely what exactly enc_read() does in the original version, but it seems this function does not simply give back
an increasing or decreasing number.? For example I don't get what purpose the additional "enc_speed++;" is serving.
I don't see where this is relevant in the code or where this is used later.
After playing around a bit I inserted a "delay(1)" within the rotary code before the value is given back. This stopped the VFO
from going wild and allowed tuning again.
But issues persist:
a.) if the encoder is turned to fast, it hangs again (maybe like with the original code?)
b.) in the second layer of the menu no signals of the encoder are recognizes. The menue does not go wild, but you cannot
???? choose anything either.
Does anybody see what it is that I am doing wrong?
I once also tried the old mechanical encoder again with the new library at the digital ports.
With that one i needed 20 complete turns in the fuirst layer of the menu to get to the next option ("Change bands" to "Change VFO A").
Maybe this is also relevant.
It would be nice if anyone had some suggestions.
Sascha
?