.module/ram/abs=0 UDIAG2; .pagelength 59; { Works for .LST files with 550C } .include ; {****************************************************************************** * * udiag3.dsp - Frequency-Sweeping version of udiag2. * Programs from between 124.0 and 128.4 MHz in 0.2 MHz steps. * PLL on both LO's is monitored inbetween steps, with status * sent to LED (as per udiag2 method). * * KA7EXM 26 Sep 2002 * Built-upon W7PUA's udiag2.dsp program (thanks Bob!) * *****************************************************************************} {******************** Interrupt vector table *******************************} { A jump to location 0 occurs when the dsp is reset } jump start; rti; rti; rti; {00: reset } rti; rti; rti; rti; {04: IRQ2 } { Filler instr } rti; rti; rti; rti; {08: IRQL1 } rti; rti; rti; rti; {0c: IRQL0 } rti; rti; rti; rti; {10: SPORT0 tx } rti; rti; rti; rti; {14: SPORT0 rx } rti; rti; rti; rti; {18: IRQE } rti; rti; rti; rti; {1c: BDMA } rti; rti; rti; rti; {20: SPORT1 tx or IRQ1 } rti; rti; rti; rti; {24: SPORT1 rx or IRQ0 } rti; rti; rti; rti; {28: timer } rti; rti; rti; rti; {2c: power down } {***************************** START ***************************************} start: imask=0; { Turn off all interrupts } reset fl0; reset fl1; reset fl2; ax0 = B#0111101111000000; { PF6 and PF7 as outputs } dm(PFTYPE) = ax0; ax0 = B#00000000; { Initialize to 0 } dm(PFDATA) = ax0; call dly5000; { Wait 5 sec } mx1 = 0x8960; call prog_pll; { 126.0 MHz } pll1: mx1 = 0x8340; call prog_pll; { 124.0 MHz } mx1 = 0x8410; call prog_pll; { 124.2 MHz } mx1 = 0x8460; call prog_pll; { 124.4 MHz } mx1 = 0x8530; call prog_pll; { 124.6 MHz } mx1 = 0x8600; call prog_pll; { 124.8 MHz } mx1 = 0x8650; call prog_pll; { 125.0 MHz } mx1 = 0x8720; call prog_pll; { 125.2 MHz } mx1 = 0x8770; call prog_pll; { 125.4 MHz } mx1 = 0x8840; call prog_pll; { 125.6 MHz } mx1 = 0x8910; call prog_pll; { 125.8 MHz } mx1 = 0x8960; call prog_pll; { 126.0 MHz } mx1 = 0x8A30; call prog_pll; { 126.2 MHz } mx1 = 0x8B00; call prog_pll; { 126.4 MHz } mx1 = 0x8B50; call prog_pll; { 126.6 MHz } mx1 = 0x8C20; call prog_pll; { 126.8 MHz } mx1 = 0x8C70; call prog_pll; { 127.0 MHz } mx1 = 0x8D40; call prog_pll; { 127.2 MHz } mx1 = 0x8E10; call prog_pll; { 127.4 MHz } mx1 = 0x8E60; call prog_pll; { 127.6 MHz } mx1 = 0x8F30; call prog_pll; { 127.8 MHz } mx1 = 0x9000; call prog_pll; { 128.0 MHz } mx1 = 0x9050; call prog_pll; { 128.2 MHz } mx1 = 0x9120; call prog_pll; { 128.4 MHz } jump pll1; { endless loop } { The main sequence to program the PLL. Note the main variable is set in register mx1 (you're not using the alu right now, so it was free } prog_pll: sr0 = 0; call serout; { 3 words to program 35 bits } sr0 = 0X8FA1; call serout; { of serial data, including } sr0 = 0X8804; call serout; { the 126 MHz synthesizer } ax0 = b#10000000; { The enable pulse } dm(PFDATA) = ax0; { Latch the data } call dlyr1; { 104 microsecond delay } ax0 = 0; dm(PFDATA) = ax0; { Latch pulse back to zero } call dlyr1; sr0 = 1; call serout; { Now 3 more words for the } sr0 = mx1; call serout; { 126 MHz freq, value by user in mx1 } sr0 = 0X8804; call serout; { and full gain } ax0 = b#10000000; { The enable pulse } dm(PFDATA) = ax0; { Latch the data } call dlyr1; { 104 microsecond delay } ax0 = 0; dm(PFDATA) = ax0; { Latch pulse back to zero } call dlyr1; {--------------------- Program U7 for 19.68 MHz ---------------------------} ax0=dm(PFDATA); { Get ready to work on it } ar=setbit 6 of ax0; { Set bit 6 un-enables serial 145170 } dm(PFDATA)=ar; call delayr01; { Initialize the 145170 synthesizer: } reset FL0; { Data line to 0 } cntr=4; { 1st half reset 145170 } do p1loop until ce; call delayr01; { Setup data with rfi filters } set FL2; { Clock in data } call delayr01; reset FL2; { End clock pulse } p1loop: nop; call delayr01; sr0=0X1000; cntr=5; { 2nd half of reset 145170 } call prog19; call delayr01; sr0=0XF700; cntr=8; { C register } call prog19; call delayr01; sr0=0X03E8; cntr=15; { R register, 10.0 MHz Xtal } call prog19; call delayr01; { N is 19680/20 = 984 or 0X03D8 } sr0=0X03D8; cntr=16; { N register } call prog19; {----------------------------------------------------------------} { The main delay sequence. Test it quick, wait a short amount and test it again. You might see a slight flicker at each frequency step...but it WILL go out before stepping to the next frequency, provided the circuit locks at that step } call test_pll; call dly100; { 100mS } call test_pll; call dly1000; call test_pll; call dly1000; call test_pll; call dly1000; call test_pll; rts; test_pll: ax0 = dm(PFDATA); ar = tstbit 3 of ax0; if eq jump tg1; reset fl1; rts; tg1: set fl1; rts; rts; dly1000: cntr = 10; { 1 second delay } do d1000a until ce; call dly100; d1000a: nop; rts; { end udiag3 } {-------------------------- Subroutines ------------------------} { Note the terminology on the delays. 5000 is 5000 millisec or 5 sec. r01 is .01 millisec or 10 microseconds, etc (r is a decimal point.) } dly5000: cntr = 48; { 4.8 second delay } do d5000a until ce; call dly100; d5000a: nop; rts; dly100: cntr = 1000; { 100 msec delay } do d100a until ce; call dlyr1; d100a: nop; rts; dlyr1: ax0 = 3333; { 100 usec delay } cntr = ax0; do d1a until ce; d1a: nop; rts; dlyr021: ax0 = 694; { 20.8 usec delay } cntr = ax0; do d208 until ce; d208: nop; rts; { Following does any needed programming of shift-registers/synth } { 16 bits of data arrives in sr0, which is destroyed. } serout: cntr = 16; { Clock out 16 bits } do solp until ce; ar=tstbit 15 of sr0; sr=lshift sr0 by 1 (lo); { Move bits over, status unaffected } if eq jump soa; set fl0; { Data line to 1 } jump sod; soa: reset fl0; { Data line to 0 } sod: call dlyr021; set fl2; { Clock line to high } call dlyr1; { Delay 100 mS } reset fl2; { Clock fall } call dlyr1; solp: nop; rts; { Routine to program Motorola 145170A synthesizer for 19.68 MHz LO. cntr determines number of bits being programmed which in turn in the 145170 determines which register is to be programmed. sr0 is the data to be programmed, MSB first. Intended to be used during initialization. RSL 5 May 98 } prog19: ax0=dm(PFDATA); { Get ready to work on it } ar=clrbit 6 of ax0; { Clear bit 6 enables serial 145170 } dm(PFDATA)=ar; do pr19loop until ce; af=tstbit 15 of sr0; { Get data bit to status } sr=lshift sr0 by 1 (lo); { Move bits over, status uneffected } if lt jump pr19a; { Data line to be a 1 } reset fl0; { Here for data line=0 } jump pr19b; { Go clock it out } pr19a: set fl0; { Data line=1 } pr19b: call delayr01; { Setup data with rfi filters } set fl2; { Clock in data } call delayr01; reset fl2; { End clock pulse } call delayr01; pr19loop: nop; ax0=dm(PFDATA); { Get ready to work on it } ar=setbit 6 of ax0; { Set bit 6 un-enables serial 145170 } dm(PFDATA)=ar; rts; delayr01: { Delay 10 microsecond } cntr=330; do dylp until ce; dylp: nop; rts; .endmod;