MPASM 5.41 MIDIPULSE.ASM 11-18-2015 9:43:26 PAGE 1 LOC OBJECT CODE LINE SOURCE TEXT VALUE 00001 00002 ; Specs: 00003 ; 00004 ; - midi input (31250 bps) 00005 ; - 8 pulse outputs, pulse duration controlled by note-on velocity 00006 ; - 16 bit pulse counter resolution, full velocity->duration lookup table 00007 ; per output 00008 ; - pulse counter clock: 25us (?) 00009 ; - 100% deterministic pulse duration 00010 ; - 8 hold outputs 00011 00012 ;============================================================================= 00013 ; Filename: midima.asm 00014 ;============================================================================= 00015 ; Author: Johannes Taelman 00016 ; Company: Johannes Taelman 00017 ; Revision: 1.00 00018 ; Date: May 2005 00019 ;============================================================================= 00020 ; Include Files: p18f252.inc V1.3 00021 ;============================================================================= 00022 00023 00024 list p=18f2525 ;list directive to define processor 00025 #include ;processor specific definitions 00001 LIST 00002 00003 ;========================================================================== 00004 ; MPASM PIC18F2525 processor include 00005 ; 00006 ; (c) Copyright 1999-2011 Microchip Technology, All rights reserved 00007 ;========================================================================== 00008 01291 LIST 00026 ; #include ;processor specific definitions 00027 #include "midi.asm" 00001 ;---------------------------------------------------------------------------- 00002 ;Constants 00003 0000004F 00004 SPBRG_VAL EQU 04Fh ;set baud rate 31250 for 40Mhz clock 00005 00000010 00006 TX_BUF_LEN EQU 010h ;length of transmit circular buffer 00000010 00007 RX_BUF_LEN EQU TX_BUF_LEN ;length of receive circular buffer 00008 00009 ;---------------------------------------------------------------------------- 00010 ;Bit Definitions 00011 00000000 00012 TxBufFull EQU 0 ;bit indicates Tx buffer is full 00000001 00013 TxBufEmpty EQU 1 ;bit indicates Tx buffer is empty 00000002 00014 RxBufFull EQU 2 ;bit indicates Rx buffer is full 00000003 00015 RxBufEmpty EQU 3 ;bit indicates Rx buffer is empty 00016 00017 CBLOCK 0x010 MPASM 5.41 MIDIPULSE.ASM 11-18-2015 9:43:26 PAGE 2 LOC OBJECT CODE LINE SOURCE TEXT VALUE 00000010 00018 MidiInByte ; Rcv'd Byte 00000011 00019 MidiByte0 ; status 00000012 00020 MidiByte1 ; data1 00000013 00021 MidiByte2 ; data2 00000014 00022 MidiCurData ; current data byte index 00000015 00023 MidiNumData ; expected data bytes 00000016 00024 MidiTestByte ; for testing only 00025 ENDC 00026 00027 CBLOCK 0x50 ; 00000050 00028 Flags ;byte for indicator flag bits 00000051 00029 TempData ;temporary data in main routines 00000052 00030 TempRxData ;temporary data in Rx buffer routines 00000053 00031 TempTxData ;temporary data in Tx buffer routines 00000054 00032 TxStartPtrH ;pointer to start of data in Tx buffer 00000055 00033 TxStartPtrL ;pointer to start of data in Tx buffer 00000056 00034 TxEndPtrH ;pointer to end of data in Tx buffer 00000057 00035 TxEndPtrL ;pointer to end of data in Tx buffer 00000058 00036 RxStartPtrH ;pointer to start of data in Rx buffer 00000059 00037 RxStartPtrL ;pointer to start of data in Rx buffer 0000005A 00038 RxEndPtrH ;pointer to end of data in Rx buffer 0000005B 00039 RxEndPtrL ;pointer to end of data in Rx buffer 0000005C 00040 TxBuffer:TX_BUF_LEN ;Tx buffer for data to transmit 0000006C 00041 RxBuffer:RX_BUF_LEN ;Rx buffer for received data 00042 ENDC 00043 00044 00045 000050 00046 ORG 0x0050 ;place code after reset vector 00047 00048 ;------------------------------------ 00049 ;Read data from the transmit buffer and put into transmit register. 00050 000050 00051 PutData: 000050 A250 00052 btfss Flags,TxBufEmpty ;check if transmit buffer is empty 000052 D002 00053 bra PutDat1 ;if not then go transmit 000054 989D 00054 bcf PIE1,TXIE ;else disable Tx interrupt 000056 D0FC 00055 bra EndLowInt 00056 000058 00057 PutDat1: 000058 D881 00058 rcall GetTxBuffer ;get data from transmit buffer 00005A 6EAD 00059 movwf TXREG ;and transmit 00060 00061 ;------------------------------------ 00062 ;Get received data and write into receive buffer. 00063 00005C 00064 GetData: 00005C B2AB 00065 btfsc RCSTA,OERR ;if overrun error 00005E D007 00066 bra ErrOERR ;then go handle error 000060 B4AB 00067 btfsc RCSTA,FERR ;if framing error 000062 D00A 00068 bra ErrFERR ;then go handle error 000064 B450 00069 btfsc Flags,RxBufFull ;if buffer full 000066 D00E 00070 bra ErrRxOver ;then go handle error MPASM 5.41 MIDIPULSE.ASM 11-18-2015 9:43:26 PAGE 3 LOC OBJECT CODE LINE SOURCE TEXT VALUE 000068 50AE 00071 movf RCREG,W ;get received data 00006A D85B 00072 rcall PutRxBuffer ;and put in buffer 00006C D0F1 00073 bra EndLowInt 00074 00075 ;error because OERR overrun error bit is set 00076 ;can do special error handling here - this code simply clears and continues 00077 00006E 00078 ErrOERR: 00006E 98AB 00079 bcf RCSTA,CREN ;reset the receiver logic 000070 88AB 00080 bsf RCSTA,CREN ;enable reception again 000072 0EFA 00081 movlw 0xFA; ; MIDI RT Start 000074 D836 00082 rcall PutTxBuffer ;put data in transmit buffer 000076 D0EC 00083 bra EndLowInt 00084 00085 ;error because FERR framing error bit is set 00086 ;can do special error handling here - this code simply clears and continues 00087 000078 00088 ErrFERR: 000078 50AE 00089 movf RCREG,W ;discard received data that has error 00007A 98AB 00090 bcf RCSTA,CREN ;reset the receiver logic 00007C 88AB 00091 bsf RCSTA,CREN ;enable reception again 00007E 0EFB 00092 movlw 0xFB; ; MIDI RT Continue 000080 D830 00093 rcall PutTxBuffer ;put data in transmit buffer 000082 D0E6 00094 bra EndLowInt 00095 00096 ;error because receive buffer is full 00097 ;can do special error handling here - this code checks and discards the data 00098 000084 00099 ErrRxOver: 000084 50AE 00100 movf RCREG,W ;discard received data 000086 800B 00101 bsf OutsC,0; error LED 000088 0EFB 00102 movlw 0xFB; ; MIDI RT Start 00008A D82B 00103 rcall PutTxBuffer ;put data in transmit buffer 00008C D0E1 00104 bra EndLowInt 00105 00106 ;------------------------------------ 00107 ;End of high priority interrupt routine restores context. 00108 00008E 00109 EndHighInt: 00008E C006 FFE9 00110 movff FSR0L_SHADOW,FSR0L ;restore FSR0L register 000092 C005 FFEA 00111 movff FSR0H_SHADOW,FSR0H ;restore FSR0H register 000096 0011 00112 retfie FAST ;return and restore context 00113 00114 ;---------------------------------------------------------------------------- 00115 ;Set up serial port and buffers. 00116 000098 00117 SetupSerial: 000098 0EC0 00118 movlw 0xc0 ;set tris bits for Tx and RX 00009A 1294 00119 iorwf TRISC,F 00009C 0E4F 00120 movlw SPBRG_VAL ;set baud rate 00009E 6EAF 00121 movwf SPBRG 0000A0 0E24 00122 movlw 0x24 ;enable transmission and high baud rate 0000A2 6EAC 00123 movwf TXSTA MPASM 5.41 MIDIPULSE.ASM 11-18-2015 9:43:26 PAGE 4 LOC OBJECT CODE LINE SOURCE TEXT VALUE 0000A4 0E90 00124 movlw 0x90 ;enable serial port and reception 0000A6 6EAB 00125 movwf RCSTA 0000A8 6A50 00126 clrf Flags ;clear all flags 00127 0000AA D809 00128 rcall InitTxBuffer ;initialize transmit buffer 0000AC D811 00129 rcall InitRxBuffer ;initialize receive buffer 00130 0000AE 0E30 00131 movlw 0x30 ;enable Tx and Rx interrupts 0000B0 6E9D 00132 movwf PIE1 0000B2 0E00 00133 movlw 0x00 ;set Rx low and Tx low priority 0000B4 6E9F 00134 movwf IPR1 0000B6 8ED0 00135 bsf RCON,IPEN ;enable interrupt priorities 0000B8 0EC0 00136 movlw 0xc0 ;enable global high and low ints 0000BA 6EF2 00137 movwf INTCON 0000BC 0012 00138 return 00139 00140 ;---------------------------------------------------------------------------- 00141 ;Circular buffer routines. 00142 00143 ;---------------------------------------------------------------------------- 00144 ;Initialize transmit buffer. 00145 0000BE 00146 InitTxBuffer: 0000BE 0E00 00147 movlw HIGH TxBuffer ;take high address of transmit buffer 0000C0 6E54 00148 movwf TxStartPtrH ;and place in transmit start pointer 0000C2 6E56 00149 movwf TxEndPtrH ;and place in transmit end pointer 0000C4 0E5C 00150 movlw LOW TxBuffer ;take low address of transmit buffer 0000C6 6E55 00151 movwf TxStartPtrL ;and place in transmit start pointer 0000C8 6E57 00152 movwf TxEndPtrL ;and place in transmit end pointer 0000CA 9050 00153 bcf Flags,TxBufFull ;indicate Tx buffer is not full 0000CC 8250 00154 bsf Flags,TxBufEmpty ;indicate Tx buffer is empty 0000CE 0012 00155 return 00156 00157 ;---------------------------------------------- 00158 ;Initialize receive buffer. 00159 0000D0 00160 InitRxBuffer: 0000D0 0E00 00161 movlw HIGH RxBuffer ;take high address of receive buffer 0000D2 6E58 00162 movwf RxStartPtrH ;and place in receive start pointer 0000D4 6E5A 00163 movwf RxEndPtrH ;and place in receive end pointer 0000D6 0E6C 00164 movlw LOW RxBuffer ;take low address of receive buffer 0000D8 6E59 00165 movwf RxStartPtrL ;and place in receive start pointer 0000DA 6E5B 00166 movwf RxEndPtrL ;and place in receive end pointer 0000DC 9450 00167 bcf Flags,RxBufFull ;indicate Rx buffer is not full 0000DE 8650 00168 bsf Flags,RxBufEmpty ;indicate Rx buffer is empty 0000E0 0012 00169 return 00170 00171 ;---------------------------------------------------------------------------- 00172 ;Add a byte (in WREG) to the end of the transmit buffer. 00173 0000E2 00174 PutTxBuffer: 0000E2 989D 00175 bcf PIE1,TXIE ;disable Tx interrupt to avoid conflict 0000E4 B050 00176 btfsc Flags,TxBufFull ;check if transmit buffer full MPASM 5.41 MIDIPULSE.ASM 11-18-2015 9:43:26 PAGE 5 LOC OBJECT CODE LINE SOURCE TEXT VALUE 0000E6 D01B 00177 bra ErrTxBufFull ;go handle error if full 0000E8 C056 FFEA 00178 movff TxEndPtrH,FSR0H ;put EndPointer into FSR0 0000EC C057 FFE9 00179 movff TxEndPtrL,FSR0L ;put EndPointer into FSR0 0000F0 6EEE 00180 movwf POSTINC0 ;copy data to buffer 00181 ;test if buffer pointer needs to wrap around to beginning of buffer memory 0000F2 0E00 00182 movlw HIGH (TxBuffer+TX_BUF_LEN) ;get last address of buffer 0000F4 62EA 00183 cpfseq FSR0H ;and compare with end pointer 0000F6 D005 00184 bra PutTxBuf1 ;skip low bytes if high bytes not equal 0000F8 0E6C 00185 movlw LOW (TxBuffer+TX_BUF_LEN) ;get last address of buffer 0000FA 62E9 00186 cpfseq FSR0L ;and compare with end pointer 0000FC D002 00187 bra PutTxBuf1 ;go save new pointer if at end 0000FE EE00 F05C 00188 lfsr 0,TxBuffer ;point to beginning of buffer if at end 000102 00189 PutTxBuf1: 000102 CFEA F056 00190 movff FSR0H,TxEndPtrH ;save new EndPointer high byte 000106 CFE9 F057 00191 movff FSR0L,TxEndPtrL ;save new EndPointer low byte 00192 00193 ;test if buffer is full 00194 00010A 5054 00195 movf TxStartPtrH,W ;get start pointer 00010C 6256 00196 cpfseq TxEndPtrH ;and compare with end pointer 00010E D004 00197 bra PutTxBuf2 ;skip low bytes if high bytes not equal 000110 5055 00198 movf TxStartPtrL,W ;get start pointer 000112 6257 00199 cpfseq TxEndPtrL ;and compare with end pointer 000114 D001 00200 bra PutTxBuf2 000116 8050 00201 bsf Flags,TxBufFull ;if same then indicate buffer full 00202 000118 00203 PutTxBuf2: 000118 9250 00204 bcf Flags,TxBufEmpty ;Tx buffer cannot be empty 00011A 889D 00205 bsf PIE1,TXIE ;enable transmit interrupt 00011C 0012 00206 return 00207 00208 ;error because attempting to store new data and the buffer is full 00209 ;can do special error handling here - this code simply ignores the byte 00210 00011E 00211 ErrTxBufFull: 00011E 889D 00212 bsf PIE1,TXIE ;enable transmit interrupt 000120 0012 00213 return ;no save of data because buffer is full 00214 00215 ;---------------------------------------------- 00216 ;Add a byte (in WREG) to the end of the receive buffer. 00217 000122 00218 PutRxBuffer: 000122 B450 00219 btfsc Flags,RxBufFull ;check if receive buffer full 000124 D01A 00220 bra ErrRxBufFull ;go handle error if full 00221 000126 C05A FFEA 00222 movff RxEndPtrH,FSR0H ;put EndPointer into FSR0 00012A C05B FFE9 00223 movff RxEndPtrL,FSR0L ;put EndPointer into FSR0 00012E 6EEE 00224 movwf POSTINC0 ;copy data to buffer 00225 00226 ;test if buffer pointer needs to wrap around to beginning of buffer memory 00227 000130 0E00 00228 movlw HIGH (RxBuffer+RX_BUF_LEN) ;get last address of buffer 000132 62EA 00229 cpfseq FSR0H ;and compare with end pointer MPASM 5.41 MIDIPULSE.ASM 11-18-2015 9:43:26 PAGE 6 LOC OBJECT CODE LINE SOURCE TEXT VALUE 000134 D005 00230 bra PutRxBuf1 ;skip low bytes if high bytes not equal 000136 0E7C 00231 movlw LOW (RxBuffer+RX_BUF_LEN) ;get last address of buffer 000138 62E9 00232 cpfseq FSR0L ;and compare with end pointer 00013A D002 00233 bra PutRxBuf1 ;go save new pointer if not at end 00013C EE00 F06C 00234 lfsr 0,RxBuffer ;point to beginning of buffer if at end 00235 000140 00236 PutRxBuf1: 000140 CFEA F05A 00237 movff FSR0H,RxEndPtrH ;save new EndPointer high byte 000144 CFE9 F05B 00238 movff FSR0L,RxEndPtrL ;save new EndPointer low byte 00239 ;test if buffer is full 000148 5058 00240 movf RxStartPtrH,W ;get start pointer 00014A 625A 00241 cpfseq RxEndPtrH ;and compare with end pointer 00014C D004 00242 bra PutRxBuf2 ;skip low bytes if high bytes not equal 00014E 5059 00243 movf RxStartPtrL,W ;get start pointer 000150 625B 00244 cpfseq RxEndPtrL ;and compare with end pointer 000152 D001 00245 bra PutRxBuf2 000154 8450 00246 bsf Flags,RxBufFull ;if same then indicate buffer full 00247 000156 00248 PutRxBuf2: 000156 9650 00249 bcf Flags,RxBufEmpty ;Rx buffer cannot be empty 000158 0012 00250 return 00251 00252 ;error because attempting to store new data and the buffer is full 00253 ;can do special error handling here - this code simply ignores the byte 00254 00015A 00255 ErrRxBufFull: 00015A 0012 00256 return ;no save of data because buffer is full 00257 00258 ;---------------------------------------------- 00259 ;Remove and return (in WREG) the byte at the start of the transmit buffer. 00260 00015C 00261 GetTxBuffer: 00015C B250 00262 btfsc Flags,TxBufEmpty ;check if transmit buffer empty 00015E D01C 00263 bra ErrTxBufEmpty ;go handle error if empty 00264 000160 C054 FFEA 00265 movff TxStartPtrH,FSR0H ;put StartPointer into FSR0 000164 C055 FFE9 00266 movff TxStartPtrL,FSR0L ;put StartPointer into FSR0 000168 CFEE F053 00267 movff POSTINC0,TempTxData ;save data from buffer 00268 00269 ;test if buffer pointer needs to wrap around to beginning of buffer memory 00270 00016C 0E00 00271 movlw HIGH (TxBuffer+TX_BUF_LEN) ;get last address of buffer 00016E 62EA 00272 cpfseq FSR0H ;and compare with start pointer 000170 D005 00273 bra GetTxBuf1 ;skip low bytes if high bytes not equal 000172 0E6C 00274 movlw LOW (TxBuffer+TX_BUF_LEN) ;get last address of buffer 000174 62E9 00275 cpfseq FSR0L ;and compare with start pointer 000176 D002 00276 bra GetTxBuf1 ;go save new pointer if at end 000178 EE00 F05C 00277 lfsr 0,TxBuffer ;point to beginning of buffer if at end 00278 00017C 00279 GetTxBuf1: 00017C CFEA F054 00280 movff FSR0H,TxStartPtrH ;save new StartPointer value 000180 CFE9 F055 00281 movff FSR0L,TxStartPtrL ;save new StartPointer value 00282 MPASM 5.41 MIDIPULSE.ASM 11-18-2015 9:43:26 PAGE 7 LOC OBJECT CODE LINE SOURCE TEXT VALUE 00283 ;test if buffer is now empty 00284 000184 5056 00285 movf TxEndPtrH,W ;get end pointer 000186 6254 00286 cpfseq TxStartPtrH ;and compare with start pointer 000188 D004 00287 bra GetTxBuf2 ;skip low bytes if high bytes not equal 00018A 5057 00288 movf TxEndPtrL,W ;get end pointer 00018C 6255 00289 cpfseq TxStartPtrL ;and compare with start pointer 00018E D001 00290 bra GetTxBuf2 000190 8250 00291 bsf Flags,TxBufEmpty ;if same then indicate buffer empty 00292 000192 00293 GetTxBuf2: 000192 9050 00294 bcf Flags,TxBufFull ;Tx buffer cannot be full 000194 5053 00295 movf TempTxData,W ;restore data from buffer 000196 0012 00296 return 00297 00298 ;error because attempting to read data from an empty buffer 00299 ;can do special error handling here - this code simply returns zero 00300 000198 00301 ErrTxBufEmpty: 000198 0C00 00302 retlw 0 ;buffer empty, return zero 00303 00304 ;---------------------------------------------- 00305 ;Remove and return (in WREG) the byte at the start of the receive buffer. 00306 00019A 00307 GetRxBuffer: 00019A 9A9D 00308 bcf PIE1,RCIE ;disable Rx interrupt to avoid conflict 00019C B650 00309 btfsc Flags,RxBufEmpty ;check if receive buffer empty 00019E D01D 00310 bra ErrRxBufEmpty ;go handle error if empty 00311 0001A0 C058 FFEA 00312 movff RxStartPtrH,FSR0H ;put StartPointer into FSR0 0001A4 C059 FFE9 00313 movff RxStartPtrL,FSR0L ;put StartPointer into FSR0 0001A8 CFEE F052 00314 movff POSTINC0,TempRxData ;save data from buffer 00315 00316 ;test if buffer pointer needs to wrap around to beginning of buffer memory 00317 0001AC 0E00 00318 movlw HIGH (RxBuffer+RX_BUF_LEN) ;get last address of buffer 0001AE 62EA 00319 cpfseq FSR0H ;and compare with start pointer 0001B0 D005 00320 bra GetRxBuf1 ;skip low bytes if high bytes not equal 0001B2 0E7C 00321 movlw LOW (RxBuffer+RX_BUF_LEN) ;get last address of buffer 0001B4 62E9 00322 cpfseq FSR0L ;and compare with start pointer 0001B6 D002 00323 bra GetRxBuf1 ;go save new pointer if at end 0001B8 EE00 F06C 00324 lfsr 0,RxBuffer ;point to beginning of buffer if at end 00325 0001BC 00326 GetRxBuf1: 0001BC CFEA F058 00327 movff FSR0H,RxStartPtrH ;save new StartPointer value 0001C0 CFE9 F059 00328 movff FSR0L,RxStartPtrL ;save new StartPointer value 00329 00330 ;test if buffer is now empty 00331 0001C4 505A 00332 movf RxEndPtrH,W ;get end pointer 0001C6 6258 00333 cpfseq RxStartPtrH ;and compare with start pointer 0001C8 D004 00334 bra GetRxBuf2 ;skip low bytes if high bytes not equal 0001CA 505B 00335 movf RxEndPtrL,W ;get end pointer MPASM 5.41 MIDIPULSE.ASM 11-18-2015 9:43:26 PAGE 8 LOC OBJECT CODE LINE SOURCE TEXT VALUE 0001CC 6259 00336 cpfseq RxStartPtrL ; and compare with start pointer 0001CE D001 00337 bra GetRxBuf2 0001D0 8650 00338 bsf Flags,RxBufEmpty ;if same then indicate buffer empty 00339 0001D2 00340 GetRxBuf2: 0001D2 9450 00341 bcf Flags,RxBufFull ;Rx buffer cannot be full 0001D4 5052 00342 movf TempRxData,W ;restore data from buffer 0001D6 8A9D 00343 bsf PIE1,RCIE ;enable receive interrupt 0001D8 0012 00344 return 00345 00346 ;error because attempting to read data from an empty buffer 00347 ;can do special error handling here - this code simply returns zero 00348 0001DA 00349 ErrRxBufEmpty: 0001DA 8A9D 00350 bsf PIE1,RCIE ;enable receive interrupt 0001DC 0C00 00351 retlw 0 ;buffer empty, return zero 00352 00353 ;---------------------------------------------------------------------------- 00354 ;Move data from receive buffer to transmit buffer to echo the line back. 00355 0001DE 00356 CopyRxToTx: 0001DE 00357 Copy1: 0001DE B650 00358 btfsc Flags,RxBufEmpty ;check if Rx buffer is empty 0001E0 0012 00359 return ;if so then return 0001E2 DFDB 00360 rcall GetRxBuffer ;get data from receive buffer 0001E4 DF7E 00361 rcall PutTxBuffer ;put data in transmit buffer 0001E6 D7FB 00362 bra Copy1 0001E8 0012 00363 return 00364 00365 ;---------------------------------------------------------------------------- 00366 ; MIDI Input parser 00367 ; 00368 ; pseudocode: 00369 ; 00370 ; MidiInParser: 00371 ; if (inByte & 0x80) 00372 ; MidiStatus = inByte 00373 ; goto MidiInStatus 00374 ; else 00375 ; goto MidiInData 00376 ; return 00377 ; 00378 ; MidiInStatus: 00379 ; Look up # databytes 00380 ; 1000xxxx -> 2 (noteOn) 00381 ; 1001xxxx -> 2 (noteOff) 00382 ; 1010xxxx -> 2 (polyKeyPr) 00383 ; 1011xxxx -> 2 (ctrlChange) 00384 ; 1100xxxx -> 1 (pgmChg 00385 ; 1101xxxx -> 1 (chnlPr) 00386 ; 1110xxxx -> 0 (System Common Messages -> ignore) 00387 ; 1111xxxx -> 0 (SysEx) 00388 ; MPASM 5.41 MIDIPULSE.ASM 11-18-2015 9:43:26 PAGE 9 LOC OBJECT CODE LINE SOURCE TEXT VALUE 00389 ; store in MidiNumData 00390 ; MidiCurDataBytes=0 00391 ; return 00392 ; 00393 ; MidiInData: 00394 ; If (MidiCurData==0) 00395 ; MidiData1=inByte 00396 ; If (MidiCurData==1) 00397 ; MidiData2=inByte 00398 ; MidiCurData++; 00399 ; 00400 ; If (MidiCurData==MidiNumData) 00401 ; { 00402 ; If (MidiStatus==NoteOn + channel) 00403 ; ... 00404 ; 00405 ; If (MidiStatus==NoteOff + channel) 00406 ; } ... 00407 ; 00408 0001EA 00409 PollMidiIn: 0001EA B650 00410 btfsc Flags,RxBufEmpty ;check if Rx buffer is empty 0001EC 0012 00411 return ;if so then return 0001EE DFD5 00412 rcall GetRxBuffer ;get data from receive buffer 0001F0 00413 MidiInParser: 0001F0 6E10 00414 movwf MidiInByte; 00415 ; rcall PutTxBuffer; MIDI thru for test purposes 00416 ; return 0001F2 5010 00417 movf MidiInByte,W; 0001F4 AE10 00418 btfss MidiInByte,7; 0001F6 D00B 00419 bra MidiInData; ; jump if it wasn't a status byte 0001F8 6E11 00420 movwf MidiByte0; 0001FA 00421 MidiInStatus: 0001FA 6A14 00422 clrf MidiCurData; 0001FC AC11 00423 btfss MidiByte0,6; 0001FE D004 00424 bra MidiInStatus2words; 000200 AA11 00425 btfss MidiByte0,5; 000202 0E01 00426 movlw 1; 000204 6E15 00427 movwf MidiNumData; 000206 0012 00428 return 000208 00429 MidiInStatus2words: 000208 0E02 00430 movlw 2; 00020A 6E15 00431 movwf MidiNumData; 00020C 00432 MidiInStatusEnd: 00020C 0012 00433 return 00434 00020E 00435 MidiInData: 00020E 6614 00436 tstfsz MidiCurData; 000210 D001 00437 bra MidiInDataM2; 000212 D004 00438 bra MidiInDataM1; 000214 00439 MidiInDataM2: 00440 ; 2nd byte 000214 C010 F013 00441 movff MidiInByte,MidiByte2; MPASM 5.41 MIDIPULSE.ASM 11-18-2015 9:43:26 PAGE 10 LOC OBJECT CODE LINE SOURCE TEXT VALUE 000218 6A14 00442 clrf MidiCurData; 00021A D008 00443 bra MidiInAction2Bytes; 00021C 00444 MidiInDataM1: 00021C C010 F012 00445 movff MidiInByte,MidiByte1; 000220 2A14 00446 incf MidiCurData; 000222 5014 00447 movf MidiCurData,W; 000224 5C15 00448 subwf MidiNumData,W; 000226 E001 00449 bz MidiInAction1Byte; 000228 0012 00450 return; 00451 00022A 00452 MidiInAction1Byte: 00022A 0012 00453 return; 00454 00022C 00455 MidiInAction2Bytes: Error[113] : Symbol not previously defined (MidiChannel) 00022C 0E90 00456 movlw 090h + MidiChannel; noteOn 00022E 5C11 00457 subwf MidiByte0,0; 000230 E007 00458 bz MidiInNoteOn1; Error[113] : Symbol not previously defined (MidiChannel) 000232 0E80 00459 movlw 080h + MidiChannel; noteOff 000234 5C11 00460 subwf MidiByte0,0; 000236 E005 00461 bz MidiInNoteOff1; Error[113] : Symbol not previously defined (MidiChannel) 000238 0EB0 00462 movlw 0B0h + MidiChannel; CtrlChange 00023A 5C11 00463 subwf MidiByte0,0; 00023C E003 00464 bz MidiInCtrlChange1; 00023E 0012 00465 return; 00466 00467 ; proxies for a far jump 000240 00468 MidiInNoteOn1: 000240 D0C5 00469 bra MidiInNoteOn 00470 000242 00471 MidiInNoteOff1: 000242 D0EC 00472 bra MidiInNoteOff 00473 000244 00474 MidiInCtrlChange1: 000244 D0ED 00475 bra MidiInCtrlChange 00028 00029 ; #define simulate 1 ; enable simulation 00030 ; #define heartbeat 1 ; enable heatbeats 00031 ;****************************************************************************** 00032 ;Configuration bits 00033 ; The __CONFIG directive defines configuration data within the .ASM file. 00034 ; The labels following the directive are defined in the P18F252.INC file. 00035 ; The PIC18FXX2 Data Sheet explains the functions of the configuration bits. 00036 ; Change the following lines to suit your application. 00037 Warning[230]: __CONFIG has been deprecated for PIC18 devices. Use directive CONFIG. Error[113] : Symbol not previously defined (_OSCS_OFF_1H) Error[113] : Symbol not previously defined (_HSPLL_OSC_1H) 300000 00FF 00038 __CONFIG _CONFIG1H, _OSCS_OFF_1H & _HSPLL_OSC_1H Warning[230]: __CONFIG has been deprecated for PIC18 devices. Use directive CONFIG. Error[113] : Symbol not previously defined (_BOR_ON_2L) MPASM 5.41 MIDIPULSE.ASM 11-18-2015 9:43:26 PAGE 11 LOC OBJECT CODE LINE SOURCE TEXT VALUE 00039 __CONFIG _CONFIG2L, _BOR_ON_2L & _PWRT_ON_2L Warning[230]: __CONFIG has been deprecated for PIC18 devices. Use directive CONFIG. 300002 FE00 00040 __CONFIG _CONFIG2H, _WDT_OFF_2H Warning[230]: __CONFIG has been deprecated for PIC18 devices. Use directive CONFIG. Error[113] : Symbol not previously defined (_CCP2MX_OFF_3H) 300004 00FF 00041 __CONFIG _CONFIG3H, _CCP2MX_OFF_3H Warning[230]: __CONFIG has been deprecated for PIC18 devices. Use directive CONFIG. Error[113] : Symbol not previously defined (_STVR_OFF_4L) 300006 FF00 00042 __CONFIG _CONFIG4L, _STVR_OFF_4L & _LVP_OFF_4L & _DEBUG_OFF_4L Warning[230]: __CONFIG has been deprecated for PIC18 devices. Use directive CONFIG. Error[113] : Symbol not previously defined (_CP3_OFF_5L) 00043 __CONFIG _CONFIG5L, _CP0_OFF_5L & _CP1_OFF_5L & _CP2_OFF_5L & _CP3_OFF_5L Warning[230]: __CONFIG has been deprecated for PIC18 devices. Use directive CONFIG. 300008 FF00 00044 __CONFIG _CONFIG5H, _CPB_OFF_5H & _CPD_OFF_5H Warning[230]: __CONFIG has been deprecated for PIC18 devices. Use directive CONFIG. Error[113] : Symbol not previously defined (_WRT3_OFF_6L) 00045 __CONFIG _CONFIG6L, _WRT0_OFF_6L & _WRT1_OFF_6L & _WRT2_OFF_6L & _WRT3_OFF_6L Warning[230]: __CONFIG has been deprecated for PIC18 devices. Use directive CONFIG. 30000A FF00 00046 __CONFIG _CONFIG6H, _WRTC_OFF_6H & _WRTB_OFF_6H & _WRTD_OFF_6H Warning[230]: __CONFIG has been deprecated for PIC18 devices. Use directive CONFIG. Error[113] : Symbol not previously defined (_EBTR3_OFF_7L) 00047 __CONFIG _CONFIG7L, _EBTR0_OFF_7L & _EBTR1_OFF_7L & _EBTR2_OFF_7L & _EBTR3_OFF_7L Warning[230]: __CONFIG has been deprecated for PIC18 devices. Use directive CONFIG. 30000C FF00 00048 __CONFIG _CONFIG7H, _EBTRB_OFF_7H 00049 00050 00051 00052 #define Timer1Out OutsA, 2; 00053 #define Timer2Out OutsA, 1; 00054 #define Timer3Out OutsA, 0; 00055 #define Timer4Out OutsA, 3; 00056 #define Timer5Out OutsA, 4; 00057 #define Timer6Out OutsA, 5; 00058 #define Timer7Out OutsB, 7; 00059 #define Timer8Out OutsB, 6; 00060 #define Timer9Out OutsB, 5; 00061 #define Timer10Out OutsB, 4; 00062 #define Timer11Out OutsB, 3; 00063 #define Timer12Out OutsB, 2; 00064 #define Timer13Out OutsB, 1; 00065 #define Timer14Out OutsB, 0; 00066 #define Timer15Out OutsC, 5; 00067 #define Timer16Out OutsC, 4; 00068 00069 ;---------------------------------------------------------------------------- 00070 ; Variables 00071 ; memory map 00072 ;---------------------------------------------------------------------------- 00073 00074 CBLOCK 0x000 00000000 00075 WREG_TEMP ;to save WREG during interrupt 00000001 00076 STATUS_TEMP ;to save STATUS during interrupt 00000002 00077 BSR_TEMP ;to save BSR during interrupt MPASM 5.41 MIDIPULSE.ASM 11-18-2015 9:43:26 PAGE 12 LOC OBJECT CODE LINE SOURCE TEXT VALUE 00000003 00078 FSR0H_TEMP ;to save FSR0H during interrupt 00000004 00079 FSR0L_TEMP ;to save FSR0L during interrupt 00000005 00080 FSR0H_SHADOW ;to save FSR0H during high interrupt 00000006 00081 FSR0L_SHADOW ;to save FSR0L during high interrupt 00000007 00082 TmpM ; non-ISR scratch 00000008 00083 TmpT ; non-ISR scratch 00000009 00084 OutsA ; output port A internal states 0000000A 00085 OutsB ; output port B internal states 0000000B 00086 OutsC ; output port C internal states 00087 ENDC 00088 00089 CBLOCK 0x020 ; DO NOT MOVE THIS BLOCK 00000020 00090 Timer1Msb 00000021 00091 Timer1Lsb 00000022 00092 Timer2Msb 00000023 00093 Timer2Lsb 00000024 00094 Timer3Msb 00000025 00095 Timer3Lsb 00000026 00096 Timer4Msb 00000027 00097 Timer4Lsb 00000028 00098 Timer5Msb 00000029 00099 Timer5Lsb 0000002A 00100 Timer6Msb 0000002B 00101 Timer6Lsb 0000002C 00102 Timer7Msb 0000002D 00103 Timer7Lsb 0000002E 00104 Timer8Msb 0000002F 00105 Timer8Lsb 00000030 00106 Timer9Msb 00000031 00107 Timer9Lsb 00000032 00108 Timer10Msb 00000033 00109 Timer10Lsb 00000034 00110 Timer11Msb 00000035 00111 Timer11Lsb 00000036 00112 Timer12Msb 00000037 00113 Timer12Lsb 00000038 00114 Timer13Msb 00000039 00115 Timer13Lsb 0000003A 00116 Timer14Msb 0000003B 00117 Timer14Lsb 0000003C 00118 Timer15Msb 0000003D 00119 Timer15Lsb 0000003E 00120 Timer16Msb 0000003F 00121 Timer16Lsb 00122 ENDC 00123 00124 CBLOCK 0x0F2 ; NO NOT RELOCATE THIS BLOCK 000000F2 00125 CmdBuff0RdIndx 000000F3 00126 CmdBuff0WrIndx 000000F4 00127 CmdBuff0Timer 000000F5 00128 CmdBuff0TimerValMSB 000000F6 00129 CmdBuff0TimerValLSB 000000F7 00130 CmdBuff1Timer MPASM 5.41 MIDIPULSE.ASM 11-18-2015 9:43:26 PAGE 13 LOC OBJECT CODE LINE SOURCE TEXT VALUE 000000F8 00131 CmdBuff1TimerValMSB 000000F9 00132 CmdBuff1TimerValLSB 000000FA 00133 CmdBuff2Timer 000000FB 00134 CmdBuff2TimerValMSB 000000FC 00135 CmdBuff2TimerValLSB 000000FD 00136 CmdBuff3Timer 000000FE 00137 CmdBuff3TimerValMSB 000000FF 00138 CmdBuff3TimerValLSB 00139 ENDC 00140 ; ... and incrementing this last adress wraps it to zero. 00141 ; don't change this property! 00142 00143 ;---------------------------------------------------------------------------- 00144 ; end of memory map 00145 ;---------------------------------------------------------------------------- 00146 00147 00148 ;---------------------------------------------------------------------------- 00149 ;This code executes when a reset occurs. 00150 000000 00151 ORG 0x0000 ;place code at reset vector 00152 000000 00153 ResetVector: 000000 D13B 00154 bra Main ;go to beginning of program 00155 00156 ;---------------------------------------------------------------------------- 00157 ;This code executes when a high priority interrupt occurs. 00158 000008 00159 ORG 0x0008 00160 000008 00161 HighInt: 000008 D12E 00162 bra HighIntCode ;go to high priority interrupt routine 00163 00164 ;---------------------------------------------------------------------------- 00165 ;This code executes when a low priority interrupt occurs. 00166 000018 00167 ORG 0x0018 00168 000018 00169 LowInt: 000018 CFD8 F001 00170 movff STATUS,STATUS_TEMP ;save STATUS register 00001C CFE8 F000 00171 movff WREG,WREG_TEMP ;save working register 000020 CFE0 F002 00172 movff BSR,BSR_TEMP ;save BSR register 000024 CFEA F003 00173 movff FSR0H,FSR0H_TEMP ;save FSR0H register 000028 CFE9 F004 00174 movff FSR0L,FSR0L_TEMP ;save FSR0L register 00175 00176 ;test other interrupt flags here 00177 00002C AA9E 00178 btfss PIR1,RCIF ;test for RCIF receive interrupt flag 00002E D002 00179 bra LowInt1 ;if RCIF is not set, done with test 000030 BA9D 00180 btfsc PIE1,RCIE ;else test if Rx interrupt enabled 000032 D014 00181 bra GetData ;if so, go get received data 000034 00182 LowInt1: 000034 A89E 00183 btfss PIR1,TXIF ;test for TXIF transmit interrupt flag MPASM 5.41 MIDIPULSE.ASM 11-18-2015 9:43:26 PAGE 14 LOC OBJECT CODE LINE SOURCE TEXT VALUE 000036 D002 00184 bra LowInt2 ;if TXIF is not set, done with test 000038 B89D 00185 btfsc PIE1,TXIE ;else test if Tx interrupt is enabled 00003A D00A 00186 bra PutData ;if so, go transmit data 00187 00188 ;can do special error handling here - an unexpected interrupt occurred 00189 00003C 00190 LowInt2: 00003C 00FF 00191 reset ;error if no valid interrupt so reset 00192 000250 00193 ORG 0x0250 ;place code after midi code 00194 00195 00196 ;------------------------------------ 00197 ;End of low priority interrupt routine restores context. 00198 000250 00199 EndLowInt: 000250 C004 FFE9 00200 movff FSR0L_TEMP,FSR0L ;restore FSR0L register 000254 C003 FFEA 00201 movff FSR0H_TEMP,FSR0H ;restore FSR0H register 000258 C002 FFE0 00202 movff BSR_TEMP,BSR ;restore BSR register 00025C C000 FFE8 00203 movff WREG_TEMP,WREG ;restore working register 000260 C001 FFD8 00204 movff STATUS_TEMP,STATUS ;restore STATUS register 000264 0010 00205 retfie 00206 00207 ;---------------------------------------------------------------------------- 00208 ;High priority interrupt routine. 00209 000266 00210 HighIntCode: 000266 CFEA F005 00211 movff FSR0H,FSR0H_SHADOW ;save FSR0H register 00026A CFE9 F006 00212 movff FSR0L,FSR0L_SHADOW ;save FSR0L register 00213 ;test other interrupt flags here 00026E A2A1 00214 btfss PIR2,TMR3IF ;test for Timer3 receive interrupt flag 000270 D002 00215 bra HighInt1 ;if RCIF is not set, done with test 000272 B2A0 00216 btfsc PIE2,TMR3IE ;else test if Timer3 interrupt enabled 000274 D029 00217 bra Timer3ISR ;if so, go get received data 00218 ;can do special error handling here - an unexpected interrupt occurred 000276 00219 HighInt1: 000276 00FF 00220 reset ;error if no valid interrupt so reset 00221 00222 00223 ;---------------------------------------------------------------------------- 00224 ;Main routine checks for for reception of a and then calls a routine to 00225 ; move the data to transmit back. 00226 000278 00227 Main: 000278 6A89 00228 clrf LATA ; All outputs low 00027A 6A8A 00229 clrf LATB ; All outputs low 00027C 6A8B 00230 clrf LATC ; All outputs low 00027E 6A92 00231 clrf TRISA ; Config PORTA as all outputs 00232 #ifdef ICD 00233 movlw 0xE0 00234 movwf TRISB 00235 #else 000280 6A93 00236 clrf TRISB ; Config PORTB as all outputs MPASM 5.41 MIDIPULSE.ASM 11-18-2015 9:43:26 PAGE 15 LOC OBJECT CODE LINE SOURCE TEXT VALUE 00237 #endif 000282 0E80 00238 movlw 0x80 ; 000284 6E94 00239 movwf TRISC ; Config PORTC all outputs + tristate for serial rx 000286 0E07 00240 movlw 0x07 ; init adc 000288 6EC1 00241 movwf ADCON1 ; init adc 00028A 6AC2 00242 clrf ADCON0 ; poweroff adc 00028C 6A09 00243 clrf OutsA; 00028E 6A0A 00244 clrf OutsB; 000290 6A0B 00245 clrf OutsC; 00246 000292 9C8B 00247 bcf LATC,6 ; Light error LED on powerup 00248 ; Wait a second with ALoop and BLoop 000294 6807 00249 setf TmpM 000296 00250 BLoop1: 000296 0EFF 00251 movlw 0xff; 000298 00252 ALoop1: 000298 2EE8 00253 decfsz WREG; 00029A EF4C F001 00254 goto ALoop1 00029E 2E07 00255 decfsz TmpM; 0002A0 EF4B F001 00256 goto BLoop1 0002A4 8C8B 00257 bsf LATC,6 ; Been patient enough, dim error LED and start 00258 0002A6 0EF4 00259 movlw CmdBuff0Timer; 0002A8 6FF2 00260 movwf CmdBuff0RdIndx; 0002AA 6FF3 00261 movwf CmdBuff0WrIndx; 0002AC EE00 F000 00262 lfsr FSR0 ,0000h 0002B0 EE10 F000 00263 lfsr FSR1 ,0000h 0002B4 DEF1 00264 rcall SetupSerial ;set up serial port and buffers 0002B6 D803 00265 rcall SetupTimer3 00266 00267 ; movlw 0x90; 00268 ; movwf MidiByte0 00269 ; movlw 0x0F; 00270 ; movwf MidiByte1 00271 ; movlw 0x40; 00272 ; movwf MidiByte2 00273 00274 ;testloop: 00275 ; nop 00276 ; call MidiInNoteOn 00277 ; bra testloop 00278 0002B8 00279 MainLoop: 0002B8 ECF5 F000 00280 call PollMidiIn; 0002BC D7FD 00281 bra MainLoop ;go wait for more data 00282 00283 00284 ;---------------------------------------------------------------------------- 00285 ; Timer3 setup 00286 0002BE 00287 SetupTimer3: 0002BE 0E01 00288 movlw 0x01 0002C0 6EB1 00289 movwf T3CON ; timer3 on, other bits cleared MPASM 5.41 MIDIPULSE.ASM 11-18-2015 9:43:26 PAGE 16 LOC OBJECT CODE LINE SOURCE TEXT VALUE 0002C2 82A2 00290 bsf IPR2,1 ; timer3 = high priority interrupt 0002C4 82A0 00291 bsf PIE2,1 ; timer3 interrupt enable 0002C6 0012 00292 return 00293 00294 0002C8 00295 Timer3ISR: 0002C8 92A1 00296 bcf PIR2,TMR3IF ; clear interrupt flag 0002CA 0E50 00297 movlw 050h ;0x7F; 0xA0 0002CC 6EB2 00298 movwf TMR3L ; preset timer 0002CE 68B3 00299 setf TMR3H ; preset timer 0002D0 5009 00300 movf OutsA,0 0002D2 6E89 00301 movwf LATA; 0002D4 500A 00302 movf OutsB,0 0002D6 6E8A 00303 movwf LATB; 0002D8 500B 00304 movf OutsC,0 0002DA 6E8B 00305 movwf LATC; 0002DC 00306 ReadBuffer 0002DC 51F2 00307 movf CmdBuff0RdIndx, W; 0002DE 5DF3 00308 subwf CmdBuff0WrIndx, W ; result in w 0002E0 E014 00309 bz Timers; no new task on cmd queue 0002E2 C0F2 FFE9 00310 movff CmdBuff0RdIndx, FSR0L; 0002E6 6AEA 00311 clrf FSR0H 0002E8 0E03 00312 movlw 0x03; 0002EA 27F2 00313 addwf CmdBuff0RdIndx 0002EC E102 00314 bnz NoWrap; 0002EE 0EF4 00315 movlw CmdBuff0Timer; Wrap to start 0002F0 6FF2 00316 movwf CmdBuff0RdIndx; 0002F2 00317 NoWrap 0002F2 50EF 00318 movf INDF0,W; 0002F4 EC80 F002 00319 call SetPulse 0002F8 50EE 00320 movf POSTINC0, W; W = timer# 0002FA 0F10 00321 addlw 010h; 10h= half of startaddress of timers 0002FC 26E8 00322 addwf WREG; W = (0x10+timer# )* 2 0002FE 6EE1 00323 movwf FSR1L; 000300 6AE2 00324 clrf FSR1H; FSR1 points to timer values 000302 50EE 00325 movf POSTINC0, W; W = timer val msb 000304 6EE6 00326 movwf POSTINC1; 000306 50EE 00327 movf POSTINC0, W; W = timer val lsb 000308 6EE6 00328 movwf POSTINC1; 00329 00330 ;************************************************************ 00331 ; Timers 00332 ; !!! change to timer interrupt instead of idle loop !!! 00030A 00333 Timers 00030A 00334 Timer1 00030A 0621 00335 decf Timer1Lsb; 00030C E204 00336 bc Timer2 ; 00030E 0620 00337 decf Timer1Msb; 000310 E202 00338 bc Timer2 ; 000312 6821 00339 setf Timer1Lsb; 000314 9409 00340 bcf Timer1Out 000316 00341 Timer2 000316 0623 00342 decf Timer2Lsb; MPASM 5.41 MIDIPULSE.ASM 11-18-2015 9:43:26 PAGE 17 LOC OBJECT CODE LINE SOURCE TEXT VALUE 000318 E204 00343 bc Timer3 ; 00031A 0622 00344 decf Timer2Msb; 00031C E202 00345 bc Timer3 ; 00031E 6823 00346 setf Timer2Lsb; 000320 9209 00347 bcf Timer2Out 000322 00348 Timer3 000322 0625 00349 decf Timer3Lsb; 000324 E204 00350 bc Timer4 ; 000326 0624 00351 decf Timer3Msb; 000328 E202 00352 bc Timer4 ; 00032A 6825 00353 setf Timer3Lsb; 00032C 9009 00354 bcf Timer3Out 00032E 00355 Timer4 00032E 0627 00356 decf Timer4Lsb; 000330 E204 00357 bc Timer5 ; 000332 0626 00358 decf Timer4Msb; 000334 E202 00359 bc Timer5 ; 000336 6827 00360 setf Timer4Lsb; 000338 9609 00361 bcf Timer4Out 00033A 00362 Timer5 00033A 0629 00363 decf Timer5Lsb; 00033C E204 00364 bc Timer6 ; 00033E 0628 00365 decf Timer5Msb; 000340 E202 00366 bc Timer6 ; 000342 6829 00367 setf Timer5Lsb; 000344 9809 00368 bcf Timer5Out 000346 00369 Timer6 000346 062B 00370 decf Timer6Lsb; 000348 E204 00371 bc Timer7 ; 00034A 062A 00372 decf Timer6Msb; 00034C E202 00373 bc Timer7 ; 00034E 682B 00374 setf Timer6Lsb; 000350 9A09 00375 bcf Timer6Out 000352 00376 Timer7 000352 062D 00377 decf Timer7Lsb; 000354 E204 00378 bc Timer8 ; 000356 062C 00379 decf Timer7Msb; 000358 E202 00380 bc Timer8 ; 00035A 682D 00381 setf Timer7Lsb; 00035C 9E0A 00382 bcf Timer7Out 00035E 00383 Timer8 00035E 062F 00384 decf Timer8Lsb; 000360 E204 00385 bc Timer9 ; 000362 062E 00386 decf Timer8Msb; 000364 E202 00387 bc Timer9 ; 000366 682F 00388 setf Timer8Lsb; 000368 9C0A 00389 bcf Timer8Out 00036A 00390 Timer9 00036A 0631 00391 decf Timer9Lsb; 00036C E204 00392 bc Timer10 ; 00036E 0630 00393 decf Timer9Msb; 000370 E202 00394 bc Timer10 ; 000372 6831 00395 setf Timer9Lsb; MPASM 5.41 MIDIPULSE.ASM 11-18-2015 9:43:26 PAGE 18 LOC OBJECT CODE LINE SOURCE TEXT VALUE 000374 9A0A 00396 bcf Timer9Out 000376 00397 Timer10 000376 0633 00398 decf Timer10Lsb; 000378 E204 00399 bc Timer11 ; 00037A 0632 00400 decf Timer10Msb; 00037C E202 00401 bc Timer11 ; 00037E 6833 00402 setf Timer10Lsb; 000380 980A 00403 bcf Timer10Out 000382 00404 Timer11 000382 0635 00405 decf Timer11Lsb; 000384 E204 00406 bc Timer12 ; 000386 0634 00407 decf Timer11Msb; 000388 E202 00408 bc Timer12 ; 00038A 6835 00409 setf Timer11Lsb; 00038C 960A 00410 bcf Timer11Out 00038E 00411 Timer12 00038E 0637 00412 decf Timer12Lsb; 000390 E204 00413 bc Timer13 ; 000392 0636 00414 decf Timer12Msb; 000394 E202 00415 bc Timer13 ; 000396 6837 00416 setf Timer12Lsb; 000398 940A 00417 bcf Timer12Out 00039A 00418 Timer13 00039A 0639 00419 decf Timer13Lsb; 00039C E204 00420 bc Timer14 ; 00039E 0638 00421 decf Timer13Msb; 0003A0 E202 00422 bc Timer14 ; 0003A2 6839 00423 setf Timer13Lsb; 0003A4 920A 00424 bcf Timer13Out 0003A6 00425 Timer14 0003A6 063B 00426 decf Timer14Lsb; 0003A8 E204 00427 bc Timer15 ; 0003AA 063A 00428 decf Timer14Msb; 0003AC E202 00429 bc Timer15 ; 0003AE 683B 00430 setf Timer14Lsb; 0003B0 900A 00431 bcf Timer14Out 0003B2 00432 Timer15 0003B2 063D 00433 decf Timer15Lsb; 0003B4 E204 00434 bc Timer16 ; 0003B6 063C 00435 decf Timer15Msb; 0003B8 E202 00436 bc Timer16 ; 0003BA 683D 00437 setf Timer15Lsb; 0003BC 9A0B 00438 bcf Timer15Out 0003BE 00439 Timer16 0003BE 063F 00440 decf Timer16Lsb; 0003C0 E204 00441 bc Timer17 ; 0003C2 063E 00442 decf Timer16Msb; 0003C4 E202 00443 bc Timer17 ; 0003C6 683F 00444 setf Timer16Lsb; 0003C8 980B 00445 bcf Timer16Out 0003CA 00446 Timer17 0003CA D661 00447 bra EndHighInt ; resume 00448 MPASM 5.41 MIDIPULSE.ASM 11-18-2015 9:43:26 PAGE 19 LOC OBJECT CODE LINE SOURCE TEXT VALUE 00449 00450 0003CC 00451 MidiInNoteOn: 00452 ; return 00453 ; lookup timer #, read from table in PM:0Fvv 0003CC 5013 00454 movf MidiByte2,W; 0003CE E026 00455 bz MidiInNoteOffNoVelo; ; velocity=0 -> NOTE OFF 00456 ; check if note is in range 0003D0 5013 00457 movf MidiByte2,0; 0003D2 E024 00458 bz MidiInNoteOff; ; velocity=0 -> NOTE OFF 0003D4 0E0F 00459 movlw 0Fh; 0003D6 6EF7 00460 movwf TBLPTRH 0003D8 C012 FFF6 00461 MOVFF MidiByte1,TBLPTRL 0003DC 0008 00462 TBLRD* ; read into TABLAT 0003DE 50F5 00463 movf TABLAT,0 0003E0 E01C 00464 bz MidiInNoteOn2 ; 0003E2 04F5 00465 decf TABLAT,0 0003E4 6E08 00466 movwf TmpT ; TmpT = timer# 00467 ; add to cmd queue 0003E6 6AEA 00468 clrf FSR0H 0003E8 C0F3 FFE9 00469 movff CmdBuff0WrIndx, FSR0L; 0003EC 5008 00470 movf TmpT,W 0003EE 6EEE 00471 movwf POSTINC0; write timer # 00472 ; lookup velo -> timer val 0003F0 5013 00473 movf MidiByte2,W; 0003F2 2413 00474 addwf MidiByte2,W; 0003F4 6EF6 00475 movwf TBLPTRL; 0003F6 5008 00476 movf TmpT,0; 0003F8 0F10 00477 addlw 010h; 0003FA 6EF7 00478 movwf TBLPTRH 0003FC 0009 00479 TBLRD*+ ; 0003FE CFF5 F007 00480 movff TABLAT,TmpM 000402 0009 00481 TBLRD*+ ; 000404 50F5 00482 movf TABLAT,W 000406 6EEE 00483 movwf POSTINC0 ; write timer lsb 000408 5007 00484 movf TmpM,W; 00040A 6EEE 00485 movwf POSTINC0 ; write timer msb 00040C 50E9 00486 movf FSR0L,W; 00040E E002 00487 bz NoWrap2; corrected: was: bnz 000410 6FF3 00488 movwf CmdBuff0WrIndx; 000412 0012 00489 return 000414 00490 NoWrap2 000414 0EF4 00491 movlw CmdBuff0Timer; Wrap to start 000416 6FF3 00492 movwf CmdBuff0WrIndx; 000418 0012 00493 return 00494 00495 00041A 00496 MidiInNoteOn2: 00041A 0012 00497 return 00498 00499 00041C 00500 MidiInNoteOffNoVelo: 00041C 00501 MidiInNoteOff: MPASM 5.41 MIDIPULSE.ASM 11-18-2015 9:43:26 PAGE 20 LOC OBJECT CODE LINE SOURCE TEXT VALUE 00041C 0012 00502 return 00503 00041E 00504 MidiInNoteOff2: 00041E 0012 00505 return 00506 000420 00507 MidiInCtrlChange: 000420 0E7B 00508 movlw 0x7B; AllNotesOff 000422 5C12 00509 subwf MidiByte1,0; 000424 E001 00510 bz MidiInAllNotesOff; 000426 0012 00511 return 00512 000428 00513 MidiInAllNotesOff: 000428 6A09 00514 clrf OutsA 00042A 6A0A 00515 clrf OutsB 00042C 6A0B 00516 clrf OutsC 00042E 6A89 00517 clrf LATA 000430 6A8A 00518 clrf LATB 000432 6A8B 00519 clrf LATC 000434 0012 00520 return 00521 000500 00522 ORG 0x0500 00523 ; lookup using a computed goto 00524 ; cfr. PIC18fxx2 datasheet section 4.4 00525 ; possibly msb-lsb pc strangeness if this section would cross a code page 000500 00526 SetPulse: 000500 0D04 00527 mullw 0x04; 000502 50F9 00528 movf PCL,W 000504 50F3 00529 movf PRODL,W 000506 26F9 00530 addwf PCL 000508 00531 _sp1 000508 8409 00532 bsf Timer1Out 00050A 0012 00533 return 00050C 00534 _sp2 00050C 8209 00535 bsf Timer2Out 00050E 0012 00536 return 000510 00537 _sp3 000510 8009 00538 bsf Timer3Out 000512 0012 00539 return 000514 00540 _sp4 000514 8609 00541 bsf Timer4Out 000516 0012 00542 return 000518 00543 _sp5 000518 8809 00544 bsf Timer5Out 00051A 0012 00545 return 00051C 00546 _sp6 00051C 8A09 00547 bsf Timer6Out 00051E 0012 00548 return 000520 00549 _sp7 000520 8E0A 00550 bsf Timer7Out 000522 0012 00551 return 000524 00552 _sp8 000524 8C0A 00553 bsf Timer8Out 000526 0012 00554 return MPASM 5.41 MIDIPULSE.ASM 11-18-2015 9:43:26 PAGE 21 LOC OBJECT CODE LINE SOURCE TEXT VALUE 000528 00555 _sp9 000528 8A0A 00556 bsf Timer9Out 00052A 0012 00557 return 00052C 00558 _sp10 00052C 880A 00559 bsf Timer10Out 00052E 0012 00560 return 000530 00561 _sp11 000530 860A 00562 bsf Timer11Out 000532 0012 00563 return 000534 00564 _sp12 000534 840A 00565 bsf Timer12Out 000536 0012 00566 return 000538 00567 _sp13 000538 820A 00568 bsf Timer13Out 00053A 0012 00569 return 00053C 00570 _sp14 00053C 800A 00571 bsf Timer14Out 00053E 0012 00572 return 000540 00573 _sp15 000540 8A0B 00574 bsf Timer15Out 000542 0012 00575 return 000544 00576 _sp16 000544 880B 00577 bsf Timer16Out 000546 0012 00578 return Error[129] : Expected (END) MPASM 5.41 MIDIPULSE.ASM 11-18-2015 9:43:26 PAGE 22 SYMBOL TABLE LABEL VALUE A 00000000 ABDEN 00000000 ABDOVF 00000007 ACCESS 00000000 ACKDT 00000005 ACKEN 00000004 ACKSTAT 00000006 ACQT0 00000003 ACQT1 00000004 ACQT2 00000005 ADCON0 00000FC2 ADCON1 00000FC1 ADCON2 00000FC0 ADCS0 00000000 ADCS1 00000001 ADCS2 00000002 ADDEN 00000003 ADEN 00000003 ADFM 00000007 ADIE 00000006 ADIF 00000006 ADIP 00000006 ADON 00000000 ADRES 00000FC3 ADRESH 00000FC4 ADRESL 00000FC3 ALoop1 00000298 AN10 00000001 AN11 00000004 AN12 00000000 AN4 00000005 AN8 00000002 AN9 00000003 BANKED 00000001 BAUDCON 00000FB8 BAUDCTL 00000FB8 BCLIE 00000003 BCLIF 00000003 BCLIP 00000003 BF 00000000 BGST 00000005 BLoop1 00000296 BOR 00000000 BRG16 00000003 BRGH 00000002 BSR 00000FE0 BSR_TEMP 00000002 C 00000000 C1INV 00000004 C1OUT 00000006 C2INV 00000005 C2OUT 00000007 CCP1 00000002 MPASM 5.41 MIDIPULSE.ASM 11-18-2015 9:43:26 PAGE 23 SYMBOL TABLE LABEL VALUE CCP1CON 00000FBD CCP1IE 00000002 CCP1IF 00000002 CCP1IP 00000002 CCP1M0 00000000 CCP1M1 00000001 CCP1M2 00000002 CCP1M3 00000003 CCP1X 00000005 CCP1Y 00000004 CCP2CON 00000FBA CCP2IE 00000000 CCP2IF 00000000 CCP2IP 00000000 CCP2M0 00000000 CCP2M1 00000001 CCP2M2 00000002 CCP2M3 00000003 CCP2X 00000005 CCP2Y 00000004 CCP2_PORTB 00000003 CCP2_PORTC 00000001 CCPR1 00000FBE CCPR1H 00000FBF CCPR1L 00000FBE CCPR2 00000FBB CCPR2H 00000FBC CCPR2L 00000FBB CFGS 00000006 CHS0 00000002 CHS1 00000003 CHS2 00000004 CHS3 00000005 CIS 00000003 CK 00000006 CKE 00000006 CKP 00000004 CM0 00000000 CM1 00000001 CM2 00000002 CMCON 00000FB4 CMIE 00000006 CMIF 00000006 CMIP 00000006 CREN 00000004 CSRC 00000007 CVR0 00000000 CVR1 00000001 CVR2 00000002 CVR3 00000003 CVRCON 00000FB5 CVREN 00000007 CVROE 00000006 MPASM 5.41 MIDIPULSE.ASM 11-18-2015 9:43:26 PAGE 24 SYMBOL TABLE LABEL VALUE CVRR 00000005 CVRSS 00000004 CmdBuff0RdIndx 000000F2 CmdBuff0Timer 000000F4 CmdBuff0TimerValLSB 000000F6 CmdBuff0TimerValMSB 000000F5 CmdBuff0WrIndx 000000F3 CmdBuff1Timer 000000F7 CmdBuff1TimerValLSB 000000F9 CmdBuff1TimerValMSB 000000F8 CmdBuff2Timer 000000FA CmdBuff2TimerValLSB 000000FC CmdBuff2TimerValMSB 000000FB CmdBuff3Timer 000000FD CmdBuff3TimerValLSB 000000FF CmdBuff3TimerValMSB 000000FE Copy1 000001DE CopyRxToTx 000001DE D 00000005 DC 00000001 DC1B0 00000004 DC1B1 00000005 DC2B0 00000004 DC2B1 00000005 DDRA TRISA DDRB TRISB DDRC TRISC DDRD TRISD DDRE TRISE DONE 00000001 D_A 00000005 D_NOT_A 00000005 ECCP1AS 00000FB6 ECCP1DEL 00000FB7 ECCPAS 00000FB6 ECCPAS0 00000004 ECCPAS1 00000005 ECCPAS2 00000006 ECCPASE 00000007 EEADR 00000FA9 EEADRH 00000FAA EECON1 00000FA6 EECON2 00000FA7 EEDATA 00000FA8 EEIE 00000004 EEIF 00000004 EEIP 00000004 EEPGD 00000007 EndHighInt 0000008E EndLowInt 00000250 ErrFERR 00000078 ErrOERR 0000006E ErrRxBufEmpty 000001DA MPASM 5.41 MIDIPULSE.ASM 11-18-2015 9:43:26 PAGE 25 SYMBOL TABLE LABEL VALUE ErrRxBufFull 0000015A ErrRxOver 00000084 ErrTxBufEmpty 00000198 ErrTxBufFull 0000011E FAST 00000001 FERR 00000002 FLTS 00000002 FREE 00000004 FSR0 00000000 FSR0H 00000FEA FSR0H_SHADOW 00000005 FSR0H_TEMP 00000003 FSR0L 00000FE9 FSR0L_SHADOW 00000006 FSR0L_TEMP 00000004 FSR1 00000001 FSR1H 00000FE2 FSR1L 00000FE1 FSR2 00000002 FSR2H 00000FDA FSR2L 00000FD9 Flags 00000050 GCEN 00000007 GIE 00000007 GIEH 00000007 GIEL 00000006 GIE_GIEH 00000007 GO 00000001 GO_DONE 00000001 GO_NOT_DONE 00000001 GetData 0000005C GetRxBuf1 000001BC GetRxBuf2 000001D2 GetRxBuffer 0000019A GetTxBuf1 0000017C GetTxBuf2 00000192 GetTxBuffer 0000015C HLVDCON 00000FD2 HLVDEN 00000004 HLVDIE 00000002 HLVDIF 00000002 HLVDIN 00000005 HLVDIP 00000002 HLVDL0 00000000 HLVDL1 00000001 HLVDL2 00000002 HLVDL3 00000003 HighInt 00000008 HighInt1 00000276 HighIntCode 00000266 IDLEN 00000007 INDF0 00000FEF INDF1 00000FE7 MPASM 5.41 MIDIPULSE.ASM 11-18-2015 9:43:26 PAGE 26 SYMBOL TABLE LABEL VALUE INDF2 00000FDF INT0 00000000 INT0E 00000004 INT0F 00000001 INT0IE 00000004 INT0IF 00000001 INT1 00000001 INT1E 00000003 INT1F 00000000 INT1IE 00000003 INT1IF 00000000 INT1IP 00000006 INT1P 00000006 INT2 00000002 INT2E 00000004 INT2F 00000001 INT2IE 00000004 INT2IF 00000001 INT2IP 00000007 INT2P 00000007 INTCON 00000FF2 INTCON2 00000FF1 INTCON3 00000FF0 INTEDG0 00000006 INTEDG1 00000005 INTEDG2 00000004 INTSRC 00000007 IOFS 00000002 IPEN 00000007 IPR1 00000F9F IPR2 00000FA2 IRCF0 00000004 IRCF1 00000005 IRCF2 00000006 IRVST 00000005 IVRST 00000005 InitRxBuffer 000000D0 InitTxBuffer 000000BE KBI0 00000004 KBI1 00000005 KBI2 00000006 KBI3 00000007 LATA 00000F89 LATA0 00000000 LATA1 00000001 LATA2 00000002 LATA3 00000003 LATA4 00000004 LATA5 00000005 LATA6 00000006 LATA7 00000007 LATB 00000F8A LATB0 00000000 MPASM 5.41 MIDIPULSE.ASM 11-18-2015 9:43:26 PAGE 27 SYMBOL TABLE LABEL VALUE LATB1 00000001 LATB2 00000002 LATB3 00000003 LATB4 00000004 LATB5 00000005 LATB6 00000006 LATB7 00000007 LATC 00000F8B LATC0 00000000 LATC1 00000001 LATC2 00000002 LATC3 00000003 LATC4 00000004 LATC5 00000005 LATC6 00000006 LATC7 00000007 LVDCON 00000FD2 LVDEN 00000004 LVDIE 00000002 LVDIF 00000002 LVDIN 00000005 LVDIP 00000002 LVDL0 00000000 LVDL1 00000001 LVDL2 00000002 LVDL3 00000003 LVV0 00000000 LVV1 00000001 LVV2 00000002 LVV3 00000003 LowInt 00000018 LowInt1 00000034 LowInt2 0000003C MCLR 00000003 Main 00000278 MainLoop 000002B8 MidiByte0 00000011 MidiByte1 00000012 MidiByte2 00000013 MidiCurData 00000014 MidiInAction1Byte 0000022A MidiInAction2Bytes 0000022C MidiInAllNotesOff 00000428 MidiInByte 00000010 MidiInCtrlChange 00000420 MidiInCtrlChange1 00000244 MidiInData 0000020E MidiInDataM1 0000021C MidiInDataM2 00000214 MidiInNoteOff 0000041C MidiInNoteOff1 00000242 MidiInNoteOff2 0000041E MidiInNoteOffNoVelo 0000041C MPASM 5.41 MIDIPULSE.ASM 11-18-2015 9:43:26 PAGE 28 SYMBOL TABLE LABEL VALUE MidiInNoteOn 000003CC MidiInNoteOn1 00000240 MidiInNoteOn2 0000041A MidiInParser 000001F0 MidiInStatus 000001FA MidiInStatus2words 00000208 MidiInStatusEnd 0000020C MidiNumData 00000015 MidiTestByte 00000016 N 00000004 NOT_A 00000005 NOT_ADDRESS 00000005 NOT_BOR 00000000 NOT_DONE 00000001 NOT_MCLR 00000003 NOT_PD 00000002 NOT_POR 00000001 NOT_RBPU 00000007 NOT_RI 00000004 NOT_SS 00000005 NOT_T1SYNC 00000002 NOT_T3SYNC 00000002 NOT_TO 00000003 NOT_W 00000002 NOT_WRITE 00000002 NoWrap 000002F2 NoWrap2 00000414 OERR 00000001 OSCCON 00000FD3 OSCFIE 00000007 OSCFIF 00000007 OSCFIP 00000007 OSCTUNE 00000F9B OSTS 00000003 OV 00000003 OutsA 00000009 OutsB 0000000A OutsC 0000000B P 00000004 PC 00000FF9 PCFG0 00000000 PCFG1 00000001 PCFG2 00000002 PCFG3 00000003 PCL 00000FF9 PCLATH 00000FFA PCLATU 00000FFB PD 00000002 PEIE 00000006 PEIE_GIEL 00000006 PEN 00000002 PGC 00000006 PGD 00000007 MPASM 5.41 MIDIPULSE.ASM 11-18-2015 9:43:26 PAGE 29 SYMBOL TABLE LABEL VALUE PGM 00000005 PIE1 00000F9D PIE2 00000FA0 PIR1 00000F9E PIR2 00000FA1 PLLEN 00000006 PLUSW0 00000FEB PLUSW1 00000FE3 PLUSW2 00000FDB POR 00000001 PORTA 00000F80 PORTB 00000F81 PORTC 00000F82 PORTE 00000F84 POSTDEC0 00000FED POSTDEC1 00000FE5 POSTDEC2 00000FDD POSTINC0 00000FEE POSTINC1 00000FE6 POSTINC2 00000FDE PR2 00000FCB PREINC0 00000FEC PREINC1 00000FE4 PREINC2 00000FDC PROD 00000FF3 PRODH 00000FF4 PRODL 00000FF3 PRSEN 00000007 PSA 00000003 PSSAC0 00000002 PSSAC1 00000003 PWM1CON 00000FB7 PollMidiIn 000001EA PutDat1 00000058 PutData 00000050 PutRxBuf1 00000140 PutRxBuf2 00000156 PutRxBuffer 00000122 PutTxBuf1 00000102 PutTxBuf2 00000118 PutTxBuffer 000000E2 R 00000002 RA0 00000000 RA1 00000001 RA2 00000002 RA3 00000003 RA4 00000004 RA5 00000005 RA6 00000006 RA7 00000007 RB0 00000000 RB1 00000001 RB2 00000002 MPASM 5.41 MIDIPULSE.ASM 11-18-2015 9:43:26 PAGE 30 SYMBOL TABLE LABEL VALUE RB3 00000003 RB4 00000004 RB5 00000005 RB6 00000006 RB7 00000007 RBIE 00000003 RBIF 00000000 RBIP 00000000 RBPU 00000007 RC0 00000000 RC1 00000001 RC2 00000002 RC3 00000003 RC4 00000004 RC5 00000005 RC6 00000006 RC7 00000007 RCEN 00000003 RCIDL 00000006 RCIE 00000005 RCIF 00000005 RCIP 00000005 RCMT 00000006 RCON 00000FD0 RCREG 00000FAE RCSTA 00000FAB RD 00000000 RD16 00000007 RE3 00000003 RI 00000004 RSEN 00000001 RX 00000007 RX9 00000006 RX9D 00000000 RXDTP 00000005 RX_BUF_LEN 00000010 R_NOT_W 00000002 R_W 00000002 ReadBuffer 000002DC ResetVector 00000000 RxBufEmpty 00000003 RxBufFull 00000002 RxBuffer 0000006C RxEndPtrH 0000005A RxEndPtrL 0000005B RxStartPtrH 00000058 RxStartPtrL 00000059 S 00000003 SBOREN 00000006 SCK 00000003 SCKP 00000004 SCL 00000003 SCS0 00000000 MPASM 5.41 MIDIPULSE.ASM 11-18-2015 9:43:26 PAGE 31 SYMBOL TABLE LABEL VALUE SCS1 00000001 SDA 00000004 SDI 00000004 SDO 00000005 SEN 00000000 SENDB 00000003 SMP 00000007 SP0 00000000 SP1 00000001 SP2 00000002 SP3 00000003 SP4 00000004 SPBRG 00000FAF SPBRGH 00000FB0 SPBRG_VAL 0000004F SPEN 00000007 SREN 00000005 SS 00000005 SSPADD 00000FC8 SSPBUF 00000FC9 SSPCON1 00000FC6 SSPCON2 00000FC5 SSPEN 00000005 SSPIE 00000003 SSPIF 00000003 SSPIP 00000003 SSPM0 00000000 SSPM1 00000001 SSPM2 00000002 SSPM3 00000003 SSPOV 00000006 SSPSTAT 00000FC7 STATUS 00000FD8 STATUS_TEMP 00000001 STKFUL 00000007 STKOVF 00000007 STKPTR 00000FFC STKPTR0 00000000 STKPTR1 00000001 STKPTR2 00000002 STKPTR3 00000003 STKPTR4 00000004 STKUNF 00000006 SWDTE 00000000 SWDTEN 00000000 SYNC 00000004 SetPulse 00000500 SetupSerial 00000098 SetupTimer3 000002BE T016BIT 00000006 T08BIT 00000006 T0CKI 00000004 T0CON 00000FD5 MPASM 5.41 MIDIPULSE.ASM 11-18-2015 9:43:26 PAGE 32 SYMBOL TABLE LABEL VALUE T0CS 00000005 T0IE 00000005 T0IF 00000002 T0PS0 00000000 T0PS1 00000001 T0PS2 00000002 T0SE 00000004 T13CKI 00000000 T1CKI 00000000 T1CKPS0 00000004 T1CKPS1 00000005 T1CON 00000FCD T1OSCEN 00000003 T1OSI 00000001 T1OSO 00000000 T1RUN 00000006 T1SYNC 00000002 T2CKPS0 00000000 T2CKPS1 00000001 T2CON 00000FCA T2OUTPS0 00000003 T2OUTPS1 00000004 T2OUTPS2 00000005 T2OUTPS3 00000006 T3CCP1 00000003 T3CCP2 00000006 T3CKPS0 00000004 T3CKPS1 00000005 T3CON 00000FB1 T3SYNC 00000002 TABLAT 00000FF5 TBLPTR 00000FF6 TBLPTRH 00000FF7 TBLPTRL 00000FF6 TBLPTRU 00000FF8 TMR0H 00000FD7 TMR0IE 00000005 TMR0IF 00000002 TMR0IP 00000002 TMR0L 00000FD6 TMR0ON 00000007 TMR1CS 00000001 TMR1H 00000FCF TMR1IE 00000000 TMR1IF 00000000 TMR1IP 00000000 TMR1L 00000FCE TMR1ON 00000000 TMR2 00000FCC TMR2IE 00000001 TMR2IF 00000001 TMR2IP 00000001 TMR2ON 00000002 MPASM 5.41 MIDIPULSE.ASM 11-18-2015 9:43:26 PAGE 33 SYMBOL TABLE LABEL VALUE TMR3CS 00000001 TMR3H 00000FB3 TMR3IE 00000001 TMR3IF 00000001 TMR3IP 00000001 TMR3L 00000FB2 TMR3ON 00000000 TO 00000003 TOS 00000FFD TOSH 00000FFE TOSL 00000FFD TOSU 00000FFF TOUTPS0 00000003 TOUTPS1 00000004 TOUTPS2 00000005 TOUTPS3 00000006 TRISA 00000F92 TRISA0 00000000 TRISA1 00000001 TRISA2 00000002 TRISA3 00000003 TRISA4 00000004 TRISA5 00000005 TRISA6 00000006 TRISA7 00000007 TRISB 00000F93 TRISB0 00000000 TRISB1 00000001 TRISB2 00000002 TRISB3 00000003 TRISB4 00000004 TRISB5 00000005 TRISB6 00000006 TRISB7 00000007 TRISC 00000F94 TRISC0 00000000 TRISC1 00000001 TRISC2 00000002 TRISC3 00000003 TRISC4 00000004 TRISC5 00000005 TRISC6 00000006 TRISC7 00000007 TRMT 00000001 TUN0 00000000 TUN1 00000001 TUN2 00000002 TUN3 00000003 TUN4 00000004 TX 00000006 TX9 00000006 TX9D 00000000 TXCKP 00000004 MPASM 5.41 MIDIPULSE.ASM 11-18-2015 9:43:26 PAGE 34 SYMBOL TABLE LABEL VALUE TXEN 00000005 TXIE 00000004 TXIF 00000004 TXIP 00000004 TXREG 00000FAD TXSTA 00000FAC TX_BUF_LEN 00000010 TempData 00000051 TempRxData 00000052 TempTxData 00000053 Timer1 0000030A Timer10 00000376 Timer10Lsb 00000033 Timer10Msb 00000032 Timer10Out OutsB, 4 Timer11 00000382 Timer11Lsb 00000035 Timer11Msb 00000034 Timer11Out OutsB, 3 Timer12 0000038E Timer12Lsb 00000037 Timer12Msb 00000036 Timer12Out OutsB, 2 Timer13 0000039A Timer13Lsb 00000039 Timer13Msb 00000038 Timer13Out OutsB, 1 Timer14 000003A6 Timer14Lsb 0000003B Timer14Msb 0000003A Timer14Out OutsB, 0 Timer15 000003B2 Timer15Lsb 0000003D Timer15Msb 0000003C Timer15Out OutsC, 5 Timer16 000003BE Timer16Lsb 0000003F Timer16Msb 0000003E Timer16Out OutsC, 4 Timer17 000003CA Timer1Lsb 00000021 Timer1Msb 00000020 Timer1Out OutsA, 2 Timer2 00000316 Timer2Lsb 00000023 Timer2Msb 00000022 Timer2Out OutsA, 1 Timer3 00000322 Timer3ISR 000002C8 Timer3Lsb 00000025 Timer3Msb 00000024 Timer3Out OutsA, 0 Timer4 0000032E MPASM 5.41 MIDIPULSE.ASM 11-18-2015 9:43:26 PAGE 35 SYMBOL TABLE LABEL VALUE Timer4Lsb 00000027 Timer4Msb 00000026 Timer4Out OutsA, 3 Timer5 0000033A Timer5Lsb 00000029 Timer5Msb 00000028 Timer5Out OutsA, 4 Timer6 00000346 Timer6Lsb 0000002B Timer6Msb 0000002A Timer6Out OutsA, 5 Timer7 00000352 Timer7Lsb 0000002D Timer7Msb 0000002C Timer7Out OutsB, 7 Timer8 0000035E Timer8Lsb 0000002F Timer8Msb 0000002E Timer8Out OutsB, 6 Timer9 0000036A Timer9Lsb 00000031 Timer9Msb 00000030 Timer9Out OutsB, 5 Timers 0000030A TmpM 00000007 TmpT 00000008 TxBufEmpty 00000001 TxBufFull 00000000 TxBuffer 0000005C TxEndPtrH 00000056 TxEndPtrL 00000057 TxStartPtrH 00000054 TxStartPtrL 00000055 UA 00000001 VCFG0 00000004 VCFG1 00000005 VDIRMAG 00000007 VPP 00000003 W 00000000 WCOL 00000007 WDTCON 00000FD1 WR 00000001 WREG 00000FE8 WREG_TEMP 00000000 WREN 00000002 WRERR 00000003 WUE 00000001 Z 00000002 _BOREN_NOSLP_2L 000000FD _BOREN_OFF_2L 000000F9 _BOREN_ON_2L 000000FB _BOREN_SBORDIS_2L 000000FF _BORV_0_2L 000000E7 MPASM 5.41 MIDIPULSE.ASM 11-18-2015 9:43:26 PAGE 36 SYMBOL TABLE LABEL VALUE _BORV_1_2L 000000EF _BORV_2_2L 000000F7 _BORV_3_2L 000000FF _CCP2MX_PORTBE_3H 000000FE _CCP2MX_PORTC_3H 000000FF _CONFIG1H 00300001 _CONFIG2H 00300003 _CONFIG2L 00300002 _CONFIG3H 00300005 _CONFIG4L 00300006 _CONFIG5H 00300009 _CONFIG5L 00300008 _CONFIG6H 0030000B _CONFIG6L 0030000A _CONFIG7H 0030000D _CONFIG7L 0030000C _CP0_OFF_5L 000000FF _CP0_ON_5L 000000FE _CP1_OFF_5L 000000FF _CP1_ON_5L 000000FD _CP2_OFF_5L 000000FF _CP2_ON_5L 000000FB _CPB_OFF_5H 000000FF _CPB_ON_5H 000000BF _CPD_OFF_5H 000000FF _CPD_ON_5H 0000007F _DEBUG_OFF_4L 000000FF _DEBUG_ON_4L 0000007F _DEVID1 003FFFFE _DEVID2 003FFFFF _EBTR0_OFF_7L 000000FF _EBTR0_ON_7L 000000FE _EBTR1_OFF_7L 000000FF _EBTR1_ON_7L 000000FD _EBTR2_OFF_7L 000000FF _EBTR2_ON_7L 000000FB _EBTRB_OFF_7H 000000FF _EBTRB_ON_7H 000000BF _FCMEN_OFF_1H 000000BF _FCMEN_ON_1H 000000FF _IDLOC0 00200000 _IDLOC1 00200001 _IDLOC2 00200002 _IDLOC3 00200003 _IDLOC4 00200004 _IDLOC5 00200005 _IDLOC6 00200006 _IDLOC7 00200007 _IESO_OFF_1H 0000007F _IESO_ON_1H 000000FF _LPT1OSC_OFF_3H 000000FB _LPT1OSC_ON_3H 000000FF _LVP_OFF_4L 000000FB MPASM 5.41 MIDIPULSE.ASM 11-18-2015 9:43:26 PAGE 37 SYMBOL TABLE LABEL VALUE _LVP_ON_4L 000000FF _MCLRE_OFF_3H 0000007F _MCLRE_ON_3H 000000FF _OSC_ECIO6_1H 000000F5 _OSC_EC_1H 000000F4 _OSC_HSPLL_1H 000000F6 _OSC_HS_1H 000000F2 _OSC_INTIO67_1H 000000F8 _OSC_INTIO7_1H 000000F9 _OSC_LP_1H 000000F0 _OSC_RCIO6_1H 000000F7 _OSC_RC_1H 000000F3 _OSC_XT_1H 000000F1 _PBADEN_OFF_3H 000000FD _PBADEN_ON_3H 000000FF _PWRT_OFF_2L 000000FF _PWRT_ON_2L 000000FE _STVREN_OFF_4L 000000FE _STVREN_ON_4L 000000FF _WDTPS_1024_2H 000000F5 _WDTPS_128_2H 000000EF _WDTPS_16384_2H 000000FD _WDTPS_16_2H 000000E9 _WDTPS_1_2H 000000E1 _WDTPS_2048_2H 000000F7 _WDTPS_256_2H 000000F1 _WDTPS_2_2H 000000E3 _WDTPS_32768_2H 000000FF _WDTPS_32_2H 000000EB _WDTPS_4096_2H 000000F9 _WDTPS_4_2H 000000E5 _WDTPS_512_2H 000000F3 _WDTPS_64_2H 000000ED _WDTPS_8192_2H 000000FB _WDTPS_8_2H 000000E7 _WDT_OFF_2H 000000FE _WDT_ON_2H 000000FF _WRT0_OFF_6L 000000FF _WRT0_ON_6L 000000FE _WRT1_OFF_6L 000000FF _WRT1_ON_6L 000000FD _WRT2_OFF_6L 000000FF _WRT2_ON_6L 000000FB _WRTB_OFF_6H 000000FF _WRTB_ON_6H 000000BF _WRTC_OFF_6H 000000FF _WRTC_ON_6H 000000DF _WRTD_OFF_6H 000000FF _WRTD_ON_6H 0000007F _XINST_OFF_4L 000000BF _XINST_ON_4L 000000FF __18F2525 00000001 _sp1 00000508 MPASM 5.41 MIDIPULSE.ASM 11-18-2015 9:43:26 PAGE 38 SYMBOL TABLE LABEL VALUE _sp10 0000052C _sp11 00000530 _sp12 00000534 _sp13 00000538 _sp14 0000053C _sp15 00000540 _sp16 00000544 _sp2 0000050C _sp3 00000510 _sp4 00000514 _sp5 00000518 _sp6 0000051C _sp7 00000520 _sp8 00000524 _sp9 00000528 MEMORY USAGE MAP ('X' = Used, '-' = Unused) 0000 : XX------XX------ --------XXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXX-- 0040 : ---------------- XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX 0080 : XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX 00C0 : XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX 0100 : XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX 0140 : XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX 0180 : XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX 01C0 : XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX 0200 : XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX 0240 : XXXXXX---------- XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX 0280 : XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX 02C0 : XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX 0300 : XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX 0340 : XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX 0380 : XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX 03C0 : XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX 0400 : XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXX---------- 0500 : XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX 0540 : XXXXXXXX-------- ---------------- ---------------- ---------------- All other memory blocks unused. Program Memory Bytes Used: 1102 Program Memory Bytes Free: 48050 Errors : 12 Warnings : 11 reported, 0 suppressed Messages : 0 reported, 0 suppressed