Jump to content

encoder problem


djiceman

Recommended Posts

Im using midibox 2.4 on mios 1.9f

When i turn my encoder clockwise, it gives off, channel 5 note c3 on, then channel 6 note c3 on, then channel 5 note c3 off, then channel 6 note c3 off.

Whats causing this issue?

I even tried another encoder, same issue.

The output should be:

clockwise turn:

channel * note c3 on

channel * note c3 off

channel * note c3 on

channel * note c3 off

and then for anti clockwise turn:

channel X note c3 on

channel X note c3 off

channel X note c3 on

channel X note c3 off

* and X are just variables. My problem is that which ever way I turn the encoder, it does both channels on and off.

***update, i connected only one pin of the encoder to the din module, now which ever way I turn the encoder, i get values.

I get the same values if I turn the encoder clock or anti clock wise.

Faulty encoders?

Update***

ive just changed to midibx64e (after hours of reading and a few simple changes in the code), I still get the same problem.

I read somewhere about encoder mode DETENT3, but now I cant find it anywhere, I even tried to use it in the code but I got compile errors.

Below is the code that im using now. I still have the problem with the encoder(connect to SR2 on PIN 6 and PIN 7.

LIST P=PIC18F452, R=DEC

        ERRORLEVEL      -223    ; suppress "Redefining processor."

;

#define SEPERATE_SETUP_FILE

#define DEFAULT_NUMBER_ENCS 2

#define DEFAULT_ENCODER_GROUP_WIDTH DEFAULT_NUMBER_ENCS

#define DEFAULT_NUMBER_BUTTONS  64

#define DEFAULT_SRIO_DEBOUNCE_CTR 16

#define DEFAULT_PATCHMODE 0

#define DEFAULT_BANK_PRG_CHNG_CHANNEL 16

#define DEFAULT_PATCH_PRG_CHNG_CHANNEL 15

#define DEFAULT_BANKSTICK_CS -1

#define DEFAULT_DEVICE_ID 0x00

#define DEFAULT_AUTO_DEVICE_ID 1

#define DEFAULT_MIDI_MONITOR_ENABLED 0

#define DEFAULT_MIDI_RX_LED 0x40

#define DEFAULT_MIDI_TX_LED 0x41

#define LEDRINGS_SR_ENC1_16_CATHODES_1 0

#define LEDRINGS_SR_ENC1_16_CATHODES_2 0

#define LEDRINGS_SR_ENC1_16_ANODES_1 0

#define LEDRINGS_SR_ENC1_16_ANODES_2 0

#define LEDRINGS_SR_ENC17_32_CATHODES_1 0

#define LEDRINGS_SR_ENC17_32_CATHODES_2 0

#define LEDRINGS_SR_ENC17_32_ANODES_1 0

#define LEDRINGS_SR_ENC17_32_ANODES_2 0

#define LEDRINGS_SR_ENC33_48_CATHODES_1 0

#define LEDRINGS_SR_ENC33_48_CATHODES_2 0

#define LEDRINGS_SR_ENC33_48_ANODES_1 0

#define LEDRINGS_SR_ENC33_48_ANODES_2 0

;

#define LEDRINGS_SR_ENC49_64_CATHODES_1 0

#define LEDRINGS_SR_ENC49_64_CATHODES_2 0

#define LEDRINGS_SR_ENC49_64_ANODES_1 0

#define LEDRINGS_SR_ENC49_64_ANODES_2 0

#define DEFAULT_ENC_SPEED_NORMAL_MODE  MIOS_ENC_SPEED_NORMAL

#define DEFAULT_ENC_SPEED_NORMAL_DIV 0

#define DEFAULT_ENC_SPEED_SLOW_MODE    MIOS_ENC_SPEED_SLOW

#define DEFAULT_ENC_SPEED_SLOW_DIV 6

#define DEFAULT_ENC_SPEED_FAST_MODE    MIOS_ENC_SPEED_FAST

#define DEFAULT_ENC_SPEED_FAST_DIV 4

#define DEFAULT_DIN_SR_PIN_01_08 2

#define DEFAULT_DIN_SR_PIN_09_16 3

#define DEFAULT_DIN_SR_PIN_17_24 1

#define DEFAULT_DIN_SR_PIN_25_32 4

#define DEFAULT_DIN_SR_PIN_33_40 5

#define DEFAULT_DIN_SR_PIN_41_48 6

#define DEFAULT_DIN_SR_PIN_49_56 7

#define DEFAULT_DIN_SR_PIN_57_64 8

#define DEFAULT_ENC_DATAWHEEL  0

#define DEFAULT_DIN_MENU_EXEC 7

#define DEFAULT_DIN_MENU_RIGHT 6

#define DEFAULT_DIN_MENU_LEFT 5

#define DEFAULT_DIN_MENU_SNAPSHOT 4

;

#define DEFAULT_DOUT_SR_PIN_01_08 1

#define DEFAULT_DOUT_SR_PIN_09_16 2

#define DEFAULT_DOUT_SR_PIN_17_24 0

#define DEFAULT_DOUT_SR_PIN_25_32 3

#define DEFAULT_DOUT_SR_PIN_33_40 4

#define DEFAULT_DOUT_SR_PIN_41_48 5

#define DEFAULT_DOUT_SR_PIN_49_56 6

#define DEFAULT_DOUT_SR_PIN_57_64 7

#define DEFAULT_GP_DIN_SR0 0

#define DEFAULT_GP_DIN_SR1 0

#define DEFAULT_GP_DOUT_SR0 0

#define DEFAULT_GP_DOUT_SR1 0

#define DEFAULT_YOFFSET_LINE0 0x00

#define DEFAULT_YOFFSET_LINE1 0x40

#define DEFAULT_YOFFSET_LINE2 0x14

#define DEFAULT_YOFFSET_LINE3 0x54

#define DEFAULT_MORPH_FUNCTION_ENABLED 0

#define DEFAULT_NUMBER_AIN 64

#define DEFAULT_ENABLE_AIN_MUX 1

#define DEFAULT_ENABLE_MOTORDRIVER 0

#define DEFAULT_MF_PWM_DUTY_UP         0x01

#define DEFAULT_MF_PWM_DUTY_DOWN        0x01

#define DEFAULT_MF_PWM_PERIOD          0x03

#define DEFAULT_TOUCH_SENSOR_SR 0

#define DEFAULT_TOUCH_SENSOR_MODE 0

#define DEFAULT_TOUCH_SENSOR_SENSITIVITY 3

org 0x3280 ; never change the origin!

;; encoder entry structure

ENC_ENTRY MACRO sr, din_0, mode

dw (mode << 8) | (din_0 + 8*(sr-1))

ENDM

ENC_EOT MACRO

dw 0xffff

ENDM

MIOS_ENC_PIN_TABLE

;; encoders 1-16

;;        SR  Pin  Mode

ENC_ENTRY  2,  6,  MIOS_ENC_MODE_NON_DETENTED ; V-Pot 1

ENC_ENTRY  3,  2,  MIOS_ENC_MODE_NON_DETENTED ; V-Pot 2

ENC_EOT

ENC_EOT

ENC_EOT

ENC_EOT

ENC_EOT

ENC_EOT

ENC_EOT

ENC_EOT

ENC_EOT

ENC_EOT

ENC_EOT

ENC_EOT

ENC_EOT

ENC_EOT

;; encoders 17-32

ENC_EOT

ENC_EOT

ENC_EOT

ENC_EOT

ENC_EOT

ENC_EOT

ENC_EOT

ENC_EOT

ENC_EOT

ENC_EOT

ENC_EOT

ENC_EOT

ENC_EOT

ENC_EOT

ENC_EOT

ENC_EOT

;; encoders 33-48

ENC_EOT

ENC_EOT

ENC_EOT

ENC_EOT

ENC_EOT

ENC_EOT

ENC_EOT

ENC_EOT

ENC_EOT

ENC_EOT

ENC_EOT

ENC_EOT

ENC_EOT

ENC_EOT

ENC_EOT

ENC_EOT

;; encoders 49-64

ENC_EOT

ENC_EOT

ENC_EOT

ENC_EOT

ENC_EOT

ENC_EOT

ENC_EOT

ENC_EOT

ENC_EOT

ENC_EOT

ENC_EOT

ENC_EOT

ENC_EOT

ENC_EOT

ENC_EOT

ENC_EOT

#include "main.asm"

Link to comment
Share on other sites

There is no encoder mode which would cause an event sent over different MIDI channels while the encoder is moved.

Could it be, that it is connected to wrong pins?

Encoders can only be connected to D0/D1, D2/D3, D4/D5 or D6/D7 of a 74HC165

If you would connect it to (for example) D1 and D2, you would notice exactly this effect.

Best Regards, Thorsten.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...