Motorola DSP56300 Assembler Version 6.2.0 99-12-04 14:25:33 pass_d~1.asm Page 1 1 ;*************************************************************************** 2 ;QS_ST.ASM : WILL PASS AUDIO STRAIGHT THROUGH 3 ;*************************************************************************** 1067 1068 ;****************************************************************************** 1069 1070 ;---Buffer for talking to the CS4215 1071 1072 X:000000 org x:0 1073 RX_BUFF_BASE 1074 000000 equ * 1075 RX_data_1_2 1076 X:000000 ds 1 ;data time slot 1/2 for RX ISR 1077 RX_data_3_4 1078 X:000001 ds 1 ;data time slot 3/4 for RX ISR 1079 RX_data_5_6 1080 X:000002 ds 1 ;data time slot 5/6 for RX ISR 1081 RX_data_7_8 1082 X:000003 ds 1 ;data time slot 7/8 for RX ISR 1083 1084 TX_BUFF_BASE 1085 000004 equ * 1086 TX_data_1_2 1087 X:000004 ds 1 ;data time slot 1/2 for TX ISR 1088 TX_data_3_4 1089 X:000005 ds 1 ;data time slot 3/4 for TX ISR 1090 TX_data_5_6 1091 X:000006 ds 1 ;data time slot 5/6 for TX ISR 1092 TX_data_7_8 1093 X:000007 ds 1 ;data time slot 7/8 for TX ISR 1094 1095 X:000008 RX_PTR ds 1 ; Pointer for rx buffer 1096 X:000009 TX_PTR ds 1 ; Pointer for tx buffer 1097 1098 ;TONE_OUTPUT EQU HEADPHONE_EN+LINEOUT_EN+(4*LEFT_ATTN)+(4*RIGHT_ATTN) 1099 ;TONE_INPUT EQU MIC_IN_SELECT+(15*MONITOR_ATTN) 1100 ;CTRL_WD_12 equ NO_PREAMP+HI_PASS_FILT+SAMP_RATE_48+STEREO+DATA_16 ;CLB=0 1101 ;CTRL_WD_34 equ IMMED_3STATE+XTAL1_SELECT+BITS_64+CODEC_MASTER 1102 ;CTRL_WD_56 equ $000000 1103 ;CTRL_WD_78 equ $000000 1104 1105 000300 CTRL_WD_12 equ MIN_LEFT_ATTN+MIN_RIGHT_ATTN+LIN2+RIN2 1106 000000 CTRL_WD_34 equ MIN_LEFT_GAIN+MIN_RIGHT_GAIN 1107 1108 1109 P:000050 org p:$50 ;SCI Recieve Data Interrupt 1110 P:000050 0BF080 jsr ISCIRD 000199 1111 1112 P:000100 org p:$100 1113 START 1114 main 1115 P:000100 08F4BD movep #$040003,x:M_PCTL ; set PLL for MPY of 4X 040003 1116 P:000102 08F4BB movep #$012421,x:M_BCR ; set up one ext. wait state for all AAR areas 012421 Motorola DSP56300 Assembler Version 6.2.0 99-12-04 14:25:33 pass_d~1.asm Page 2 1117 P:000104 0003F8 ori #3,mr ;mask interrupts 1118 P:000105 0500BB movec #0,sp ;clear hardware stack pointer 1119 P:000106 0500BA move #0,omr ;operating mode 0 1120 P:000107 364000 move #$40,r6 ; initialise stack pointer 1121 P:000108 05F426 move #-1,m6 ; linear addressing FFFFFF 1122 P:00010A 0BF080 jsr ada_init ; initialize codec 0001E8 1123 1124 1125 ; initialize SCI 1126 ; 10-bit asynchronous mode 1127 ; enable reciever and transmitter 1128 P:00010C 07F41C movep #$000B02,x:M_SCR ; SCI control register 000B02 1129 ; set interrupt priority for SCI RECV to 1 1130 P:00010E 56F000 move x:M_IPRP,a ; grab register current value FFFFFE 1131 ; enable tx and rx pins 1132 P:000110 07F41F movep #$000003,x:M_PCRE ; Port E Control Register 000003 1133 P:000112 0140C2 or #000080,a ; set bits for interrupt priority 2 000050 1134 ; Reciever/Transmitter clocks use external clock from SCLK 1135 P:000114 07F41B movep #$00C000,x:M_SCCR ; SCI Clock Control Register 00C000 1136 P:000116 567000 move a,x:M_IPRP ; put value in interrupt priority peripheral register FFFFFE 1137 1138 ;print a greeting and instructions 1139 P:000118 65F400 move #greet,r5 000007 1140 P:00011A 0BF080 jsr print 000178 1141 1142 loop_1 1143 1144 P:00011C 01B7A2 jset #2,x:M_SSISR0,* ;wait for frame sync to pass 00011C 1145 P:00011E 01B782 jclr #2,x:M_SSISR0,* ;wait for frame sync 00011E 1146 1147 P:000120 568000 move x:RX_BUFF_BASE,a ;receive left 1148 P:000121 578100 move x:RX_BUFF_BASE+1,b ;receive right 1149 P:000122 0BF080 jsr process_stereo 00012D 1150 P:000124 560400 move a,x:TX_BUFF_BASE ;transmit left 1151 P:000125 570500 move b,x:TX_BUFF_BASE+1 ;transmit right 1152 1153 P:000126 46F400 move #CTRL_WD_12,y0 ;set up control words 000300 1154 P:000128 460600 move y0,x:TX_BUFF_BASE+2 1155 P:000129 46F400 move #CTRL_WD_12,y0 000300 1156 P:00012B 460700 move y0,x:TX_BUFF_BASE+3 1157 Motorola DSP56300 Assembler Version 6.2.0 99-12-04 14:25:33 pass_d~1.asm Page 3 1158 P:00012C 0C011C jmp loop_1 1159 1160 1161 process_stereo 1162 1163 P:00012D 5E7000 move a,y:newa ;store new right channel value 000005 1164 P:00012F 5F7000 move b,y:newb ;store new left channel value 000006 1165 P:000131 4EF000 move y:diff,y0 ;load max delta mask into y0 000000 1166 1167 P:000133 5EF000 move y:newa,a 000005 1168 P:000135 5FF000 move y:olda,b ;new in a, old in b 000003 1169 1170 P:000137 200014 sub b,a ; get difference **** 1171 [pass_d~1.asm 104]: WARNING --- Pipeline stall reading register written in previous instruction (Y data move field) 1171 P:000138 5E7000 move a,y:temp ; hold difference in temp 000002 1172 P:00013A 200026 abs a ; check to see if it is in range 1173 P:00013B 200055 cmp y0,a 1174 P:00013C 0D1049 blt gooda 000012 1175 1176 P:00013E 5EF000 move y:temp,a 000002 1177 P:000140 200003 tst a 1178 P:000141 0D1047 bgt posa 000009 1179 1180 P:000143 5EF000 move y:diff,a 000000 1181 P:000145 200036 neg a **** 1182 [pass_d~1.asm 115]: WARNING --- Pipeline stall reading register written in previous instruction (Y data move field) 1182 P:000146 5E7000 move a,y:temp 000002 1183 P:000148 0D10C0 bra gooda 000006 1184 P:00014A 5EF000 posa move y:diff,a 000000 1185 P:00014C 5E7000 move a,y:temp 000002 1186 P:00014E 5EF000 gooda move y:temp,a 000002 1187 P:000150 200010 add b,a ;add delta back in **** 1188 [pass_d~1.asm 121]: WARNING --- Pipeline stall reading register written in previous instruction (Y data move field) 1188 P:000151 5E7000 move a,y:olda ; store new value 000003 1189 1190 1191 P:000153 5EF000 move y:newb,a 000006 1192 P:000155 5FF000 move y:oldb,b ;new in a, old in b 000004 Motorola DSP56300 Assembler Version 6.2.0 99-12-04 14:25:33 pass_d~1.asm Page 4 1193 P:000157 200014 sub b,a ; get difference **** 1194 [pass_d~1.asm 127]: WARNING --- Pipeline stall reading register written in previous instruction (Y data move field) 1194 P:000158 5E7000 move a,y:temp ; hold difference in temp 000002 1195 P:00015A 200026 abs a ; check to see if it is in range 1196 P:00015B 200055 cmp y0,a 1197 P:00015C 0D1049 blt goodb 000012 1198 1199 P:00015E 5EF000 move y:temp,a 000002 1200 P:000160 200003 tst a 1201 P:000161 0D1047 bgt posb 000009 1202 1203 P:000163 5EF000 move y:diff,a 000000 1204 P:000165 200036 neg a **** 1205 [pass_d~1.asm 138]: WARNING --- Pipeline stall reading register written in previous instruction (Y data move field) 1205 P:000166 5E7000 move a,y:temp 000002 1206 P:000168 0D10C0 bra goodb 000006 1207 P:00016A 5EF000 posb move y:diff,a 000000 1208 P:00016C 5E7000 move a,y:temp 000002 1209 P:00016E 5EF000 goodb move y:temp,a 000002 1210 P:000170 200010 add b,a ;add delta back in **** 1211 [pass_d~1.asm 144]: WARNING --- Pipeline stall reading register written in previous instruction (Y data move field) 1211 P:000171 5E7000 move a,y:oldb ; store new value 000004 1212 1213 P:000173 5EF000 move y:olda,a 000003 1214 P:000175 5FF000 move y:oldb,b 000004 1215 1216 P:000177 00000C rts 1217 1218 1219 ;print subroutine takes address in register r5 1220 ;exits when most significant byte is zero 1221 ;ignores zeros in lower bytes 1222 ; clobbers accumulator A and B and register r5 1223 print 1224 P:000178 5EDD00 prbegin move y:(r5)+,a 1225 ; cmp #$00ffff,a ;check to see if done (char=$00) 1226 ; blt prend 1227 P:000179 014085 cmp #$000000,a ;check to see if done (char=$00) 1228 P:00017A 0D104A beq prend 00001E 1229 P:00017C 019381 jclr #1,x:M_SSR,* ;wait for tx to finish 00017C 1230 P:00017E 019380 jclr #0,x:M_SSR,* ;wait for tx to finish Motorola DSP56300 Assembler Version 6.2.0 99-12-04 14:25:33 pass_d~1.asm Page 5 00017E 1231 P:000180 567000 move a,x:M_STXH ; send high byte FFFF97 1232 P:000182 0140C6 and #$00ffff,a 00FFFF 1233 P:000184 0140C5 cmp #$0000ff,a 0000FF 1234 P:000186 0597D2 blt prbegin 1235 P:000187 019381 jclr #1,x:M_SSR,* ;wait for tx to finish 000187 1236 P:000189 019380 jclr #0,x:M_SSR,* ;wait for tx to finish 000189 1237 P:00018B 567000 move a,x:M_STXM ; send mid byte FFFF96 1238 P:00018D 0140C6 and #$0000ff,a 0000FF 1239 P:00018F 014085 cmp #$000000,a 1240 P:000190 0597C8 blt prbegin 1241 P:000191 019381 jclr #1,x:M_SSR,* ;wait for tx to finish 000191 1242 P:000193 019380 jclr #0,x:M_SSR,* ;wait for tx to finish 000193 1243 P:000195 567000 move a,x:M_STXL ; send low byte FFFF95 1244 P:000197 050FC1 bra prbegin 1245 P:000198 00000C prend rts 1246 1247 1248 ; the SCI interrupt is triggered when a character is received 1249 ; this function takes the character, checks to make sure it is 1250 ; in the correct range (1-9, A-G, a-g) prints a message and 1251 ; modifies the output mask for that number of bits 1252 P:000199 21C600 ISCIRD move a,y0 ;back up A 1253 P:00019A 56F000 move x:M_SRXL,a FFFF98 1254 P:00019C 017185 cmp #$31,a ; >='1' 1255 P:00019D 0D1049 blt iscend 000049 1256 P:00019F 017A85 cmp #$3A,a ; <='9' 1257 P:0001A0 0D1049 blt iscnum 000015 1258 1259 P:0001A2 0140C5 cmp #$40,a ; >='A' 000040 1260 P:0001A4 0D1049 blt iscend 000042 1261 P:0001A6 0140C5 cmp #$48,a ; <='G' 000048 1262 P:0001A8 0D1049 blt isclet 00000E 1263 P:0001AA 0140C5 cmp #$60,a ; >='a' 000060 1264 P:0001AC 0D1049 blt iscend 00003A 1265 P:0001AE 0140C5 cmp #$67,a ; <='g' 000067 Motorola DSP56300 Assembler Version 6.2.0 99-12-04 14:25:33 pass_d~1.asm Page 6 1266 P:0001B0 0D1047 bgt iscend 000036 1267 P:0001B2 016084 sub #$20,a 1268 P:0001B3 0D10C0 bra isclet 000003 1269 1270 P:0001B5 014780 iscnum add #$07,a 1271 P:0001B6 014980 isclet add #$09,a 1272 1273 P:0001B7 019381 isciup jclr #1,x:M_SSR,* ;wait for tx to finish 0001B7 1274 P:0001B9 019380 jclr #0,x:M_SSR,* ;wait for tx to finish 0001B9 1275 P:0001BB 07F415 movep #$0d,x:M_STXL ;print LF 00000D 1276 P:0001BD 2F8000 move #$800000,b ;initial mask 1277 P:0001BE 5E7000 move a,y:temp ;hold onto value temporarially 000002 1278 P:0001C0 0140C4 sub #$41,a ; ammount to shift mask 000041 1279 P:0001C2 5E7000 move a,y:masksz 000001 1280 P:0001C4 21C400 move a,x0 1281 P:0001C5 0C1E79 asr x0,b,b ; shift the mask 1282 1283 P:0001C6 56F400 move #>$00000f,a ;calculate bit shift 00000F 1284 ; move y:masksz,x0 1285 P:0001C8 200044 sub x0,a 1286 P:0001C9 0C1E35 lsr a1,b 1287 P:0001CA 2B0000 move #<$00,b2 1288 1289 P:0001CB 5EF000 move y:temp,a 000002 1290 P:0001CD 5F7000 move b,y:diff 000000 1291 1292 P:0001CF 015084 sub #$10,a 1293 P:0001D0 017A85 cmp #$3A,a ; is a 10 digit? 1294 P:0001D1 0D1049 blt isci0 000009 1295 1296 P:0001D3 019381 isci1 jclr #1,x:M_SSR,* ;wait for tx to finish 0001D3 1297 P:0001D5 019380 jclr #0,x:M_SSR,* ;wait for tx to finish 0001D5 1298 P:0001D7 07F415 movep #$31,x:M_STXL 000031 1299 P:0001D9 014A84 sub #$0a,a 1300 1301 P:0001DA 019381 isci0 jclr #1,x:M_SSR,* ;wait for tx to finish 0001DA 1302 P:0001DC 019380 jclr #0,x:M_SSR,* ;wait for tx to finish 0001DC 1303 P:0001DE 567000 move a,x:M_STXL FFFF95 Motorola DSP56300 Assembler Version 6.2.0 99-12-04 14:25:33 pass_d~1.asm Page 7 1304 P:0001E0 019381 jclr #1,x:M_SSR,* ;wait for tx to finish 0001E0 1305 P:0001E2 019380 jclr #0,x:M_SSR,* ;wait for tx to finish 0001E2 1306 P:0001E4 07F415 movep #$20,x:M_STXL 000020 1307 1308 P:0001E6 20CE00 iscend move y0,a ;restore A 1309 P:0001E7 000004 rti 1310 1311 1312 1313 1314 include 'ada_init.asm' 1315 page 132,60 1316 ;************************************************************************** 1317 ; ADA_INIT.ASM Ver 1.2 1318 ; Example program to initialize the CS4218 1319 ; 1320 ; Copyright (c) MOTOROLA 1995, 1996, 1997, 1998 1321 ; Semiconductor Products Sector 1322 ; Wireless Signal Processing Division 1323 ; 1324 ; History: 1325 ; 14 June 1996: RLR/LJD - ver 1.0 1326 ; 21 July 1997: BEA - ver 1.1 1327 ; 23 Sept 1998: TTL - ver 1.2 1328 ;************************************************************************** 1329 X:00000A org x: 1330 1331 ; Codec control constants 1332 X:00000A CTRL_WD_HI ds 1 1333 X:00000B CTRL_WD_LO ds 1 1334 1335 1336 ; GPIO pin constants 1337 1338 ; ESSI0 - audio data GPIO mode 1339 ; DSP CODEC 1340 ; --------------------------- 1341 CODEC_RESET 1342 000000 equ 0 ; bit0 SC00 ---> CODEC_RESET~ 1343 1344 ; ESSI1 - control data GPIO Mode 1345 ; DSP CODEC 1346 ;---------------------------- 1347 000000 CCS equ 0 ; bit0 SC10 ---> CCS~ 1348 000001 CCLK equ 1 ; bit1 SC11 ---> CCLK 1349 000002 CDIN equ 2 ; bit2 SC12 ---> CDIN 1350 1351 ;************************************************************************** 1352 ; Initialize the CS4218 codec 1353 ; --------------------------- 1354 ; Serial Mode 4 (SM4), DSP Slave/Codec Master, 32-bits per frame 1355 ; 1356 ; After a reset, the control port must be written once to initialize it Motorola DSP56300 Assembler Version 6.2.0 99-12-04 14:25:33 ada_init.asm Page 8 1357 ; if the port will be accessed to read or write control bits. The initial 1358 ; write is a "dummy" write since the data is ignored by the codec. A second 1359 ; write is needed to configure the codec as desired. Then, the control port 1360 ; only needs to be written to when a change is desired, or to obtain status 1361 ; information. 1362 ; 1363 ; Although only 23 bits contain useful data in CDIN, a minimum of 31 bits 1364 ; must be written. 1365 ; 1366 ; CDIN 1367 ;------------------------------------------------ 1368 ; bit 31 0 1369 ;------------------------------------------------ 1370 ; bit 30 mask interrupt 1371 ; 0=no mask on MF5:\INT pin 1372 ; 1=mask on MF5:\INT pin 1373 ;------------------------------------------------ 1374 ; bit 29 DO1 1375 ;------------------------------------------------ 1376 ; bits 28-24 left output D/A sttenuation (1.5dB steps) 1377 ; 00000=No attenuation 0dB 1378 ; 11111=Max attenuation -46.5dB 1379 ;------------------------------------------------ 1380 ; bits 23-19 right output D/A attenuation (1.5dB steps) 1381 ; 00000=No attenuation 0dB 1382 ; 11111=Max attenuation -46.5dB 1383 ;------------------------------------------------ 1384 ; bit 18 mute D/A outputs 1385 ; 0=outputs ON 1386 ; 1=outputs MUTED 1387 ;------------------------------------------------ 1388 ; bit 17 input mux, left select 1389 ; 0=RIN1 1390 ; 1=RIN2 (used on EVM) 1391 ;------------------------------------------------ 1392 ; bit 16 input mux, right select 1393 ; 0=LIN1 1394 ; 1=LIN2 (used on EVM) 1395 ;------------------------------------------------ 1396 ; bits 15-12 left input A/D gain (1.5dB steps) 1397 ; 0000=No gain 0dB 1398 ; 1111=Max gain +22.5dB 1399 ;------------------------------------------------ 1400 ; bits 11-8 right input A/D gain (1.5dB steps) 1401 ; 0000=No gain 0dB 1402 ; 1111=Max gain +22.5dB 1403 ;------------------------------------------------ 1404 ; bits 7-0 00000000 1405 ;------------------------------------------------ 1406 ;************************************************************************** 1407 1408 1409 P:0001E8 org p: 1410 ada_init 1411 1412 ; reset ESSI ports Motorola DSP56300 Assembler Version 6.2.0 99-12-04 14:25:33 ada_init.asm Page 9 1413 P:0001E8 07F43F movep #$0000,x:M_PCRC ; reset ESSI0 port 000000 1414 P:0001EA 07F42F movep #$0000,x:M_PCRD ; reset ESSI1 port 000000 1415 1416 ; Set Control Register A and B 1417 P:0001EC 07F435 movep #$101807,x:M_CRA0 ; 12.288MHz/16 = 768KHz SCLK 101807 1418 ; prescale modulus = 8 1419 ; frame rate divider = 2 1420 ; 16-bits per word 1421 ; 32-bits per frame 1422 ; 16-bit data aligned to bit 23 1423 1424 P:0001EE 07F436 movep #$ff330c,x:M_CRB0 ; Enable REIE,TEIE,RLIE,TLIE, FF330C 1425 ; RIE,TIE,RE,TE0 1426 ; network mode, synchronous, 1427 ; out on rising/in on falling 1428 ; shift MSB first 1429 ; external clock source drives SCK 1430 ; (codec is master) 1431 ; RX frame sync pulses active for 1432 ; 1 bit clock immediately before 1433 ; transfer period 1434 ; positive frame sync polarity 1435 ; frame sync length is 1-bit 1436 1437 ; Configure GPIO pins -- (functionality and direction ) 1438 P:0001F0 07F43F movep #$0000,x:M_PCRC ; Enable GPIO pin 0 SC00=CODEC_RESET 000000 1439 P:0001F2 07F42F movep #$0000,x:M_PCRD ; Enable GPIO CSS (pin 0),CCLK (pin 1), CDIN (pin 2) 000000 1440 1441 P:0001F4 07F43E movep #$0001,x:M_PRRC ; set PC0=CODEC_RESET~ as output 000001 1442 P:0001F6 07F42E movep #$0007,x:M_PRRD ; set PD0=CCS~ as output 000007 1443 ; set PD1=CCLK as output 1444 ; set PD2=CDIN as output 1445 1446 ; Codec Reset 1447 P:0001F8 013D00 bclr #CODEC_RESET,x:M_PDRC ; assert CODEC_RESET~ 1448 P:0001F9 012D00 bclr #CCS,x:M_PDRD ; assert CCS~ -- allows control register to be writte n to 1449 1450 ; Delay to allow Codec to reset 1451 P:0001FA 06E883 do #1000,_delay_loop 0001FD 1452 P:0001FC 06E8A3 rep #1000 ; minimum 50 ms delay 1453 P:0001FD 000000 nop 1454 _delay_loop 1455 1456 1457 ; Setting up to send Codec control information Motorola DSP56300 Assembler Version 6.2.0 99-12-04 14:25:33 ada_init.asm Page 10 1458 P:0001FE 013D20 bset #CODEC_RESET,x:M_PDRC ; deassert CODEC_RESET~ 1459 1460 1461 ; Sending control words 1462 set_control 1463 P:0001FF 44F400 move #CTRL_WD_12,x0 ; transfer control value to control variable 000300 1464 P:000201 440A00 move x0,x:CTRL_WD_HI 1465 P:000202 240000 move #CTRL_WD_34,x0 1466 P:000203 440B00 move x0,x:CTRL_WD_LO 1467 P:000204 0BF080 jsr codec_control ; send in dummy control information 00020E 1468 P:000206 0BF080 jsr codec_control ; send in correct control information 00020E 1469 1470 1471 ; Set and enable interrupts 1472 P:000208 08F4BE movep #$000c,x:M_IPRP ; set interrupt priority level for ESSI0 to 3 00000C 1473 P:00020A 00FCB8 andi #$fc,mr ; enable interrupts 1474 1475 ; Set ESSI functionality 1476 P:00020B 07F43F movep #$003e,x:M_PCRC ; enable ESSI0 except SC00=CODEC_RESET 00003E 1477 1478 P:00020D 00000C rts 1479 1480 1481 ;------------------------------------------------------------- 1482 ; codec_control routine 1483 ; Input: CTRL_WD_LO and CTRL_WD_HI 1484 ; Output: CDIN 1485 ; Description: Used to send control information to CODEC 1486 ; NOTE: does not preserve the 'a' register. 1487 ;------------------------------------------------------------- 1488 codec_control 1489 P:00020E 200013 clr a 1490 P:00020F 012D00 bclr #CCS,x:M_PDRD ; assert CCS 1491 P:000210 548A00 move x:CTRL_WD_HI,a1 ; upper 16 bits of control data 1492 P:000211 0BF080 jsr send_codec ; shift out upper control word 000218 1493 P:000213 548B00 move x:CTRL_WD_LO,a1 ; lower 16 bits of control data 1494 P:000214 0BF080 jsr send_codec ; shift out lower control word 000218 1495 P:000216 012D20 bset #CCS,x:M_PDRD ; deassert CCS 1496 P:000217 00000C rts 1497 1498 1499 ;--------------------------------------------------------------- 1500 ; send_codec routine 1501 ; Input: a1 containing control information 1502 ; Output: sends bits to CDIN 1503 ; Description: Determines bits to send to CDIN 1504 ;--------------------------------------------------------------- 1505 1506 send_codec Motorola DSP56300 Assembler Version 6.2.0 99-12-04 14:25:33 ada_init.asm Page 11 1507 P:000218 061080 do #16,end_send_codec ; 16 bits per word 000224 1508 P:00021A 012D21 bset #CCLK,x:M_PDRD ; toggle CCLK clock high 1509 P:00021B 0ACC17 jclr #23,a1,bit_low ; test msb 000220 1510 P:00021D 012D22 bset #CDIN,x:M_PDRD ; send high into CDIN 1511 P:00021E 0AF080 jmp continue 000221 1512 bit_low 1513 P:000220 012D02 bclr #CDIN,x:M_PDRD ; send low into CDIN 1514 continue 1515 P:000221 0602A0 rep #2 ; delay 1516 P:000222 000000 nop 1517 P:000223 012D01 bclr #CCLK,x:M_PDRD ; restart cycle 1518 P:000224 200033 lsl a ; shift control word to 1 bit 1519 ; to left 1520 end_send_codec 1521 P:000225 00000C rts 1522 1523 1524 1525 1526 ;**************************************************************************** 1527 ; SSI0_ISR.ASM Ver.2.0 1528 ; Example program to handle interrupts through 1529 ; the 56307 SSI0 to move audio through the CS4218 1530 ; 1531 ; Copyright (c) MOTOROLA 1995, 1996, 1997, 1998 1532 ; Semiconductor Products Sector 1533 ; Digital Signal Processing Division 1534 ; 1535 ; 1536 ; History: 1537 ; 14 June 1996: RLR/LJD - ver 1.0 1538 ; 23 July 1997: BEA - ver 1.1 1539 ;****************************************************************************** 1540 1541 1542 ;----the actual interrupt service routines (ISRs) follow: 1543 1544 ;************************ SSI TRANSMIT ISR ********************************* 1545 ssi_txe_isr 1546 P:000226 013704 bclr #4,x:M_SSISR0 ; Read SSISR to clear exception flag 1547 ; explicitly clears underrun flag 1548 ssi_tx_isr 1549 P:000227 605F00 move r0,x:(r7)+ ; Save r0 to the stack. 1550 P:000228 055F20 move m0,x:(r7)+ ; Save m0 to the stack. 1551 P:000229 0501A0 move #1,m0 ; Modulus 2 buffer. 1552 P:00022A 608900 move x:TX_PTR,r0 ; Load the pointer to the tx buffer. 1553 P:00022B 000000 nop 1554 P:00022C 000000 nop 1555 P:00022D 000000 nop 1556 P:00022E 07D83C movep x:(r0)+,x:M_TX00 ; SSI transfer data register. 1557 P:00022F 600900 move r0,x:TX_PTR ; Update tx buffer pointer. 1558 P:000230 05FF20 move x:-(r7),m0 ; Restore m0. 1559 P:000231 60FF00 move x:-(r7),r0 ; Restore r0. Motorola DSP56300 Assembler Version 6.2.0 99-12-04 14:25:33 ada_init.asm Page 12 1560 P:000232 000004 rti 1561 1562 ;********************* SSI TRANSMIT LAST SLOT ISR ************************** 1563 ssi_txls_isr 1564 P:000233 605F00 move r0,x:(r7)+ ; Save r0 to the stack. 1565 P:000234 300400 move #TX_BUFF_BASE,r0 ; Reset pointer. 1566 P:000235 000000 nop 1567 P:000236 600900 move r0,x:TX_PTR ; Reset tx buffer pointer just in 1568 P:000237 000000 nop ; case it was corrupted. 1569 P:000238 60FF00 move x:-(r7),r0 ; Restore r0. 1570 P:000239 000004 rti 1571 1572 ;************************** SSI receive ISR ******************************** 1573 ssi_rxe_isr 1574 P:00023A 013705 bclr #5,x:M_SSISR0 ; Read SSISR to clear exception flag 1575 ; explicitly clears overrun flag 1576 ssi_rx_isr 1577 P:00023B 605F00 move r0,x:(r7)+ ; Save r0 to the stack. 1578 P:00023C 055F20 move m0,x:(r7)+ ; Save m0 to the stack. 1579 P:00023D 0501A0 move #1,m0 ; Modulus 2 buffer. 1580 P:00023E 608800 move x:RX_PTR,r0 ; Load the pointer to the rx buffer. 1581 P:00023F 000000 nop 1582 P:000240 000000 nop 1583 P:000241 000000 nop 1584 P:000242 075838 movep x:M_RX0,x:(r0)+ ; Read out received data to buffer. 1585 P:000243 600800 move r0,x:RX_PTR ; Update rx buffer pointer. 1586 P:000244 05FF20 move x:-(r7),m0 ; Restore m0. 1587 P:000245 60FF00 move x:-(r7),r0 ; Restore r0. 1588 P:000246 000004 rti 1589 1590 ;********************** SSI receive last slot ISR ************************** 1591 ssi_rxls_isr 1592 P:000247 605F00 move r0,x:(r7)+ ; Save r0 to the stack. 1593 P:000248 300000 move #RX_BUFF_BASE,r0 ; Reset rx buffer pointer just in 1594 ; case it was corrupted. 1595 P:000249 600800 move r0,x:RX_PTR ; Update rx buffer pointer. 1596 P:00024A 60FF00 move x:-(r7),r0 ; Restore r0. 1597 P:00024B 000004 rti 1598 1599 Y:000000 org y: 1600 Y:000000 diff dc $7fff00 1601 Y:000001 masksz dc $0f 1602 Y:000002 temp dc $0 1603 Y:000003 olda dc $0 1604 Y:000004 oldb dc $0 1605 Y:000005 newa dc $0 1606 Y:000006 newb dc $0 1607 Y:000007 greet dc $0a0d00 1608 Y:000008 dc "This program demonstrates 16-bit audio sampling on the " 1609 Y:00001B dc $0a0d00 1610 Y:00001C dc "Motorola DSP56303 with delta encoding using 1-16 bits." 1611 Y:00002E dc $0a0d00 1612 Y:00002F dc "Attach the audio input to the Line-In jack and speakers/headphones" 1613 Y:000045 dc $0a0d00 1614 Y:000046 dc "to the Headphone-Out jack. " 1615 Y:000050 dc $0a0d00 Motorola DSP56300 Assembler Version 6.2.0 99-12-04 14:25:33 pass_d~1.asm Page 13 1616 Y:000051 dc $0a0d00 1617 Y:000052 dc "Type 1-9 or A-G to get the different max delta sizes" 1618 Y:000064 dc $0a0d00 1619 Y:000065 dc "1=1 bit, G=16 bit" 1620 Y:00006B dc $0a0d00,$0a0d00 1621 Y:00006D dc "Maximum Delta (bits) :" 1622 Y:000075 dc $0a0d00 1623 Y:000076 dc "16 " 1624 Y:000077 dc $0 1625 Y:000078 crlf dc $0a0d00,$0 1626 1627 ;echo 1628 end 0 Errors 6 Warnings