Post Go back to editing

AD9576 programming problem via SPI

Hi, Im Juan.

I need to program the AD9576 via SPI, so I have set pins 22 and 49 high for this purpose. For the configuration of the registers I have used the ACE software, I have selected the reference correctly (ref1 = CMOS 200 MHz) and the outputs enabled but still nothing is displayed at the output. My biggest doubt is that the instruction word is not being sent correctly. My method is to configure the single instruction first through register 0x001 (SPI configuration B) and then update through register 0x00F (I/O update) and start sending address followed by data. It is worth mentioning that I do this by sending 8 byte packets and I don't know if this is a problem. I would like to know if there is a bug in this communication method.

Regards,

Juan Camilo Peña A.

Parents
  • Hi,

    please send me the cso file you created using the AD9576 evaluation software to see the SPI registers setting you target.

    I suppose you leave register 0x0000 to its default value of 0x00, which means the controller sends the LSB first and the address is decremented in a multibyte transfer.

    Then you set the register 0x0001 to use single instruction, which means the bit 7 is set to 1. This further means that a write operation contains only 3 bytes. I do not believe that sending 8 bytes is good. You may confuse the AD9576.

    To test you are executing correctly the write/read operations, please start by reading registers that have a non zero default value, like registers 0x0003, 0x0004, 0x0005, 0x0006.

    Then you begin writing one register, do IO Update and then you read it back (make sure the bit 5 of register 0x0001 is left at 0, the default value). 

    After you are sure you read/write register correctly, you move to the initialization procedure outlined below:

    Write all registers and then execute IO Update. Then execute the VCO calibration procedure (see page 34 in rev A data sheet), followed by a sync operation of the outputs (see page 37 in the data sheet).

    Petre

  • AD9576_RegisterMap.xls

    Hi Petre, thank you for answer.

    Below I attach the register map in xls format. Regarding the 8 byte, it was my mistake and I meant to say 8 bit. I do 8 bit transmissions to complete the 24 bit word in single instruction mode and as I mentioned I first modify register 0x001 to enable single instruction mode followed by an I/O update instruction. Checking the datasheet on page 42 (Implementation Specific Details) it mentions that Optional single-byte instruction mode: not supported, this makes me think that maybe I should always use streaming mode, correct me if I am wrong please.

  • Hi,

    first, I was asking you for the cso file because I supposed you used the AD9576 evaluation software to obtain the configuration. You sent me a xls file that when I try to open I am being told the file format and extension do not match and it may be corrupted.

    Please send me the cso file. 

    Regarding the optional single byte instruction mode not being enabled. This option would allow the SPI to receive a byte at a time and in between bytes, the CSB line would go high.  This is different from the bit 7 of register 0x0001 that when set to 1, "forces each data byte to be preceded by a new instruction". This basically states that  for example, during a write operation, you send 2 bytes as the instruction word and then a data byte corresponding to the value you want to write at the register address from the instruction word. If you send an additional data byte, this data byte will not be considered.

    So please follow the steps I indicated in my previous message to debug the SPI communication and then, after it works, follow the initialization procedure I indicated.

    Petre

  • AD9576.rar

    Thank you for answer Petre.

    This is the cso file. I will perform the read tests to verify that the SPI communication works and in case this SPI test is working correctly, what would be the step to change the streaming mode to single instruction mode if the default works with streaming decrement mode with initial address = 0x7FFF and I need to modify the register address 0x001 (bit 7).

    Regards,

    Juan Camilo Peña A.

  • Hi,

    for some reason, your configuration did not work on my evaluation board. I provided 50 MHz, 2dBm at REF1N terminal of the board (you have it as a CMOS input, so it cannot work directly on the evaluation board) and I set both PLL0 and PLL1 in your desired configuration. I set all the outputs at your frequencies, but I did not enter to set every output at the driver you desire. I also set REF0/1 SEL jumper to select REF1.

    You should just modify the REF1 input to be CMOS and set the right drivers for all the outputs.

    AD9576_setup_20211006.zip

    Petre

  • Hi Petre, I compared both CSO files and the difference in some register does not matter for my project, the parameters in the red boxes dont change my outputs. I think the register map isn't the problem.

    I don't have the evaluation board (only the ACE software to extract the register map configuration), my chip AD9576 is installed on our company manufactured PCB and I should control it through a PIC (using a SPI Master bus).

    I'm sorry to ask you again "¿What would be the first instructions words to program the AD9576 register map with the SPI, if I want to use a single instruction mode for the initialization or modify some registers?" Knowing the default is streaming - decrement mode and its first register address is 0x7FFF.  

    Because my current PIC project send the instructions words in this way (single instruction mode), for example: updated the register 0x0080 , the function REF1 Format = AC, followed by an I/O update instruction. 

    0x0080 -> 0x17 -> 0x000F -> 0x01

    Thanks in advance for your help.

    Juan Camilo Peña A. 

  • Hi,

     "¿What would be the first instructions words to program the AD9576 register map with the SPI, if I want to use a single instruction mode for the initialization or modify some registers?"

    I recommend:

    - take the register values from the cso file

    - change the register 0x0001 to 0x80 to enable the single instruction mode

    - write all the registers values into the AD9576

    Again, there is no need to do IO Update after every single write operation. Do it after you write all registers.

    It it was me doing this, I would do the following:

    - write the register 0x0000 with value 0x24, that is enable address ascension.

    -write then groups of registers following the contiguous registers from the cco file. For example, I would write registers 0x0001 to register 0xE in streaming mode. Then I would write registers 0x20 and 0x21, then register 0x40, then registers 0x80 to 0x83, etc. At the end, I would do IO Update.

    Then apply the reference clock and start the calibration of PLL0 VCO: set bit 3 of register 0x100 to 1, then poll register 0x20 for bit 2 until it becomes back 0 (is 1 during calibration) and then clear bit 3 of register 0x100 to 0.

    Then issue a sync command to PLL0 related dividers:

    Then issue a PLL1 sync: set bit 2 of register 0x200 to 1, issue IO Update, then clear bit 2 of register 0x200 to 0, issue IO Update.

    This should be it.

    You still did not tell me if you were able to read and write registers following the debug procedure I recommended

    Petre

  • Hi Petre,

    I tried to read registers 0x004, 0x00C and 0x120 because they have a non zero default value but my test didn´t work. I think it's my SPI PIC configuration but I have a question, to read the SDI/SDO bus (pin 15) should 8 clock cycles be done after the last byte (LSB address) by sending a 0x00 or should it be done on the falling edges of the SCK ?

  • Hi,

    when the SPI sends data bytes, it puts the bits on the positive edges of SCLK (i.e. low to high transitions). The AD9576 samples them on the negative edges of SCLK (i.e. positive to negative transitions).

    Then, when the AD9576 sends bits back to the controller, it does the same: it puts bits on the positive edge of SCLK and the controller receives them on the negative edge.

    So you have to set the controller to continue to send SCLK clocks after the 16 bits instruction header for the AD9576 to be able to respond.

    If you want to read only a 8 bit word, send 8 SCLK clocks after the first 16 bits and SCLK clocks.

    Petre

  • Hi Petre,

    Sorry for dont answer before. I dont had the hardware with the AD9576 inside it. 

    I made the test that you told me about read the deafult registers of AD9576, with this test I verified the SPI communication is in MSB mode. My SPI master is a PIC in mode 0, with the SDI and SDO in different pins. I dont know if this could be the problem.

    I send 3 bytes, the first and second has the register address in read mode, the third one byte contains a 0x00, this is a dummy byte to have the SCK one more byte, to return the default value. But the voltage of the data read was of 1V.

    CLKGEN: mode = RD, register address = 0x004, default value = 0x4F

    CLKGEN: mode = RD, register address = 0x00C, default value = 0x56

    Could you help me with this, please.

    Thanks in advance and best regards.

    Juan Camilo Peña A.

  • Hi,

    "I send 3 bytes, the first and second has the register address in read mode, the third one byte contains a 0x00, this is a dummy byte to have the SCK one more byte, to return the default value. But the voltage of the data read was of 1V."

    I believe sending 0x00 as the 3rd byte creates a contention with the AD9576 trying to send the register value back to the controller. There must be a SPI setting in the controller that allows you to send a clock to the AD9576 on the SCLK line without putting a byte on its SDO line.

    Petre

Reply
  • Hi,

    "I send 3 bytes, the first and second has the register address in read mode, the third one byte contains a 0x00, this is a dummy byte to have the SCK one more byte, to return the default value. But the voltage of the data read was of 1V."

    I believe sending 0x00 as the 3rd byte creates a contention with the AD9576 trying to send the register value back to the controller. There must be a SPI setting in the controller that allows you to send a clock to the AD9576 on the SCLK line without putting a byte on its SDO line.

    Petre

Children