How to config i2c clicker 2 for dspic33 connecting to DAC3 ?

General discussion on mikroC PRO for dsPIC30/33 and PIC24.
Post Reply
Author
Message
jeswimax
Posts: 1
Joined: 20 Jan 2018 17:16

How to config i2c clicker 2 for dspic33 connecting to DAC3 ?

#1 Post by jeswimax » 12 Feb 2018 21:57

I'm a newbie to using your product, I've got a Mikro C for dspic complier, MikroProg for PIC, dspic clicker 2 evaluation board and DAC3 Clicker-board.

I'm tying to write an easy example code to test with I2C1 via mikro Bus

Code: Select all


void main(){

  // Setting output frequency to 140MHz
  
   PLLFBD = 70 ;               // PLL multiplier M=70
   CLKDIV = 0x0000;         // PLL prescaler N1=2, PLL postscaler N2=2
  
   ANSELA = 0x00;           // Convert all I/O pins to digital
   ANSELB = 0x00;
   ANSELC = 0x00;
   ANSELD = 0x00;
   ANSELE = 0x00;
   ANSELG = 0x00;
  

  

 //--------------------I2C-Init----------------------------------//

      I2C1_Init(400000);



//-------------------------------------------------------------//

      while(1){                                     //--Write volatile Mem to output 

                    I2C1_Start();                 // issue I2C start signal
                    I2C1_Write(0x60);          // device address
                    I2C1_Write(0x40);          // CMD+REF+PD
                    I2C1_Write(0xFF);          // MSB      //----Set to maximum output
                    I2C1_Write(0XF0);          // LSB
                    I2C1_Stop();
                    delay_ms(1000);

                  }

}

I missed somethings about? :

1. How to using and configuration I2C Module from SCL/SCA pins to ASCA/ASCL pins with dspic cliker 2 ( dspic33EP510MU810 ) board ? .

2. Do you have an example of using Clicker 2 for dspic33 with DAC3 Clicker-board?

3. Are your product is supported with dsPIC33EV256GM106 chip ? , My project is using with dsPIC33EV256GM106 to control 2 DAC( MCP7426 ) via I2C, 1 CAN Bus and 1 UART.

thank you.

User avatar
filip
mikroElektronika team
Posts: 11874
Joined: 25 Jan 2008 09:56

Re: How to config i2c clicker 2 for dspic33 connecting to DA

#2 Post by filip » 21 Feb 2018 10:59

Hi,
1. How to using and configuration I2C Module from SCL/SCA pins to ASCA/ASCL pins with dspic cliker 2 ( dspic33EP510MU810 ) board ? .
Did you set the Alternate I2C pins for I2C1 in the Edit Project ?
2. Do you have an example of using Clicker 2 for dspic33 with DAC3 Clicker-board?
No, we don't have at this moment, but we can make an example for you.
3. Are your product is supported with dsPIC33EV256GM106 chip ? , My project is using with dsPIC33EV256GM106 to control 2 DAC( MCP7426 ) via I2C, 1 CAN Bus and 1 UART.
Yes, this MCU is supported by the compiler and programmer.

Regards,
Filip.

Post Reply

Return to “mikroC PRO for dsPIC30/33 and PIC24 General”