====== Changing DOUT pins in mbSID v2 ======
====== Overview ======
If you're like me, you'd rather change the software mapping of the output (LED) pins than wire everything according to the original schematic - which may not even be possible due to differences in the CS. This HowTo will demonstrate one of the many ways to change the mapping according to your own wiring. This HowTo is only meant to change LEDs which are connected to individual pins. With LEDs connected as a matrix this will not work.
Difficulty level:
* easy 0-1-2-3-**4**-5-6-7-8-9 hard
Required actions:
* Search/manually edit
* Install other software
* Compile
Affected files [1]:
* ''setup_*.asm''
Required software:
* [[http://www.ucapps.de/mios/dout_buttons_v1_3a.zip]]
\\
\\
====== Step-by-Step description ======
\\
\\
===== 1. Finding the correct pins =====
* Download the dout_buttons_v1_3a application. This application lights one LED at a time and displays its SR and pin number.
* Install it on the (master) core
* Power up the core. Your dispay should now show sth. like thisDigital Out Test
SR# 1 Pin#0 0x00
* Upon pressing a button which is connected to an odd pin the program will increase number of the pin to power. Pressing the button once will display this:Digital Out Test
SR# 1 Pin#1 0x01
* Pressing a button which is connected to an even pin will decrease the number of the pin to power.
* Toggle through the pins and SRs and write down the SR# and Pin# for every LED until all of your leds have been lit.
* At this point you know have all the SR# and Pin# for all the LEDs
\\
\\
===== 2. Changin the source code =====
* Open ''setup_*.asm''
* Find the table called ''CS_MENU_DOUT_TABLE'' which looks like this:CS_MENU_DOUT_TABLE
;; Register and bit SR# Pin# Description
DOUT_ENTRY CS_MENU_SELECTED_SID_FLAGS, 0, 1, 0 ; SID1 LED (Note: Pin #0 is the D7 output of first SR)
DOUT_ENTRY CS_MENU_SELECTED_SID_FLAGS, 1, 1, 1 ; SID2 LED
DOUT_ENTRY CS_MENU_SELECTED_SID_FLAGS, 2, 1, 2 ; SID3 LED
DOUT_ENTRY CS_MENU_SELECTED_SID_FLAGS, 3, 1, 3 ; SID4 LED
DOUT_ENTRY CS_MENU_MODE, 0, 1, 4 ; Shift LED
DOUT_ENTRY CS_MENU_MODE, 1, 1, 5 ; CC LED
DOUT_ENTRY CS_MENU_MODE, 4, 1, 6 ; Edit LED
DOUT_ENTRY CS_MENU_SELECTED_OSC_FLAGS, 0, 2, 0 ; OSC1 LED
DOUT_ENTRY CS_MENU_SELECTED_OSC_FLAGS, 1, 2, 1 ; OSC2 LED
DOUT_ENTRY CS_MENU_SELECTED_OSC_FLAGS, 2, 2, 2 ; OSC3 LED
DOUT_ENTRY TMP1, 0, 2, 3 ; OSC Env LED
DOUT_ENTRY TMP1, 1, 2, 4 ; OSC Misc LED
DOUT_ENTRY TMP1, 2, 2, 5 ; OSC Assign LED
DOUT_ENTRY TMP1, 4, 3, 0 ; OSC Triangle LED
DOUT_ENTRY TMP1, 5, 3, 1 ; OSC Saw LED
DOUT_ENTRY TMP1, 6, 3, 2 ; OSC Pulse LED
DOUT_ENTRY TMP1, 7, 3, 3 ; OSC Noise LED
DOUT_ENTRY TMP2, 0, 2, 6 ; OSC Sync LED
DOUT_ENTRY TMP2, 1, 2, 7 ; OSC Ring LED
DOUT_ENTRY TMP3, 0, 3, 4 ; Filter O1 LED
DOUT_ENTRY TMP3, 1, 3, 5 ; Filter O2 LED
DOUT_ENTRY TMP3, 2, 3, 6 ; Filter O3 LED
DOUT_ENTRY TMP3, 3, 3, 7 ; Filter Ext LED
DOUT_ENTRY TMP3, 4, 4, 0 ; Filter LP LED
DOUT_ENTRY TMP3, 5, 4, 1 ; Filter BP LED
DOUT_ENTRY TMP3, 6, 4, 2 ; Filter HP LED
DOUT_ENTRY TMP3, 7, 4, 3 ; Filter 3O LED
DOUT_ENTRY TMP2, 4, 4, 4 ; ENV1 LED
DOUT_ENTRY TMP2, 5, 4, 5 ; ENV2 LED
DOUT_ENTRY TMP2, 6, 4, 6 ; ENV Ctrl LED
DOUT_ENTRY TMP2, 7, 4, 7 ; ENV Assign LED
DOUT_ENTRY TMP4, 0, 5, 0 ; LFO1 LED
DOUT_ENTRY TMP4, 1, 5, 1 ; LFO2 LED
DOUT_ENTRY TMP4, 2, 5, 2 ; LFO3 LED
DOUT_ENTRY TMP4, 3, 5, 3 ; LFO4 LED
DOUT_ENTRY TMP4, 4, 5, 4 ; LFO5 LED
DOUT_ENTRY TMP4, 5, 5, 5 ; LFO6 LED
DOUT_ENTRY TMP5, 0, 5, 6 ; LFO Sine LED
DOUT_ENTRY TMP5, 1, 5, 7 ; LFO Triangle LED
DOUT_ENTRY TMP5, 2, 6, 0 ; LFO Saw LED
DOUT_ENTRY TMP5, 3, 6, 1 ; LFO Pulse LED
DOUT_ENTRY TMP5, 4, 6, 2 ; LFO Random LED
;; additional LED functions which could be added:
;; o Play LED (TMP5, 6)
;; o Mode Meter LED (TMP2, 2)
;; o Mode Matrix LED (TMP2, 3)
;; o SID L LED (TMP4, 6)
;; o SID R LED (TMP4, 7)
;; o LFO Positive LED (TMP5, 5)
;; don't remove this "end-of-table" entry!
DOUT_ENTRY_EOT
* All you need to change is the 4th and 5th column (SR# and Pin#)
* I usually set all SR# and Pin# to 0 before changing anything - that way it's hard to miss anything and it keeps you from having doubles if you do not use of the buttons
* Go through the list you've made earlier and change the Pin# and SR# according to it for each LED.
* If there are LEDs you don't have on your CS just comment out that line by adding '';;'' (two semi-colons) to the beginning of that line. Like this:
;; this LED will work
DOUT_ENTRY CS_MENU_MODE, 0, 1, 4 ; Shift LED
;; this LED has been removed by commenting out
;; DOUT_ENTRY CS_MENU_MODE, 0, 1, 4 ; Shift LED
* Done with the LEDs
\\
\\
===== 3. (Optional) Additional predefined LEDs =====
* If you want to use any of the predefined LEDs that are commented out by default this is how to do it.
* At the end of the CS_MENU_DOUT_TABLE you'll find this
;; additional LED functions which could be added:
;; o Play LED (TMP5, 6)
;; o Mode Meter LED (TMP2, 2)
;; o Mode Matrix LED (TMP2, 3)
;; o SID L LED (TMP4, 6)
;; o SID R LED (TMP4, 7)
;; o LFO Positive LED (TMP5, 5)
* Those LEDs are predefined but not used. To use them just add a line to the table. Let's say we want the "Play LED"
;; o Play LED (TMP5, 6)
* Remove the '';;'' and the parentheseses and replace the name ("Play LED") by ''DOUT_ENTRY'' giving you this:
;; DOUT_ENTRY TMP5, 6
* Now add "'',''" + SR# + "'',''" + Pin# giving you sth like this:
;; DOUT_ENTRY TMP5, 6, 4, 7
* This would already work but it's a good idea to add a comment to it so you remember what this LED does:
;; DOUT_ENTRY TMP5, 6, 4, 7 ;; Play LED - whee!
* Done with the extra LEDs
\\
\\
===== 4. Recompile =====
* Now recompile the setup_*.asm
* Send it to your mbSID via MIOSStudio
* You're all done!