Jump to content

Recommended Posts

Posted

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

Posted

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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...