Jump to content

error with additional encoders in lc


Pearl
 Share

Recommended Posts

Hi there ...

I want to add some encoders to the lc-emulation but if I try to compile the new file I got the following message:

Executing: "C:\Programme\MPLAB IDE\MCHIP_Tools\mpasmwin.exe" /q /p18F452 "main.asm" /l"main.lst" /e"main.err"

Error[126]   D:\REMOTECONTROL\MIOS\2_XT2_MIDIBOX_LC_V1_4\LC_SFB.INC 238 : Argument out of range (1027 not between -1024 and 1023)

Halting build on first failure as requested.

BUILD FAILED

my code in "enc.inc":

USER_ENC_NotifyChange
      ;; if encoder number within 0 and 7, send a V-pot event
      movlw      0x07
      IFLEQ      MIOS_PARAMETER1, ACCESS, rgoto LC_ENC_SendVPot

      movf      MIOS_PARAMETER1, W
      ;; if encoder number == 8, send jog-wheel event
      xorlw      0x08
      bz      LC_ENC_SendJogWheel
      
      ;; if encoder number within 9 and 13, send NRPN-event
      movf      MIOS_PARAMETER1, W
      xorlw      0x09
      bz LC_ENC_SendNRPN
      movf      MIOS_PARAMETER1, W
      xorlw      0x0A
      bz LC_ENC_SendNRPN
      movf      MIOS_PARAMETER1, W
      xorlw      0x0B
      bz LC_ENC_SendNRPN
      movf      MIOS_PARAMETER1, W
      xorlw      0x0C
      bz LC_ENC_SendNRPN
      
      ;; if encoder number > 13, send CC-event
      movlw      0x0D
      IFGEQ      MIOS_PARAMETER1, ACCESS, rgoto LC_ENC_SendCC

      ;; else do nothing
      return

LC_ENC_SendNPRN and LC_SendCC are new subroutines to handle NRPN/CC - events.

Any idea wath's wrong?

thnx Pearl

Link to comment
Share on other sites

Hi TK ...

Additional info :

- LC_SFB.inc :  I don't know exactly (got only the online-partition here) but it's standard code from lc emulation (ver. 4) - no changes

- if I left out 4 lines everything is ok ... it seems that the pointer from the LC_SFB.inc  is 1023 or less.

- I can reproduce this with left out 3 lines --> makes error "Argument out of range(1024 .....)" and so on

- the new subs LC_ENC_SendNPRN and LC_SendCC are empty at the moment ( only "return")

p.s. If it is ok we can post in german till we found the solution. [it would be much easier to describe the problem ;-) ]

Bye Pearl

Link to comment
Share on other sites

  • 1 year later...

Hi there ...

Today I tried to update my LC - Application to Vers. 1.6 by copying all my personal modifications to the new source files, but after compiling, I got a similar error as in the past:

"Error[126]   E:\MIOS\SW\LC 1.6\LC_1_V1_6\MACROS.H 161 : Argument out of range (1044 not between -1024 and 1023)"

What's the meaning of this error-message? And how can I solve this problem?

I didn't changed anything in "Macros.h"!

Thanx and bye

Pearl

Link to comment
Share on other sites

Hi TK ...

I didn't writing anything in C , but I got advanced skills VB/VB.Net .

So I think, I want to try the beta and will learning by doing.  ;-)

Another question to my problem: Are memory limits or limits of "branch" and "jumping" in assembler the reason?

My additional code is OK in "LC_1_5". I work with my LC one year.

Thanx and bye

Pearl

Link to comment
Share on other sites

Hi Pearl,

Another question to my problem: Are memory limits or limits of "branch" and "jumping" in assembler the reason?

Yes, there are limitations, which can easily be fixed.

E.g., if the error happens on a "rgoto" or "bra", use "goto" instead

If the error happens on a "rcall", use "call" instead

If it happens on a "bz" or "bnz", use "skpnz/skpz" and "goto" or "rgoto" instead

Just take a look into the main.lst file and search for the error message, this should make clear where it exactly happens

Alpha version (not complete!) of C based MIDIbox LC can now be downloaded from this location:

http://www.ucapps.de/mios/midibox_lc_v2_0_alpha1.zip

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

×
×
  • Create New...