MIDIbox SID-NUXX - MIOS Changes

From nuxx.net
Jump to: navigation, search

About

These are changes made to MIOS v1.9c and the MIDIbox SID v1.7303b application to make it work as I've desired on a MIDIbox SID-NUXX. These are simple configuration changes and are nothing substantial, but the MIDIbox SID-NUXX won't work properly without them.

A bit more information about the binaries which use these changes can be found in MIDIbox SID-NUXX - Binaries.


mios_v1_9c_src

bootloader/main.asm

  • Define the PIC type:
;; ==========================================================================
;;  Select the device here
;;     0: PIC18F452   (writable range: 0x0400-0x7fff)
;;     1: PIC18F4620  (writable range: 0x0400-0xffff)
;;     2: PIC18F4520  (writable range: 0x0400-0x7fff)
;; ==========================================================================

#define PIC_DERIVATIVE_TYPE	1


  • Make MIDI Out go via IIC_MIDI:
#define PICID_IIC_MIDI_ADDR 0x10 ; if != 0x00 and != 0xff, MBHP_IIC_MIDI slave 
				; with the given address will be used as second MIDI OUT


src/mios.h

  • Define the PIC type:
;; ==========================================================================
;;  Select the device here
;;     0: PIC18F452   (writable range: 0x0400-0x7fff)
;;     1: PIC18F4620  (writable range: 0x0400-0xffff)
;;     2: PIC18F4520  (writable range: 0x0400-0x7fff)
;; ==========================================================================

#define PIC_DERIVATIVE_TYPE	1


midibox_sid_v1_7303b

main.asm

  • Change this to 1 if using a 25LC512, the alternate part. Otherwise leave it alone:
	;; select the BankStick type you are using here:
	;;    0: "normal" 24LC256 EEPROM (32k), up to 8 EEPROMs can be connected for 8 banks
	;;    1: 24LC512 EEPROM (64k), up to 4 EEPROMs can be connected for 8 banks
	;;       (it is not possible to mix 32k with 64k EEPROMs, more than 4 64k devices not supported)
#define DEFAULT_BS_TYPE		1


  • If using a 8580 SID, this needs to be changed to 1. Leave it at 0 if using a 6581:
	;; select the filter type here:
	;;    0: if a 6581 is controlled from the core
	;;    1: if a 8580 is controlled from the core
	;;    2: 6581 + freely definable scaling (define MIN and MAX value below)
	;;    3: 8580 + freely definable scaling (define MIN and MAX value below)
#define DEFAULT_FILTER_TYPE	1


  • Disable modulation LED matrix:
	;; set this to '1' if the modulation matrix (8x7 LEDs) is connected to the DOUT chain
#define MOD_MATRIX_ENABLE	0


  • Disable MIDI LEDs because we already do this in hardware:
#define DEFAULT_MIDI_MONITOR_ENABLED 0  ; if 1, the Tx/Rx LEDs are enabled


mios.h

  • Define the PIC type:
;; ==========================================================================
;;  Select the device here
;;     0: PIC18F452   (writable range: 0x0400-0x7fff)
;;     1: PIC18F4620  (writable range: 0x0400-0xffff)
;;     2: PIC18F4520  (writable range: 0x0400-0x7fff)
;; ==========================================================================

#define PIC_DERIVATIVE_TYPE	1


mios_tables.inc

  • To support only one rotary encoder, to be used for menu selection. Uses shift register 1 (the first one), pins 0-1. Only the first, even-numbered pin needs to be specified. Pin B of rotary encoder connects to pin 0 of the shift register. Pin A connects to pin 1.
#if CS_MENU_USE_INCDEC_BUTTONS
	ENC_EOT
#else
	ENC_ENTRY  1,  0,  MIOS_ENC_MODE_DETENTED2	; menu encoder
#endif

	;; additional CS encoders
	;;        SR  Pin  Mode
	ENC_EOT
	ENC_EOT
	ENC_EOT
	ENC_EOT
	ENC_EOT
	ENC_EOT
	ENC_EOT
	ENC_EOT
	ENC_EOT
	ENC_EOT
	ENC_EOT
	ENC_EOT
	ENC_EOT
	ENC_EOT
	ENC_EOT

	;; encoders 17-32
	ENC_EOT
	ENC_EOT
	ENC_EOT
	ENC_EOT
	ENC_EOT
	ENC_EOT
	ENC_EOT
	ENC_EOT
	ENC_EOT
	ENC_EOT
	ENC_EOT
	ENC_EOT
	ENC_EOT
	ENC_EOT
	ENC_EOT
	ENC_EOT

	;; encoders 33-48
	ENC_EOT
	ENC_EOT
	ENC_EOT
	ENC_EOT
	ENC_EOT
	ENC_EOT
	ENC_EOT
	ENC_EOT
	ENC_EOT
	ENC_EOT
	ENC_EOT
	ENC_EOT
	ENC_EOT
	ENC_EOT
	ENC_EOT
	ENC_EOT

	;; encoders 49-64
	ENC_EOT
	ENC_EOT
	ENC_EOT
	ENC_EOT
	ENC_EOT
	ENC_EOT
	ENC_EOT
	ENC_EOT
	ENC_EOT
	ENC_EOT
	ENC_EOT
	ENC_EOT
	ENC_EOT
	ENC_EOT
	ENC_EOT
	ENC_EOT


	org	0x3300		; never change the origin!


cs_menu_io_tables.inc

  • To support six buttons. Five for selections off of the LCD, one as a menu / exec button. Shift register numbering starts at 1, pins start at 0. MIDIbox SID-NUXX only includes one shift register and 8 pins. 0-1 are used by the rotary encoder, so 2-7 are available for the buttons.
CS_MENU_DIN_TABLE
	;;		Function name		SR#	Pin#
	DIN_ENTRY	CS_MENU_BUTTON_Dec,	 1,	 0	; only valid if rotary encoder not assigned to these pins
	DIN_ENTRY	CS_MENU_BUTTON_Inc,	 1,	 1	; (see mios_tables.inc) and CS_MENU_USE_INCDEC_BUTTONS == 1
	DIN_ENTRY	CS_MENU_BUTTON_Exec,	 1,	 7
	DIN_ENTRY	CS_MENU_BUTTON_Sel1,	 1,	 2
	DIN_ENTRY	CS_MENU_BUTTON_Sel2,	 1,	 3
	DIN_ENTRY	CS_MENU_BUTTON_Sel3,	 1,	 4
	DIN_ENTRY	CS_MENU_BUTTON_Sel4,	 1,	 5
	DIN_ENTRY	CS_MENU_BUTTON_Sel5,	 1,	 6
	DIN_ENTRY	CS_MENU_BUTTON_Sel6,	 0,	 0	; define this if CS_MENU_DISPLAYED_ITEMS > 5
	DIN_ENTRY	CS_MENU_BUTTON_Sel7,	 0,	 0	; define this if CS_MENU_DISPLAYED_ITEMS > 5
	DIN_ENTRY	CS_MENU_BUTTON_Sel8,	 0,	 0	; define this if CS_MENU_DISPLAYED_ITEMS > 5
	DIN_ENTRY	CS_MENU_BUTTON_Sel9,	 0,	 0	; define this if CS_MENU_DISPLAYED_ITEMS > 5
	DIN_ENTRY	CS_MENU_BUTTON_Sel10,	 0,	 0	; define this if CS_MENU_DISPLAYED_ITEMS > 5

	DIN_ENTRY	CS_MENU_BUTTON_SID1,	 2,      0
	DIN_ENTRY	CS_MENU_BUTTON_SID2,	 2,      1
	DIN_ENTRY	CS_MENU_B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