Programming LMX2306 PLL chip

Does anyone have experience with the LMX PLL synthesizers? I'm trying to send the three registers (R, N and F)
with the attached code. But it somehow won't work.
Data, Clock and Le are properly connected and the values are correctly calculated with the Code Loader App.
LMX_Arduino.ino (1.5 KB)

Can you pleas give a link to this product or chip, along with a schematic of what your hardware is.

This is the link to the chip (lmx2306) I use:
https://www.google.ch/url?sa=t&source=web&rct=j&url=https://www.farnell.com/datasheets/4907.pdf&ved=2ahUKEwjngNurhuX9AhUn6LsIHfuQCEIQFnoECA0QAQ&usg=AOvVaw0RKeZNGY4Tc-jh0Od_zSBg

And attached the circuit.

Thanks for that. I am assuming you are a Radio Ham. So am I.

However, unfortunately as this is an Arduino forum I have no experience of the PIC16F870 processor.
Sorry.

Oh, no I'm not using the Pic. Im using a Arduino Nano instead of the 16F870.
And yes, I'm a Ham :wink:

Hi,
Can you post a link to where you got the diagram and if there is any code or explanation with?

Thanks... Tom.... :smiley: :+1: :coffee: :australia:

Sure! The Circuit is on this site:
https://www.rfcandy.biz/communication/fm_500.html

So can you show the Arduino wiring you have?

The wiring is according to the this sketch:
LMX_Arduino.ino (1.5 KB)
(Pin9, 10 and 11)

Hi,
Your code.

/*
  LMX2330/2331/2332 "Three wire interface" control with Arduino 
  Source:http://www.g8ajn.tv/dlother3.html
  Modified by YO4HFU
  Arduino pins: LE = Pin 9, DATA = Pin 10,  CLK = Pin 11
 */
 
  const unsigned long IF_R = 0x360028; //Calculated by Code Loader 4 software
  const unsigned long IF_N = 0x107C21; //IF_N counter connected to FoLD pin. Divider 1000 P=16
  const unsigned long RF_R = 0x6002A;
  const unsigned long RF_N = 0x1EA3;
  unsigned long DTA;
  int bp;
  const int LE = 9;
  const int DATA = 10;
  const int CLK = 11;

void setup() {       
  pinMode (LE, OUTPUT);  // latch enable
  pinMode (CLK, OUTPUT);  // clock
  pinMode (DATA, OUTPUT);  // data
  
  digitalWrite(LE,LOW);
  digitalWrite(CLK,LOW);

  // to loop for testing uncomment 3 lines below
 // while(true) { // TEST While to loop for scope
    
 DTA = IF_R;    // Send setup parameters
 SendWord();
 
 DTA = IF_N;
 SendWord();
 
 DTA = RF_R;
 SendWord();

 DTA = RF_N;
 SendWord();
  
//delayMicroseconds(2000); // TEST scope delay between groups

// }   // TEST While to keep looping for testing
}



void loop() {  // loop forever
}

int SendWord() {
  
  bp = 22;
  do{
  bp = bp - 1;   //loop through bit positions 22 to 0
  digitalWrite(CLK,LOW); 
  digitalWrite(DATA, bitRead(DTA,bp) ); 
  digitalWrite(CLK,HIGH); 
  }while(bp>0);
  
  digitalWrite(CLK,LOW); 
  digitalWrite(DATA,LOW);

  digitalWrite(LE,HIGH);   // Set LE to latch data
  delayMicroseconds(4);
  digitalWrite(LE,LOW);

}

To add code please click this link;

Thanks.. Tom.. :smiley: :+1: :coffee: :australia:

In that sketch you never actually execute any of the functions you have written to talk to the PLL chip.

void loop() {  // loop forever
}

You need to call your functions in here. You don't call anything.

Sorrys guys, I uploaded the wrong code version. This is the correct code below. But @Grumpy_Mike, I am actually calling the funtions in setup, but just once. I don't think that I need to call them constantly in a loop, correct?

  LMX2330/2331/2332 "Three wire interface" control with Arduino 
  Source:http://www.g8ajn.tv/dlother3.html
  Modified by YO4HFU
  Arduino pins: LE = Pin 9, DATA = Pin 10,  CLK = Pin 11
 */
 
  const unsigned long R_Reg = 0x0000320; //Calculated by Code Loader 4 software
  const unsigned long N_Reg = 0x0807911; //
  const unsigned long F_Reg = 0x0000092;

  unsigned long DTA;
  int bp;
  const int LE = 9;
  const int DATA = 10;
  const int CLK = 11;

void setup() {       
  pinMode (LE, OUTPUT);  // latch enable
  pinMode (CLK, OUTPUT);  // clock
  pinMode (DATA, OUTPUT);  // data
  
  digitalWrite(LE,LOW);
  digitalWrite(CLK,LOW);

  // to loop for testing uncomment 3 lines below
//while(true) { // TEST While to loop for scope
    
 DTA = R_Reg;    // Send setup parameters
 SendWord();
 
 DTA = N_Reg;
 SendWord();
 
 DTA = F_Reg;
 SendWord();


  
//delayMicroseconds(2000); // TEST scope delay between groups

 //}   // TEST While to keep looping for testing
}



void loop() {  // loop forever
}

int SendWord() {
  
  bp = 22;
  do{
  bp = bp - 1;   //loop through bit positions 22 to 0
  digitalWrite(CLK,LOW); 
  digitalWrite(DATA, bitRead(DTA,bp) ); 
  digitalWrite(CLK,HIGH); 
  }while(bp>0);
  
  digitalWrite(CLK,LOW); 
  digitalWrite(DATA,LOW);

  digitalWrite(LE,HIGH);   // Set LE to latch data
  delayMicroseconds(4);
  digitalWrite(LE,LOW);

}

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.