Jump to content

Recommended Posts

Posted

I want to try to add the Signal-LED for channels in LC-application

- Status for LED is to find in SysEx-Message <Hdr> 21 ii mm F7 (where "ii" represents the fader-channel and bit 1 of "mm" set LED for this channel "ON" or "OFF")

- I add line

Signal_LED_SR EQU 9        ;in my setup these LEDs are on shiftregister 9
to "main.asm"  - Where is the best place to include following code? I would try to insert it to "MPROC.inc" in "Set_Meter_Mode" working with the second byte
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

      movf Signal_LED_SR, W                                          ; writes the Shiftregister-Number to W
      mullw 0x08                                                ; multply with 8
      movwf TMP1                                                ; save result in TMP1
      movf LC_METER_CHANNEL, W                                    ; writes channel-number to W
      addwf TMP1                                                ; add W to TMP1 => result is DOUT-Pin for Signal-LED
      movf TMP1, W                                                ; writes TMP1 to W (for use with MIOS_Dout_PinSet....)
      IFSET LC_MPROC_IN, 1, CALL MIOS_Dout_PinSet1                        ; set LED "ON" if bit 1 of Meter_Mode-Byte  is "1"
      IFCLR LC_MPROC_IN, 1, CALL MIOS_Dout_PinSet0                        ; set LED "OFF" if bit 1 of Meter_Mode-Byte is "0"
      
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

Or do we have to make a "SIGNAL_LED_REQUEST"-Flag and move the work to an extra subroutine called by "USER_Tick" or anything else?

Bye  Pearl

Posted

Hi,

LC_MPROC_Action_Meter as well as LC_MPROC_Received_D0 already store the received byte in the METER_MODE array (consists of 8 items, one for every meter). So, you can access this array whenever you want to get the "p" bit.

Btw: this bit is already displayed by the center LED of every LED ring if meter mode enabled.

It's not optimal to use the LC_MPROC_Action_Meter to update additional LEDs, since the mode could also be changed by a D0 event.

The most proper method is to hook the additional code to the LC_METERS_Handler in "lc_meters.inc" (see code)

Best Regards, Thorsten.

P.S.: the result of a mullw instruction can be found in PRODL and PRODH, and not in WREG

Posted

Hi...

Am I right, the 1st Bit of "XX" in "DO XX"- Peak-Level-Message is the same as 1st Bit of "mm" in "<Hdr> 20 ii mm F7" -Channel-Meter-Mode-Message?

(If not, in "lc_meters.inc" only the LC_Meter_Level was handled !?)

And PRODL ... really good tip  :D  (there is no hint in MPLab-Assembler-Helpfile)

Are PRODL and PRODH static or is it possible to add a value like " addwf PRODL" ?

Thanx and

                 Bye Pearl

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