Okay I manged to find some time to post this… I am having erratic behaviour with my bournes encoder… I have changed the wiring config several times and no change and the various detented settings in the 6581.asm file… Also getting line errors when compiling the asm file…
I thinks it is a coding issue…
DIN_ENTRY MACRO function, sr, pin
dw function, (pin + 8*(sr-1)) & 0xff
ENDM
DIN_ENTRY_EOT MACRO
dw 0x0000, 0x0000
ENDM
CS_MENU_DIN_TABLE
;; Function name SR# Pin#
DIN_ENTRY CS_MENU_BUTTON_Dec, 2, 1 ; only valid if rotary encoder not assigned to these pins
DIN_ENTRY CS_MENU_BUTTON_Inc, 2, 0 ; (see mios_tables.inc) and CS_MENU_USE_INCDEC_BUTTONS == 1
DIN_ENTRY CS_MENU_BUTTON_Exec, 2, 2
DIN_ENTRY CS_MENU_BUTTON_Sel1, 1, 7
DIN_ENTRY CS_MENU_BUTTON_Sel2, 1, 6
DIN_ENTRY CS_MENU_BUTTON_Sel3, 1, 5
DIN_ENTRY CS_MENU_BUTTON_Sel4, 1, 4
DIN_ENTRY CS_MENU_BUTTON_Sel5, 2, 3
DIN_ENTRY CS_MENU_BUTTON_Sel6, 4, 0 ; define this if CS_MENU_DISPLAYED_ITEMS > 5
DIN_ENTRY CS_MENU_BUTTON_Sel7, 4, 1 ; define this if CS_MENU_DISPLAYED_ITEMS > 5
DIN_ENTRY CS_MENU_BUTTON_Sel8, 4, 2 ; define this if CS_MENU_DISPLAYED_ITEMS > 5
DIN_ENTRY CS_MENU_BUTTON_Sel9, 4, 3 ; define this if CS_MENU_DISPLAYED_ITEMS > 5
DIN_ENTRY CS_MENU_BUTTON_Sel10, 3, 4 ; define this if CS_MENU_DISPLAYED_ITEMS > 5
DIN_ENTRY CS_MENU_BUTTON_SID1, 0, 0
DIN_ENTRY CS_MENU_BUTTON_SID2, 0, 0
DIN_ENTRY CS_MENU_BUTTON_SID3, 0, 0
DIN_ENTRY CS_MENU_BUTTON_SID4, 0, 0
DIN_ENTRY CS_MENU_BUTTON_Shift, 3, 5 ; was: link button
DIN_ENTRY CS_MENU_BUTTON_CC_PageUp, 3, 6 ; combined CC/PageUp -- CC actived together with shift button (no error)
DIN_ENTRY CS_MENU_BUTTON_Edit_PageDown, 3, 7 ; combined Edit/PageDown -- Edit actived together with shift button (no error)
DIN_ENTRY CS_MENU_BUTTON_Osc_Sel, 0, 0
DIN_ENTRY CS_MENU_BUTTON_Osc_Ctrl, 0, 0
DIN_ENTRY CS_MENU_BUTTON_Osc_Wav, 0, 0
DIN_ENTRY CS_MENU_BUTTON_Osc_RS, 0, 0
DIN_ENTRY CS_MENU_BUTTON_LFO_Sel, 0, 0
DIN_ENTRY CS_MENU_BUTTON_LFO_Wav, 0, 0
DIN_ENTRY CS_MENU_BUTTON_Env_Sel, 0, 0
DIN_ENTRY CS_MENU_BUTTON_Env_Ctrl, 0, 0
DIN_ENTRY CS_MENU_BUTTON_Fil_Sel, 0, 0
DIN_ENTRY CS_MENU_BUTTON_Fil_Mod, 0, 0
DIN_ENTRY CS_MENU_BUTTON_M_O1Ptch, 0, 0
DIN_ENTRY CS_MENU_BUTTON_M_O2Ptch, 0, 0
DIN_ENTRY CS_MENU_BUTTON_M_O3Ptch, 0, 0
DIN_ENTRY CS_MENU_BUTTON_M_O1PW, 0, 0
DIN_ENTRY CS_MENU_BUTTON_M_O2PW, 0, 0
DIN_ENTRY CS_MENU_BUTTON_M_O3PW, 0, 0
DIN_ENTRY CS_MENU_BUTTON_M_Filter, 0, 0
DIN_ENTRY CS_MENU_BUTTON_M_E1, 0, 0
DIN_ENTRY CS_MENU_BUTTON_M_E2, 0, 0
DIN_ENTRY CS_MENU_BUTTON_M_L1, 0, 0
DIN_ENTRY CS_MENU_BUTTON_M_L2, 0, 0
DIN_ENTRY CS_MENU_BUTTON_M_L3, 0, 0
DIN_ENTRY CS_MENU_BUTTON_M_L4, 0, 0
DIN_ENTRY CS_MENU_BUTTON_M_L5, 0, 0
DIN_ENTRY CS_MENU_BUTTON_M_L6, 0, 0
DIN_ENTRY CS_MENU_BUTTON_M_Vol, 0, 0
Above is for my control panel for a 2x40 LCD config…
;; 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
;; SR Pin Mode
#if CS_MENU_USE_INCDEC_BUTTONS == 0
ENC_ENTRY 2, 0, MIOS_ENC_MODE_DETENTED2 ; menu encoder
#endif
;; additional CS encoders
;; SR Pin Mode
ENC_ENTRY 0, 0, MIOS_ENC_MODE_DETENTED2 ; Osc delay/transpose/assign #1
ENC_ENTRY 0, 0, MIOS_ENC_MODE_DETENTED2 ; Osc attack/finetune/assign #2
ENC_ENTRY 0, 0, MIOS_ENC_MODE_DETENTED2 ; Osc decay/portamento/assign #3
ENC_ENTRY 0, 0, MIOS_ENC_MODE_DETENTED2 ; Osc sustain/release/assign #4
ENC_ENTRY 0, 0, MIOS_ENC_MODE_DETENTED2 ; Osc release/pulsewidth/assign #5
ENC_ENTRY 0, 0, MIOS_ENC_MODE_DETENTED2 ; LFO rate
ENC_ENTRY 0, 0, MIOS_ENC_MODE_DETENTED2 ; LFO depth
ENC_ENTRY 0, 0, MIOS_ENC_MODE_DETENTED2 ; Filter CutOff
ENC_ENTRY 0, 0, MIOS_ENC_MODE_DETENTED2 ; Filter Resonance
ENC_ENTRY 0, 0, MIOS_ENC_MODE_DETENTED2 ; Env depth/assign #1
ENC_ENTRY 0, 0, MIOS_ENC_MODE_DETENTED2 ; Env attack/assign #2
ENC_ENTRY 0, 0, MIOS_ENC_MODE_DETENTED2 ; Env decay/assign #3
ENC_ENTRY 0, 0, MIOS_ENC_MODE_DETENTED2 ; Env sustain/assign #4
ENC_ENTRY 0, 0, MIOS_ENC_MODE_DETENTED2 ; Env release/assign #5
;; don't remove this "end-of-table" entry!
ENC_EOT
Above code for encoder…
dw (mode << 8) | (din_0 + 8*(sr-1))
Above code for line 408 error… That code is part of the encoder code… Is that formula above correct? I want to sort this encoder issue out or I will have to resort to up/down buttons which will not look nice with a big hole on the control surface where the encoder once was…