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);
}
}
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.