Jump to content

MIOS Error... What Does it Mean?


cosmosuave
 Share

Recommended Posts

I am still having issues with my Bournes encoder being erratic when changing parameters... I have changed the detented value in the .asm file several times and the wiring to the encoder and no real change... When I compile the 6581.asm I do get the following error and is this causing the erratic behaviour of the encoder?

Error msg..

setup_6581.asm:411: Warning [202] Argument out of range. Least significant bits used.

Is [202] the line of code that is causing the issue? Please forgive me as I am not that knowledgable about programming...

Thanks...

Link to comment
Share on other sites

Apparently there's a warning in line 411 of setup_6581.asm :D Which line is that in your file?

What this (which is not a MIOS error but a compiler warning btw) tells you is that some value is assigned to some variable, with the value being out of range. For instance if you had an "unsigned char" = 1 Byte = 0-255 and assigned 258 to it, you'd get that error.

So, what's in line 411 of your setup_6581.asm?

Link to comment
Share on other sites

Notepad++ is an excellent editor.

Totally. The full explorer plugin (not the 'light' one that comes with) is a must-have too. In fact with it's external program (compiler) execution and debugger integration plugins, I've been thinking about it's use as a MIOS IDE, especially as it does ASM highlighting too, as it could be used as a single tool for both ASM and C apps (and those that use both)... Hmm </hijack> :-X

Link to comment
Share on other sites

Okay here is the line 411 and it deals with the encoder so I hope this will fix the erratic behaviour once someone looks at the code...

;; encoder entry structure

ENC_ENTRY MACRO sr, din_0, mode

dw (mode << 8) | (din_0 + 8*(sr-1)) <---------This is Line 411

ENDM

ENC_EOT MACRO

dw 0xffff

ENDM

Kind of ironic that the error is 411 and that I need nfo on the 411... Ok bad humour...

Thanks...

Link to comment
Share on other sites

Okay here is the line 411 and it deals with the encoder so I hope this will fix the erratic behaviour once someone looks at the code...

;; encoder entry structure

ENC_ENTRY MACRO sr, din_0, mode

...

this no doubt indicates and error in your encoder table, take a look at that and if you don't see the problem, post the table and someone will help...

oh, and use the code tag, so it is more readable (the # button above)

Link to comment
Share on other sites

Okay hope this is what's req'd

This code for the contrl panel...

________________________________________________________________

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

_____________________________________________________________________________

Encoder code...

;; 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_DETENTED3 ; menu encoder

#endif

;; additional CS encoders

;;        SR  Pin  Mode

ENC_ENTRY  0,  0,  MIOS_ENC_MODE_DETENTED3 ; Osc delay/transpose/assign #1

ENC_ENTRY  0,  0,  MIOS_ENC_MODE_DETENTED3 ; Osc attack/finetune/assign #2

ENC_ENTRY  0,  0,  MIOS_ENC_MODE_DETENTED3 ; Osc decay/portamento/assign #3

ENC_ENTRY  0,  0,  MIOS_ENC_MODE_DETENTED3 ; Osc sustain/release/assign #4

ENC_ENTRY  0,  0,  MIOS_ENC_MODE_DETENTED3 ; Osc release/pulsewidth/assign #5

ENC_ENTRY  0,  0,  MIOS_ENC_MODE_DETENTED3 ; LFO rate

ENC_ENTRY  0,  0,  MIOS_ENC_MODE_DETENTED3 ; LFO depth

ENC_ENTRY  0,  0,  MIOS_ENC_MODE_DETENTED3 ; Filter CutOff

ENC_ENTRY  0,  0,  MIOS_ENC_MODE_DETENTED3 ; Filter Resonance

ENC_ENTRY  0,  0,  MIOS_ENC_MODE_DETENTED3 ; Env depth/assign #1

ENC_ENTRY  0,  0,  MIOS_ENC_MODE_DETENTED3 ; Env attack/assign #2

ENC_ENTRY  0,  0,  MIOS_ENC_MODE_DETENTED3 ; Env decay/assign #3

ENC_ENTRY  0,  0,  MIOS_ENC_MODE_DETENTED3 ; Env sustain/assign #4

ENC_ENTRY  0,  0,  MIOS_ENC_MODE_DETENTED3 ; Env release/assign #5

;; don't remove this "end-of-table" entry!

ENC_EOT

Link to comment
Share on other sites

yes that's the stuff.

it looks ok to me, did you define MIOS_ENC_MODE_DETENTED3  yourself?

it should be

MIOS_ENC_MODE_DETENTED3      EQU   0x82

Yes I try'd DETENTED2 and it produced erratic behaviour  with the Bournes encoder... I may start with a fresh 6581.asm file and go from there...

Link to comment
Share on other sites

Started with a new 6581.asm file made my changes and used the default DETENTED2 and still get the same following error but at line 408

dw  (mode <<  | (din_0 + 8*(sr-1)) <---------This is Line 408

As I recall there were some discussions about this formula in one of my previous threads...

Link to comment
Share on other sites

cosmo... try using the code tag like bugfight said, it will stop your code from getting mangled up and turned into smilies and such, and allow others who would like to help you (like for example me), to read it clearly.

nils: yes you can also use 'Edit.. Go' and enter the line you want.

edit: oh and cosmo link us to that thread mate.

Link to comment
Share on other sites

cosmo... try using the code tag like bugfight said, it will stop your code from getting mangled up and turned into smilies and such, and allow others who would like to help you (like for example me), to read it clearly.

nils: yes you can also use 'Edit.. Go' and enter the line you want.

edit: oh and cosmo link us to that thread mate.

Code tag what is that? I know what you mean when i post the code I'm getting smilies and I checked in my profile to disable but I can't... Here is a link to the thread that I think may relate to my issue... For this line of code...

dw  (mode <<  | (din_0 + 8*(sr-1)) <---------This is Line 408

Link:  http://www.midibox.org/forum/index.php/topic,10936.msg84596.html#msg84596

Scroll to the bottom of 1st page... Then again those #%!! smilies are screwing things up again... I need to get this encoder sorted trying to program the sequencer on the bass engine is a PITA..

Link to comment
Share on other sites

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...

Link to comment
Share on other sites

Since what you just posted looks correct (at first sight) I'd guess you messed with some other part of the source code or your encoder is broken or your DIN is not working.

a) try another encoder

b) connect the encoder to a different SR

c) download a clean version of the source

Link to comment
Share on other sites

Since what you just posted looks correct (at first sight) I'd guess you messed with some other part of the source code or your encoder is broken or your DIN is not working.

a) try another encoder

b) connect the encoder to a different SR

c) download a clean version of the source

a) have yet to try none of my local shops carry encoders

b) will give this a go

c) I have a dl'd a clean version in the event something else was causing issues but no change..

Thanks Nils I'll try b and hope that will work if not then I'll source an encoder...

Link to comment
Share on other sites

I have changed the encoder to different pins... When I change the coding on the 6581asm file sometimes I can get values to increment one integer at a time but the drawback is this: Only works to decrease value no matter which way the encoder is turned...

When turning the encoder left/right the integer value is erratic... Going to DL a new asm file load it to see if I get the compiling error that I have been getting and start changing the coding one section at a time and compile to see what I am doing wrong....

Link to comment
Share on other sites

Downloaded  http://www.ucapps.de/mios/midibox_sid_v2_0_rc17.zip but now it has been revised to  http://www.ucapps.de/mios/midibox_sid_v2_0_rc18.zip...

Open the 6581.asm file in note pad to configure SR pins and it one huge mess of text... Open in Notepad++ but have now idea how to compile it into a hex file?

When I was using rc17.zip 6581.asm file I compiled the gpasm way using the DOS cmd window using the [make] comand...

I have now opened a whole can of worms... Al I want is this encoder to work like it should (smacks forehead)...

Link to comment
Share on other sites

  • 3 weeks later...

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...
 Share

×
×
  • Create New...