'********************************************************************************* 'Program to interface to the NATIONAL SEMICONDUCTOR LMX2316 'PLL Frequency Synthesizer. Data sent is 21 bits long. '--------------------------------------------------------------------------------- 'Steven Kosmerchock 'Phoenix, Arizona, USA '--------------------------------------------------------------------------------- ' *** Revision History *** 'REV. 1.00A ***** 02/10/2003 SK (Initial Release) [STATUS]:WORKS!! ' ' ' ' '--------------------------------------------------------------------------------- '--------------------------- ***************-------------------------------------- '*************************** LMX2316_56.BS2 ************************************** '---------------------------****************-------------------------------------- 'Program uses port "PP13" for control of "LOAD ENABLE (LE)", port "P11" for "CLOCK (CLK)", 'and port "P15" for "DATA (DATA)". This program sets the value of the PLL for 56.0MHz. 'Uses a BS2 as the processor. The LMX2316 is set-up as follows: REF OSC of 20MHz, Phase Detector Frequency 'of 250kHz, R Counter=80, N Counter=224, Phase Detector Polarity is POS(+), Charge 'Pump Gain is "HIGH" and Charge Pump State is "ACTIVE". '--------------------------------------------------------------------------------- ' LSB DATA MSB ' 'Data is shifted MSB first!! '--------------------------------------------------------------------------------- ' **** PIN ASSIGNMENTS **** ' BS2 --- to --- PLL (LMX2316) '"P15" to PIN 12 (DATA) '"P14" to PIN 11 (CLK) '"P13" to PIN 13 (LE) '--------------------------------------------------------------------------------- OUTPUT 15 'P15 as an output pin. Used to TX register data for PLL. OUTPUT 14 'P14 as an output pin. Used as a clock for transfer of register data for PLL. OUTPUT 13 'P13 as an output pin. Used to control the load enable for PLL. ' OUT13=0 'Start with "LE" LOW. 'start 'Beginning of routine. ' ' 'Data for RF R Counter of LMX2316 PLL. ' 'Shiftout 20, 19, 0 [%00XXXXXXXXXXXXXXXXXXXX\21)"BINARY Value SHIFTOUT 15, 14, 1, [$10] 'Data (b'00010000') to be sent to "RF R COUNTER" of PLL. SHIFTOUT 15, 14, 1, [$01] 'Data (b'00000001') to be sent to "RF R COUNTER" of PLL. SHIFTOUT 15, 14, 1, [$40] 'Data (b'01000000') to be sent to "RF R COUNTER" of PLL. 'Data (b'00100000') to be sent to "Rf R COUNTER" of PLL. PULSOUT 13, 1 'PULSE "LE" for 2uS. ' ' 'Data for IF N Counter of LMX2316 PLL. ' 'Shiftout 20, 19, 0 [%10XXXXXXXXXXXXXXXXXXXX\21)"BINARY Value SHIFTOUT 15, 14, 1, [$10] 'Data (b'00010000') to be sent to "IF N COUNTER" of PLL. SHIFTOUT 15, 14, 1, [$03] 'Data (b'00000011') to be sent to "IF N COUNTER" of PLL. SHIFTOUT 15, 14, 1, [$81] 'Data (b'10000001') to be sent to "IF N COUNTER" of PLL. PULSOUT 13, 1 'PULSE "LE" for 2uS. ' ' ' 'Data for IF F Counter of LMX2316 PLL. ' 'Shiftout 20, 19, 0 [%01XXXXXXXXXXXXXXXXXXXX\21)"BINARY Value SHIFTOUT 15, 14, 1, [$00] 'Data (b'00000000') to be sent to "IF F COUNTER" of PLL. SHIFTOUT 15, 14, 1, [$00] 'Data (b'00000000') to be sent to "IF F COUNTER" of PLL. SHIFTOUT 15, 14, 1, [$92] 'Data (b'10010010') to be sent to "IF F COUNTER" of PLL. PULSOUT 13, 1 'PULSE "LE" for 2uS. ' start GOTO start 'Loop back!! ' END 'End of program!