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.

CDCE913 Programming Issues

Other Parts Discussed in Thread: CDCE913, CLOCKPRO
Hello,

We are working on CDCE913 with following configuration:

1. S0 Pin Status: Connected to 1.8V

2. We want to turn ON the PLL 

3. Expected O/P Frequency:
  Y1 = 0.1MHz
Y2 = 1MHz
Y3 = 10MHz

4. Data Loaded to the CDCE913:
Bit  ==>  76543210
Byte 00 - 00000001
Byte 01 - 00000000
Byte 02 - 10110111
Byte 03 - 11101000
Byte 04 - 00000010
Byte 05 - 01010000
Byte 06 - 01000000
Byte 07 - 00000000
Byte 08 - 00000000
Byte 09 - 00000000
Byte 10 - 00000000
Byte 11 - 00000000
Byte 12 - 00000000
Byte 13 - 00000000
Byte 14 - 00000000
Byte 15 - 00000000
Byte 16 - 00000000
Byte 17 - 00000000
Byte 18 - 00000000
Byte 19 - 00000000
Byte 20 - 01101101
Byte 21 - 00000010
Byte 22 - 01100100
Byte 23 - 00001010
Byte 24 - 11111111
Byte 25 - 10100000
Byte 26 - 00000010
Byte 27 - 10000100
Byte 28 - 00000000
Byte 29 - 01000000
Byte 30 - 00000010
Byte 31 - 00001000

Currently we are facing a problem in programming the chip.

We are able to see the Clock and Data pulses on the SCLK and SDA pin but nothing is changing on the O/P, so we are not sure that the data is loaded on to the CDCE913 or not.

The O/P which we are getting currently is the default setting O/P.


Please guide.

Regards,
Richa


  • Hi Richa,

    Can you provide the sequence of I2C transactions you are using to communicate with the device? If no changes are being seen, the devices are not communicating over I2C properly. Could you provide a screen shot of the SDA and SCL lines to verify the data transactions?

    Also, in Byte 1 bits [1:0], the device address is being changed so subsequent transactions may not be valid if the target address is not changed.

    Gabe

  • Hi Gabe!

    Thank you very much for the suggestion.

    This is the sequence which I am following for the programming.

    I2CA_Init();

    I2ca_create_Byte(&dat, 0xCA);// Device address
    I2ca_create_Byte(&dat, 0x81);// Byte write with offset = 1

    I2ca_create_Byte(&dat, 0x81);//00
    I2ca_create_Byte(&dat, 0x01);//01
    I2ca_create_Byte(&dat, 0xB4);//02
    I2ca_create_Byte(&dat, 0xE8);//03
    I2ca_create_Byte(&dat, 0x02);//03
    I2ca_create_Byte(&dat, 0x50);//05
    I2ca_create_Byte(&dat, 0x40);//06
    I2ca_create_Byte(&dat, 0x00);//07
    I2ca_create_Byte(&dat, 0x00);//08
    I2ca_create_Byte(&dat, 0x00);//09
    I2ca_create_Byte(&dat, 0x00);//0A
    I2ca_create_Byte(&dat, 0x00);//0B
    I2ca_create_Byte(&dat, 0x00);//0C
    I2ca_create_Byte(&dat, 0x00);//0D
    I2ca_create_Byte(&dat, 0x00);//0F
    I2ca_create_Byte(&dat, 0x00);//10
    I2ca_create_Byte(&dat, 0x00);//11
    I2ca_create_Byte(&dat, 0x00);//12
    I2ca_create_Byte(&dat, 0x00);//13
    I2ca_create_Byte(&dat, 0x6D);//14
    I2ca_create_Byte(&dat, 0x02);//15
    I2ca_create_Byte(&dat, 0x64);//16
    I2ca_create_Byte(&dat, 0x05);//17
    I2ca_create_Byte(&dat, 0xFF);//18
    I2ca_create_Byte(&dat, 0xA0);//19
    I2ca_create_Byte(&dat, 0x02);//1A
    I2ca_create_Byte(&dat, 0x84);//1B
    I2ca_create_Byte(&dat, 0x00);//1C
    I2ca_create_Byte(&dat, 0x40);//1D
    I2ca_create_Byte(&dat, 0x02);//1E
    I2ca_create_Byte(&dat, 0x08);//1F

    Please guide.

    Regards,

    Richa

  • Hello,

    is anybody having a code for programming the CDCE913?

    I am struggling on the issue for 3-4 days but nothing is happening. I am able to observe the pulses on SCLK and SDA, but it is difficult to analyze. Please suggest.

    Regards,

    Richa

  • Hello,

    Please let me know, if any major error is there in my code or code writing style.

    Regards,

    Richa

    #include "DSP28x_Project.h"
    
    int delay_3, delay_4, Start_Programming;
    
    struct I2C_Data {
    	int count;
    	char CMD[8];
    	char DATA[8];
    };
    
    void I2CA_WriteData(struct I2C_Data *ptr);
    void I2CA_Init(void);
    void I2ca_create_Byte(struct I2C_Data *ptr, char ch);
    struct I2C_Data dat;
    
    interrupt void xint1_isr(void);
    void main(void)
    {
    	Start_Programming = 0;
    	// Step 1. Initialize System Control:
    	InitSysCtrl();
    
    	// Step 2. Initalize GPIO:
    	InitI2CGpio();
    
    	EALLOW;
       	GpioCtrlRegs.GPACTRL.bit.QUALPRD2 = 30;
    
    	GpioCtrlRegs.GPAMUX2.bit.GPIO19 = 0;
    	GpioCtrlRegs.GPAQSEL2.bit.GPIO19 = 2;
    	GpioCtrlRegs.GPADIR.bit.GPIO19 = 0;
    	GpioCtrlRegs.GPAPUD.bit.GPIO19 = 0;
    
    	GpioIntRegs.GPIOXINT1SEL.bit.GPIOSEL = 19;   // XINT1 is GPIO19
    
    	EDIS;
    
    	EALLOW;
    	   SysCtrlRegs.PCLKCR0.bit.TBCLKSYNC = 0;
    	EDIS;
    
    	I2CA_Init();
    
    	EALLOW;
    	   SysCtrlRegs.PCLKCR0.bit.TBCLKSYNC = 1;
    	EDIS;
    
    	// Step 3. Clear all interrupts and initialize PIE vector table:
    	// Disable CPU interrupts
    	DINT;
    
    	// Initialize the PIE control registers to their default state.
    	// The default state is all PIE interrupts disabled and flags
    	// are cleared.
    	InitPieCtrl();
    
    	// Disable CPU interrupts and clear all CPU interrupt flags:
    	IER = 0x0000;
       	IFR = 0x0000;
    
    	// Initialize the PIE vector table with pointers to the shell Interrupt
    	// Service Routines (ISR).
    	// This will populate the entire table, even if the interrupt
    	// is not used in this example.  This is useful for debug purposes.
    	// The shell ISR routines are found in DSP2802x_DefaultIsr.c.
    	// This function is found in DSP2802x_PieVect.c.
    	InitPieVectTable();
    
    	XIntruptRegs.XINT1CR.bit.POLARITY = 0;      // Falling edge interrupt
    	XIntruptRegs.XINT1CR.bit.ENABLE = 1;        // Enable XINT1
    
    	EALLOW;  // This is needed to write to EALLOW protected registers
    		 PieVectTable.XINT1 = &xint1_isr;
    	EDIS;    // This is needed to disable write to EALLOW protected registers
    
    	IER |= M_INT1;
    
    	PieCtrlRegs.PIEIER1.bit.INTx4 = 1;
    
    	// Enable global Interrupts and higher priority real-time debug events:
       	EINT;   // Enable Global interrupt INTM
       	ERTM;   // Enable Global realtime interrupt DBGM
    
       	I2caRegs.I2CSAR = 0xCA;
    for(;;)
    {
    	   if(Start_Programming == 1)
    	   {
    	   	   Start_Programming = 0;
    
    		   I2CA_Init();
    
    		   I2ca_create_Byte(&dat, 0xCA); 			// Device address
    //		   I2ca_create_Byte(&dat, 0x01); 			// Block write with offset = 1
    //		   I2ca_create_Byte(&dat, 0x1F); 			// Number of bytes to be written
    
    //		   I2ca_create_Byte(&dat,0x81)
    
    		   I2ca_create_Byte(&dat,0x00);
    		   I2ca_create_Byte(&dat,0x20);
    
    		   I2ca_create_Byte(&dat, 0x81);          	//Byte 01 - 00000000
    		   I2ca_create_Byte(&dat, 0x01);          	//Byte 01 - 00000000
    		   I2ca_create_Byte(&dat, 0xB3);          	//Byte 02 - 10110111
    		   I2ca_create_Byte(&dat, 0xC8);          	//Byte 03 - 11101000
    		   I2ca_create_Byte(&dat, 0x02);          	//Byte 04 - 00000010
    		   I2ca_create_Byte(&dat, 0x50);          	//Byte 05 - 01010000
    		   I2ca_create_Byte(&dat, 0x40);          	//Byte 06 - 01000000
    		   I2ca_create_Byte(&dat, 0x00);          	//Byte 07 - 00000000
    		   I2ca_create_Byte(&dat, 0x00);          	//Byte 08 - 00000000
    		   I2ca_create_Byte(&dat, 0x00);          	//Byte 09 - 00000000
    		   I2ca_create_Byte(&dat, 0x00);          	//Byte 10 - 00000000
    		   I2ca_create_Byte(&dat, 0x00);          	//Byte 11 - 00000000
    		   I2ca_create_Byte(&dat, 0x00);          	//Byte 12 - 00000000
    		   I2ca_create_Byte(&dat, 0x00);          	//Byte 13 - 00000000
    		   I2ca_create_Byte(&dat, 0x00);          	//Byte 14 - 00000000
    		   I2ca_create_Byte(&dat, 0x00);          	//Byte 15 - 00000000
    		   I2ca_create_Byte(&dat, 0x00);          	//Byte 16 - 00000000
    		   I2ca_create_Byte(&dat, 0x00);          	//Byte 17 - 00000000
    		   I2ca_create_Byte(&dat, 0x00);          	//Byte 18 - 00000000
    		   I2ca_create_Byte(&dat, 0x00);          	//Byte 19 - 00000010
    		   I2ca_create_Byte(&dat, 0x6d);          	//Byte 20 - 01101101
    		   I2ca_create_Byte(&dat, 0x02);          	//Byte 21 - 00000010
    		   I2ca_create_Byte(&dat, 0x64);          	//Byte 22 - 01100100
    		   I2ca_create_Byte(&dat, 0x0A);          	//Byte 23 - 00001010
    		   I2ca_create_Byte(&dat, 0xFF);          	//Byte 24 - 11111111
    		   I2ca_create_Byte(&dat, 0xA0);          	//Byte 25 - 10100000
    		   I2ca_create_Byte(&dat, 0x02);          	//Byte 26 - 00000010
    		   I2ca_create_Byte(&dat, 0x84);          	//Byte 27 - 10000100
    		   I2ca_create_Byte(&dat, 0xFF);          	//Byte 28 - 11111111
    		   I2ca_create_Byte(&dat, 0xA0);          	//Byte 29 - 10100000
    		   I2ca_create_Byte(&dat, 0x02);          	//Byte 30 - 00000010
    		   I2ca_create_Byte(&dat, 0x84);          	//Byte 31 - 10000100
    		 }
    	}
    }
    
    void I2CA_Init(void)
    {
    		I2caRegs.I2CSAR = 0xCA;
    
    		I2caRegs.I2CPSC.all = 5;       		// Prescaler - need 7-12 Mhz on module clk
    		I2caRegs.I2CCLKL = 45;           	// NOTE: must be non zero
    		I2caRegs.I2CCLKH = 45;            	// NOTE: must be non zero
    
    		I2caRegs.I2CMDR.all = 0x0020;    	// Take I2C out of reset
    
    		I2caRegs.I2CFFTX.all = 0x6000;   	// Enable FIFO mode and TXFIFO
    		I2caRegs.I2CFFRX.all = 0x2040;   	// Enable RXFIFO, clear RXFFINT,
    
    		return;
    }
    
    void I2CA_WriteData(struct I2C_Data *dat)
    
    {
    	int j, i;
    
    	I2caRegs.I2CCNT = dat->count;
    
    	for (j = 0; j < dat->count; j++)
    		I2caRegs.I2CDXR = dat->CMD[j];
    
    	for (i = 0; i < 250; i++)
    		  for (j = 0; j < 250; j++);
        // Send start as master transmitter
       I2caRegs.I2CMDR.all = 0x6E20;
    
    
       return;
    }
    
    void I2ca_create_Byte(struct I2C_Data *ptr, char ch)
    {
    	char Value;
    	int i, j;
    	ptr->count = 8;
    
    		Value = ch;
    		ptr->CMD[7] = Value;
    		ptr->CMD[6] = Value;
    		ptr->CMD[5] = Value;
    		ptr->CMD[4] = Value;
    		ptr->CMD[3] = Value;
    		ptr->CMD[2] = Value;
    		ptr->CMD[1] = Value;
    		ptr->CMD[0] = Value;
    
    	I2CA_WriteData(ptr);
    
    	for (i = 0; i < 200; i++)
    	  for (j = 0; j < 200; j++);
    
    }
    
    
    interrupt void xint1_isr(void)
    {
    	Start_Programming = 1;
    
    	// Acknowledge this interrupt to get more from group 1
    	//PieCtrlRegs.PIEACK.all = PIEACK_GROUP1;
    }
    

  • Hi Richa,

    What device are you using as your I2C master? I am not familiar with this line of devices so their apps team may be better suited to confirm if your device is properly configured.

    Gabe

  • Hi!

    Thanks for your support and guidance.

    We are able to write a data in CDCE931. The sequence for writing the data is as follows:

    I2CA_WriteData( 0x82 );		//CMD
    I2CA_WriteData( 0xBF );		//DATA
    
    I2CA_WriteData( 0x83 );		//CMD 		  
    I2CA_WriteData( 0xE8 );		//DATA
    
    I2CA_WriteData( 0x84 );		//CMD
    I2CA_WriteData( 0x03 );		//DATA
    
    I2CA_WriteData( 0x85 );		//CMD
    I2CA_WriteData( 0x40 );		//DATA
    
    I2CA_WriteData( 0x86 );		//CMD
    I2CA_WriteData( 0x03 );		//DATA
    
    I2CA_WriteData( 0x94 );
    I2CA_WriteData( 0x6D);
    
    I2CA_WriteData( 0x95 );
    I2CA_WriteData( 0x03 );
    
    I2CA_WriteData( 0x96 );
    I2CA_WriteData( 0x64 );
    
    I2CA_WriteData( 0x97 );
    I2CA_WriteData( 0x0A );
    
    I2CA_WriteData( 0x98 );
    I2CA_WriteData( 0xFF );
    
    I2CA_WriteData( 0x99 );
    I2CA_WriteData( 0xA0 );
    
    I2CA_WriteData( 0x9A );
    I2CA_WriteData( 0x02 );
    
    I2CA_WriteData( 0x9B );
    I2CA_WriteData( 0x84 );
    
    I2CA_WriteData( 0x9C );
    I2CA_WriteData( 0xFF );
    
    I2CA_WriteData( 0x9D );
    I2CA_WriteData( 0xA0 );
    
    I2CA_WriteData( 0x9E );
    I2CA_WriteData( 0x02 );
    
    I2CA_WriteData( 0x9F );
    I2CA_WriteData( 0x84 );
    

    We are getting the O/P as 10KHz Y1 as we have used 10MHz Crystal and the division of 1000. According to me the CDCE913 is not configured as a PLL and the O/P is just a division of 1000 to the 10MHz crystal.

    I checked the status of the the two registers who are setting the CDCE in PLL mode.

    should I include anything further in H/W of F/W, so that it will be configured in the PLL mode?

    Please help.

    Regards,

    Richa

  • Hi Richa,

    I suggest using the ClockPro tool to generate the register map you desire - the graphic representation of the device will help turn on the appropriate bits and generate a register map that you could simply port to your device.

    Gabe