Subversion Repositories svn.mios

Rev

Rev 1072 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
111 tk 1
; $Id: setup_pic18f452_mbfm_v1.asm 1168 2014-06-23 22:13:36Z tk $
194 tk 2
    LIST R=DEC
111 tk 3
;
4
; Prepared Setup File for TK's MIDIbox FM setup
5
; In difference to the setup_mbfm_v1.asm configuration it uses a different 
6
; rotary encoder type and an enabled AOUT interface
7
;
8
 
9
; Hardware related setup:
10
 
11
    ;; set this to '0' to disable the control surface - this is especially usefull for
12
    ;; people who want to program their own CS handler in order to free
13
    ;; some memory
14
#define CS_ENABLED 1
15
 
960 tk 16
    ;; specific changes for the sammichFM control surface (requires PIC18F4685!)
17
#define CS_SAMMICH_FM 0
18
 
1168 tk 19
    ;; set this flag to 1 in order to enable 8bit LCD access mode for PIC18F4685 derivatives.
20
    ;; IMPORTANT: this option requires a modification on the sammichFM hardware:
21
    ;; Connect:
22
    ;; - PIC Pin RE1 to J16:D3
23
    ;; - PIC Pin RE2 to J16:D2
24
    ;; - PIC Pin RB1 to J16:D1
25
    ;; - PIC Pin RB0 to J16:D0
26
    ;; Compare following schematic for sammichFM J16 pinning: http://www.midibox.org/dokuwiki/lib/exe/fetch.php?media=sammichfm:sammichfm_base_pcb_rev_1.pdf
27
    ;; And following schematic for PIC pinning: http://www.ucapps.de/mbhp/mbhp_core_v3.pdf
28
#define USE_8BIT_LCD_DRIVER 0
29
 
960 tk 30
    ;; new custom char display handler (requires PIC18F4685!)
31
#define USE_CUSTOM_CHAR_HANDLER 0
32
 
111 tk 33
    ;; number of visible menu items on LCD
34
    ;; use:  3 for 2x16 displays
35
    ;;       4 for 2x20 displays
36
    ;;       8 for 2x40 displays
37
#define CS_MENU_DISPLAYED_ITEMS 8
38
    ;; NOTE: if CS_MENU_DISPLAYED_ITEMS < 8, you have to adapt the DIN settings
39
    ;; in cs_menu_io_tables.inc
40
 
41
    ;; OLD_STYLE == 1: page scrolls with the cursor
42
    ;; OLD_STYLE == 0: page scrolls directly with the datawheel
43
#define CS_MENU_OLD_STYLE 0
44
 
45
    ;; Inc/Dec buttons or rotary encoder of data entry?
46
    ;; use:  0 if rotary encoder should be used 
47
    ;;         (pins of encoder are defined in mios_tables.inc)
48
    ;;       1 if buttons should be used instead
49
#define CS_MENU_USE_INCDEC_BUTTONS 0
50
 
51
    ;; use:  0 if a non-detented encoder is used to select the menu items
52
    ;;       1 if a detented encoder is used to select the menu items
53
    ;; the CS_MENU_EncSpeedSet function in "cs_menu.inc" sets the speed
54
    ;; depending on this value
55
#define CS_MENU_USE_DETENTED_ENCODER 1
56
 
57
    ;; the speed value for the additional encoders (#2-#5) is defined here
58
    ;; Hint: for non-detented encoders try the following: in mios_tables.inc
59
    ;; set the type of all encoders to "MIOS_ENC_MODE_DETENTED2" in order to
60
    ;; reduce the resolution (e.g. 24 ticks per revolution for a ALPS STEC16B),
61
    ;; set the speed value to 3 --- result: so long as the encoder is moved
62
    ;; slow, the parameter can be changed very precisely. By moving the encoder
63
    ;; faster, it is possible to sweep over the whole value range with a single turn
64
    ;; ("Progressive Mode")
65
#define CS_MENU_ENC_SPEED_VALUE 1
66
 
67
    ;; select the default mode of the main display after startup:
68
    ;; 0: show all 4 instruments, names are cropped to 9 characters
69
    ;; 1: show only the selected instrument, full name is displayed
70
#define CS_MENU_DEFAULT_VIEW_MODE 1
71
 
139 tk 72
    ;; define the AOUT interface which is used here:
73
    ;;   1: one MBHP_AOUT module
74
    ;;   2: up to 4 (chained) MBHP_AOUT_LC modules
75
    ;;   3: one MBHP_AOUT_NG module
76
    ;; all other values invalid!
77
#define AOUT_INTERFACE_TYPE 0
111 tk 78
 
139 tk 79
    ;; only relevant if one or more AOUT_LC modules are used:
80
    ;; define the resolution configuration here
81
    ;;   0: first channel 12bit, second channel 4bit
82
    ;;   1: first channel 8bit, second channel 8bit
285 tk 83
    ;;   2: combines M1,M2 and/or M3/M4: first channel 12bit, second channel 12bit, third channel 8bit, fourth channel ignored!
139 tk 84
    ;; all other values invalid!
85
#define AOUT_LC_RESOLUTION_OPTION_M1 0
86
#define AOUT_LC_RESOLUTION_OPTION_M2 0
87
#define AOUT_LC_RESOLUTION_OPTION_M3 0
88
#define AOUT_LC_RESOLUTION_OPTION_M4 0
89
 
960 tk 90
    ;; if 0: pin RB2 and RB3 not used for CAN bus
91
    ;;       All MBHP_OPL3 data pins connected to J15
92
    ;; if 1: pin RB2 and RB3 are used for CAN bus
93
    ;;       MBHP_OPL3 data pins #2 and #3 have to be connected to PIC pin RB1 and RB2
94
    ;;       (available at J5:A6 and J5:A7)
95
    ;; Note: this option should only be enabled for PIC18F4685 (PIC18F452 doesn't contain a CAN)
96
#define ENABLE_MBNET 0
97
 
962 tk 98
    ;; enables the inbuilt random patch generator (requires PIC18F4685!)
99
#define ENABLE_RANDOM_GENERATOR 0
100
 
969 tk 101
    ;; wavetables astored in RAM? (requires PIC18F4685!)
102
#define WAVETABLES_IN_RAM   0
103
 
974 tk 104
    ;; shadow buffers for non-destructive modulations? (requires PIC18F4685!)
105
#define USE_SHADOW_BUFFERS  0
106
 
975 tk 107
    ;; display CC assignment names? (requires PIC18F4685!)
108
#define DISPLAY_CC_ASSIGNMENT_NAMES 0
109
 
111 tk 110
    ;; only for debugging: prints the MBFM load at the right upper edge of the 2x40 LCD
111
#define DISPLAY_PERFORMANCE 0
112
 
113
    ;; experimental superpoly mode (currently hard-coded to save programming effort)
114
#define SUPERPOLY_EXPERIMENT 0
115
 
1029 tk 116
    ;; experimental option: HiHat parameters are changed when snare drum is played, since both instruments share the same operators
117
#define DEFAULT_DRUM_SD_CHANGES_HH_OP 1
111 tk 118
 
119
 
120
;; --------------------------------------------------------------------------
121
;; In this table DIN pins have to be assigned to rotary encoders for the
122
;; MIOS_ENC driver 
123
;; 
124
;; up to 64 entries are provided
125
;; 
126
;; The table must be terminated with an ENC_EOT entry. Unused entries should
127
;; be filled with ENC_EOT
128
;; 
129
;; ENC_ENTRY provides following parameters
130
;;    o first parameter: number of shift register - 1, 2, 3, ... 16
131
;;    o second parameter: number of pin; since two pins are necessary
132
;;      for each encoder, an even number is expected: 0, 2, 4 or 6
133
;;    o the third parameter contains the encoder mode:
134
;;      either MIOS_ENC_MODE_NON_DETENTED
135
;;          or MIOS_ENC_MODE_DETENTED
136
;;          or MIOS_ENC_MODE_DETENTED2
137
;;          or MIOS_ENC_MODE_DETENTED3
138
;;      see also http://www.midibox.org/dokuwiki/doku.php?id=encoder_types
139
;;
140
;; Configuration Examples:
141
;;    ENC_ENTRY  1,  0,  MIOS_ENC_MODE_NON_DETENTED    ; non-detented encoder at pin 0 and 1 of SR 1
142
;;    ENC_ENTRY  1,  2,  MIOS_ENC_MODE_DETENTED        ; detented encoder at pin 2 and 3 of SR 1
143
;;    ENC_ENTRY  9,  6,  MIOS_ENC_MODE_NON_DETENTED    ; non-detented encoder at pin 6 and 7 of SR 9
144
;; --------------------------------------------------------------------------
145
 
208 tk 146
    org 0x3280      ; never change the origin!
111 tk 147
 
148
    ;; encoder entry structure
149
ENC_ENTRY MACRO sr, din_0, mode
150
    dw  (mode << 8) | (din_0 + 8*(sr-1))
151
    ENDM   
152
ENC_EOT MACRO
153
    dw  0xffff
154
    ENDM
155
 
156
MIOS_ENC_PIN_TABLE
157
    ;; encoders 1-16
158
    ;;        SR  Pin  Mode
159
#if CS_MENU_USE_INCDEC_BUTTONS
160
    ENC_EOT
161
#else
1072 tk 162
    ENC_ENTRY  1,  0,  MIOS_ENC_MODE_DETENTED3  ; menu encoder
111 tk 163
#endif
164
 
165
    ;; additional CS encoders
166
    ;;        SR  Pin  Mode
1072 tk 167
    ENC_ENTRY  3,  2,  MIOS_ENC_MODE_DETENTED3  ; Multipurpose Enc #1
168
    ENC_ENTRY  3,  4,  MIOS_ENC_MODE_DETENTED3  ; Multipurpose Enc #2
169
    ENC_ENTRY  3,  6,  MIOS_ENC_MODE_DETENTED3  ; Multipurpose Enc #3
170
    ENC_ENTRY  4,  0,  MIOS_ENC_MODE_DETENTED3  ; Multipurpose Enc #4
111 tk 171
 
172
    ENC_EOT
173
 
174
    ;; encoders 17-32
175
    ENC_EOT
176
    ENC_EOT
177
    ENC_EOT
178
    ENC_EOT
179
    ENC_EOT
180
    ENC_EOT
181
    ENC_EOT
182
    ENC_EOT
183
    ENC_EOT
184
    ENC_EOT
185
    ENC_EOT
186
    ENC_EOT
187
    ENC_EOT
188
    ENC_EOT
189
    ENC_EOT
190
    ENC_EOT
191
 
192
    ;; encoders 33-48
193
    ENC_EOT
194
    ENC_EOT
195
    ENC_EOT
196
    ENC_EOT
197
    ENC_EOT
198
    ENC_EOT
199
    ENC_EOT
200
    ENC_EOT
201
    ENC_EOT
202
    ENC_EOT
203
    ENC_EOT
204
    ENC_EOT
205
    ENC_EOT
206
    ENC_EOT
207
    ENC_EOT
208
    ENC_EOT
209
 
210
    ;; encoders 49-64
211
    ENC_EOT
212
    ENC_EOT
213
    ENC_EOT
214
    ENC_EOT
215
    ENC_EOT
216
    ENC_EOT
217
    ENC_EOT
218
    ENC_EOT
219
    ENC_EOT
220
    ENC_EOT
221
    ENC_EOT
222
    ENC_EOT
223
    ENC_EOT
224
    ENC_EOT
225
    ENC_EOT
226
    ENC_EOT
227
 
228
 
229
#include "src/main.inc"