Pearl Posted April 29, 2004 Report Posted April 29, 2004 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
TK. Posted April 29, 2004 Report Posted April 29, 2004 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
Pearl Posted April 30, 2004 Author Report Posted April 30, 2004 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
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now