Re: bitx and ubitx encoder replace ment

Sascha Bohnet | DL5SMB

As this is still relevant to this topic I refrain from opening another thread and write here again.

I can confirm Mark's problems with the speed of the 100ppr encoder:
If the encoder is span slowly it works acceptable, but if the speed is increased, problems arise (See my reference video )

Has anyone found a way around this for KD8CECs software?

There are of course different ways which can be tried:

The following methods I thought of, but they are also burdening up some other problems (at least for me)

1.) My first idea was to simply change to a Arduino Nano Every to keep investements low and to gain something from the change. It's a bit faster, pin compatible and has interrupts everywhere but the eeprom is smaller and it will probably not work with the uBITX Manager. And it also does not compile as the softserial_tiny.cpp is incompatible and would require a rewrite (or a write out of the libray)

2.) Just changing the pins to interrupt capable ones and use another libray for the encoder.
This might be a solution as  Pin 2 and 3  are at the moment used for the CW key and TX-C (I think) which seems to control the low pass filters. I would need cut some connections and rewire here to make the software experiments possible with an unknown result.  Therefore I would rather just try a  software approach.

3.)Try to use portmapping to be able to read out the encoder faster. I found the FastDigitalWrite-Libray but I am not sure if it can be used with analog inputs.
KD8CEC uses the following code to check the encoders status:
byte enc_state (void) {
    return (analogRead(ENC_A) > 500 ? 1 : 0) + (analogRead(ENC_B) > 500 ? 2: 0);
The libray above only supplies
  • digitalWriteFast(pinNum, state) (sets or clears pin/port faster)
  • pinModeFast(pinNum, mode) (sets pin/port as input or output faster)
  • digitalReadFast(pinNum)(reads the state of pin/port faster)

So no support for analogRead. And I guess if it was possible to read out the analog ports digitally,
this would have been done by KD8CEC before using this workaround.

Does anybody have an idea, what could be done?


Join to automatically receive all group messages.