This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

my cdce913 not working

Other Parts Discussed in Thread: CDCE913

I have my microchip pic18f452 to control cdce913 with ccs c compiler . For testing purpose I use Y1 to output 1MHz clock using 24M crystal , 10p cap  and S0 connected to 3.3V , VDDOUT connected to 3.3V , pull up resistor 4.7k connected to SDA and SCL , pin 4 no connection . Block Write Programming Sequence is used ,  the following codes is my program . No matter I try many times Y1 still no output , as my MCU is good , can someones decode my program to see anythings wrong with my c code ???

#include <18F452.h>

#fuses HS,NOWDT,NOPROTECT
#use I2C(master, sda=PIN_c0, scl=PIN_c1)
#use delay(clock=40000000)
main()

    i2c_start();
   i2c_write(0xca);
   i2c_write(0x65);
   i2c_write(0x20);
   i2c_write(0x01);
   i2c_write(0x00);
   i2c_write(0x34);
   i2c_write(0x18);
   i2c_write(0x02);
   i2c_write(0x50);
   i2c_write(0x40);
   i2c_write(0x00);
   i2c_write(0x00);
   i2c_write(0x00);
   i2c_write(0x00);
   i2c_write(0x00);
   i2c_write(0x00);
   i2c_write(0x00);
   i2c_write(0x00);
   i2c_write(0x00);
   i2c_write(0x00);
   i2c_write(0x00);
   i2c_write(0x00);
   i2c_write(0x00);
   i2c_write(0xed);
   i2c_write(0x02);
   i2c_write(0x00);
   i2c_write(0x00);
   i2c_write(0x6a);
   i2c_write(0x4a);
   i2c_write(0xa3);
   i2c_write(0x4c);
   i2c_write(0x00);
   i2c_write(0x40);
   i2c_write(0x02);
   i2c_write(0x08);
   i2c_stop();
   while(1);

    }

  • The first byte of the I2C protocol (slaveAddress plus write)= “CA”, when trying to communicate with a CDCE913 with default EEPROM looks ok.

    The next i2c_write(0x65) has to be set according to the commandCode syntax that you can find in the datasheet. There bit 7 is set to 0, so it is set to do a block write, and the rest is the offset address for this operation in your code it is set to 01100101, that would be offset byte number 101 in decimal. The number of bytes of the configurationRegister is a maximum of 31 bytes. I would suggest to change this i2c_write(0x65) to i2c_write(0x00), as based on your code the intention is writing the whole configuration register.

                                  

    The 3rd line: i2c_write(0x20) is giving the number of bytes that would be written (byte Count=N), but in your case 0x20 is 32, which should be changed to 31 if you want to write all the configuration register, that would be i2c_write(0x1F)

     

    For more information please take a look at the following application notes:

    http://focus.ti.com/general/docs/lit/getliterature.tsp?literatureNumber=scaa106&fileType=pdf

    http://focus.ti.com/general/docs/litabsmultiplefilelist.tsp?literatureNumber=scaa105

     

    Please let me know if the issue was solved

     

  • Dear Sir:

      I don't understand the

    “The 3rd line: i2c_write(0x20) is giving the number of bytes that would be written (byte Count=N), but in your case 0x20 is 32, which should be changed to 31 if you want to write all the configuration register, that would be i2c_write(0x1F)“

     

    CDCE913 have 32 registers, so N should be 32, which means 0x20=32 is correct,

     

    why do you want change from 32 to 31?

     

    char Register_913[32]; //CDCE913 registter 

    i2c_write(0xCA) ;// CDCE913   ID code;

    i2c_write(0x00) ;//offset address

    i2c_write(0x20) ;//block write number

    for(i=0;i<32,i++)

    {

      i2c_write(Register_913[i]);

    }

  • Sorry for the late response,

    I think that i2c_write(0x1f) should work for you. Please let me know if it worked.

  • Sorry,Sir.

    It doesn't work as you think, because it has only 31 ,

    from Register0 to Register 31,  there're 32  number of registers.

    for block write, we should use  i2c_write(0x1f) for whole CDCE913 Register configuration.

    Please help to check it, thanks!

    2011/3/9

  • SORRY,

    i2c_write(0x1f)  should be i2c_write(0x20)!

  • Did you change the second line?

    i2c_start();
       i2c_write(0xca); %slave address and type of operation
       i2c_write(0x00); %command code: offset for the block write is 0, so it starts writing from address 0, and it defines the block write
       i2c_write(0x20); %number of bytes to be written after the offset given
       i2c_write(0x01); %bytes to be written
       i2c_write(0x00);
       i2c_write(0x34);
       i2c_write(0x18);
       i2c_write(0x02);
       i2c_write(0x50);
       i2c_write(0x40);
       i2c_write(0x00);
       i2c_write(0x00);
       i2c_write(0x00);
       i2c_write(0x00);
       i2c_write(0x00);
       i2c_write(0x00);
       i2c_write(0x00);
       i2c_write(0x00);
       i2c_write(0x00);
       i2c_write(0x00);
       i2c_write(0x00);
       i2c_write(0x00);
       i2c_write(0x00);
       i2c_write(0xed);
       i2c_write(0x02);
       i2c_write(0x00);
       i2c_write(0x00);
       i2c_write(0x6a);
       i2c_write(0x4a);
       i2c_write(0xa3);
       i2c_write(0x4c);
       i2c_write(0x00);
       i2c_write(0x40);
       i2c_write(0x02);
       i2c_write(0x08);
       i2c_stop();
       while(1);

  • Dear Sir:

       Today, I read the datasheet again, and find that, the first Byte Register of CDCE913 is read only.

    so we can write from Address of offset of 0x01 instead of 0x00;

     

      i2c_start();
       i2c_write(0xca); %slave address and type of operation

       i2c_write(0x00); %command code: offset for the block write is 0, so it starts writing from address 0, and it defines the block write

      i2C_write(0x01);// It's ok, but for the Readonly register, I think we should write from address 0x01,How do you think about it?

       i2c_write(0x1F); %number of bytes 

    next is the write data to registers.then stop

    Sir, can you give out the C code for  fellowing  three functions? 

     i2c_start();

    i2c_write();

    i2c_stop();

    because my MCU has no hardware support, I only use the general IO port to simulate the I2C communication, So I need the C code for MCU and CDCE913 communicate.

    thanks!

     

  • Hi,

    In that case if you would like to start from byte address one, then the first byte that you wrote youd be removed. But trying to write in a read only address will not be a problem it will even give back acknowledgement it is just that writing that byte will never happen.

       i2c_start();
       i2c_write(0xca);
       i2c_write(0x01);
       i2c_write(0x1F);

     >>>delete this line >>>i2c_write(0x01);

       i2c_write(0x00);
       i2c_write(0x34);
       i2c_write(0x18);
       i2c_write(0x02);
       i2c_write(0x50);
       i2c_write(0x40);
       i2c_write(0x00);
       i2c_write(0x00);
       i2c_write(0x00);
       i2c_write(0x00);
       i2c_write(0x00);
       i2c_write(0x00);
       i2c_write(0x00);
       i2c_write(0x00);
       i2c_write(0x00);
       i2c_write(0x00);
       i2c_write(0x00);
       i2c_write(0x00);
       i2c_write(0x00);
       i2c_write(0xed);
       i2c_write(0x02);
       i2c_write(0x00);
       i2c_write(0x00);
       i2c_write(0x6a);
       i2c_write(0x4a);
       i2c_write(0xa3);
       i2c_write(0x4c);
       i2c_write(0x00);
       i2c_write(0x40);
       i2c_write(0x02);
       i2c_write(0x08);
       i2c_stop();
       while(1);

  • DearSir:

     

       can you give out the C code for  fellowing  three functions? 

     i2c_start();

    i2c_write();

    i2c_stop();

    Thanks a lot!

  • The i2c_start, write and stop are part of a DVSDK from Linux fro the DM6467. They would be available in any package PSP for the processor used to generate the I2C protocol.

  • sorry  for the late reply , i2c_start and i2c write and stop are the built in library of ccs c compiler . As I cannot enter this forum when I login this forum , after I login the web  page show blank page , not just this forum mirosoft msdn c#  forum I also cannot enter . I use IE 8 and secruity level is chosen low , this problem also occured , so can TI staff help me solve this problem ???

  • Dear Sir:

     

         CDCE913 the Absolute maximum raing of VDD is 2.5V, and recommeded maximum rating of VDD is 1.9V

     The recommend maximum rating of VDDout  is 3.6V, do you know the Absolute maximum Rating of VDDout of CDCE913?

    tnanks a lot!

    2011/4/22

     

  •  Dear Sir,

    the AMR of Vddout of CDCE913 is -0.5V to 4.6V. Pls notice, stresses beyond those ratings may cause permanent damage to the device. These are stress ratings only and functional operation of the device at these or any other conditions beyond those indicated under recommended operating conditions is not implied.

    Regards,

    Georg Becke.