Jump to content

The Flashing Led Thingy


Recommended Posts

Hi there

This ones probably for you TK

I have been working on that Live controller based on the 64E.

Faders and enc's are working now but I would like to revisit the flashing led scenario as visited a long time ago.

I have made changes to the SR Service prepare and the App defines as follows.

USER_SR_Service_Prepare

     ;; call LEDrings handler

     call      MB64E_LEDRINGS_Handler

     ;; branch to the Rx/Tx LED handler

     goto      MIDI_RXTX_Handler

led_FLASH_Handler

;; increment counter

incf DOUT_led_CTR, F

;; skip next block if led should not flash

IFCLR DOUT_led_FLASH_ENABLE, 0, rgoto led_FLASH_Handler_Skip0

;; skip if DOUT counter < 128 (bit #7 not set), this leads to a

;; flashing frequency of 1 / (128 * update_cycle) = 1 / (128 * 1 mS) = ca. 8 Hz

IFCLR DOUT_led_CTR, 7, rgoto led_FLASH_Handler_Skip0

;; get value of led at DOUT #0

movlw 0x00

call MIOS_DOUT_PinGet

;; result in MIOS_PARAMETER1, invert it

comf MIOS_PARAMETER1, F

;; write back result to DOUT #0

movlw 0x00

call MIOS_DOUT_PinSet

led_FLASH_Handler_Skip0

;; thats all

return

;;  LEDring patterns

;; ==========================================================================

LEDRING_PATTERN_0      EQU      0

LEDRING_PATTERN_1      EQU      1

LEDRING_PATTERN_2      EQU      2

LEDRING_PATTERN_3      EQU      3

;; ==========================================================================

DOUT_led_ctr            EQU      0x021

DOUT_led_FLASH_ENABLE      EQU      0x022

     ;; free memory for user applications:      

     ;; 0x010-0x37f

This did not seem to work and gave me a pile of errors. 12 to be exact.

Could you give me a few hints here please.

Thanks TK

Regards

Ian

Link to comment
Share on other sites

Hi Ian,

I found some warnings in the .err file like:

Warning[203] C:\PROG STUFF\MIDIBOX64E_V2_1\MAIN.ASM 571 : Found opcode in column 1. (incf)
Warning[206] C:\PROG STUFF\MIDIBOX64E_V2_1\MAIN.ASM 574 : Found call to macro in column 1. (IFCLR)
Warning[206] C:\PROG STUFF\MIDIBOX64E_V2_1\MAIN.ASM 577 : Found call to macro in column 1. (IFCLR)
Warning[203] C:\PROG STUFF\MIDIBOX64E_V2_1\MAIN.ASM 579 : Found opcode in column 1. (movlw)
Warning[203] C:\PROG STUFF\MIDIBOX64E_V2_1\MAIN.ASM 580 : Found opcode in column 1. (call)
Warning[203] C:\PROG STUFF\MIDIBOX64E_V2_1\MAIN.ASM 582 : Found opcode in column 1. (comf)
Warning[203] C:\PROG STUFF\MIDIBOX64E_V2_1\MAIN.ASM 584 : Found opcode in column 1. (movlw)
Warning[203] C:\PROG STUFF\MIDIBOX64E_V2_1\MAIN.ASM 585 : Found opcode in column 1. (call)
Warning[203] C:\PROG STUFF\MIDIBOX64E_V2_1\MAIN.ASM 589 : Found opcode in column 1. (return)

it seems that the assembler fails since there are no space characters between the instructions and the first column. Therefore the assembler cannot determine if the "word" at the beginning is really an instruction (like incf) or a label (like  USER_SR_Service_Prepare)

Tip: just add TAB characters before every instruction, and the assembler should pass. If not, check the .err file again

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