Jump to content

Using MIOS_DOUT in Meta Handler


robinfawell
 Share

Recommended Posts

Dear Thorsten

I am back on the organ project after a summer break.

It seems to me that I should be able to utilise the Dout shift register of my F0 meta group to record the toggle state of 3 push buttons.  This requires a different behaviour to my radio groups ( now working).

I have 3 buttons

First press sends sysex message; Second press sends a different sysex message.  They are independent from each other.


;;GrpF0 (Not Radio Group): Deals with "single" Buttons where a given Din triggers a sysex message 
;;  The next Din is unused and allows a Cancel Sysex to be sent.

MIDIO_META_Handler_F0
	movf	MIDI_EVNT1, W
	call	MIOS_DOUT_PinGet; Has this Dout been set previously?
	btfss	MIOS_PARAMETER1, 0 ; tests Dout state
	rgoto	MIDIO_GRPF0_SYSEX_SEND
	addlw	0x01; adds 1 to W thus increasing MIDI_EVNT by 1
	call 	MIOS_DOUT_PinSet0	
	rgoto	MIDIO_BANKSTICK_DUMP_GET
MIDIO_GRPF0_SYSEX_SEND
	movf	MIDI_EVNT1, W	
	call	MIOS_DOUT_PinSet1	
	rgoto	MIDIO_BANKSTICK_DUMP_GET

This works to some extent then causes the PC to crash. Please comment.

Regards Robin

Link to comment
Share on other sites

I have managed to make the program work with the following code

GrpF0 (Not Radio Group): Deals with "single" Buttons where a given Din triggers a sysex message 
;;  The next Din is unused and allows a Cancel Sysex to be sent.

MIDIO_META_Handler_F0
	movf	MIDI_EVNT1, W
	call	MIOS_DOUT_PinGet; 
	btfss	MIOS_PARAMETER1, 0 ;Has this Dout been set previously? (tests Dout state)	
	rgoto	MIDIO_GRPF0_SYSEX_SEND
	movf	MIDI_EVNT1, W	
	call 	MIOS_DOUT_PinSet0	; set LED to off
	movf	MIDI_EVNT1, W
	addlw	0x01 ; to change the Din by 1
	rgoto	MIDIO_BANKSTICK_DUMP_GET
MIDIO_GRPF0_SYSEX_SEND
	movf	MIDI_EVNT1, W
	call	MIOS_DOUT_PinSet1
	movf	MIDI_EVNT1, W	
	rgoto	MIDIO_BANKSTICK_DUMP_GET

It seems as if I must keep inserting the "movf MIDI_EVNT1, W" line before any MIOS_DOUT line.  Do these call statements destroy WREG values?

Regards Robin

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