Quantcast
Channel: Microcontrollers
Viewing all articles
Browse latest Browse all 4928

I2C problem with MPLABX (XC16)

$
0
0
Hello everyone .

I tried to use dspic30f3012 with i2c on ccs program and all's right.

Now I'm trying to use the dspic with i2c on Mplabx.
I used the mplabx with xc16 and this is the code :
Code:
Code (Text):
  1.  
  2. #include<i2c.h>
  3. void main(void )
  4. {
  5. unsigned int config2, config1;
  6. unsigned char *wrptr;
  7. unsigned char tx_data[] = {'M','I','C','R','O',’C’,'H','I','P','\0'};
  8. wrptr = tx_data;
  9. /* Baud rate is set for 100 kHz */
  10. config2 = 0x11;
  11. /* Configure I2C for 7 bit address mode */
  12. config1 = (I2C_ON &...
I2C problem with MPLABX (XC16)

Viewing all articles
Browse latest Browse all 4928

Trending Articles