Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
Jony1211
Level 2
Level 2
10 replies posted 25 sign-ins 5 replies posted

When I was developing the product, I used the XC2267 chip to perform two reads and writes every time I read peripheral register data. The waveform of IIC communication is not a problem, and I don't know where the problem lies. Is there a reference to the IIC read and write related routines for this chip

1 Solution
Kevin_Wu
Moderator
Moderator
Moderator
100 sign-ins 50 replies posted 10 likes received

Hi Jony1211,

  Through DAVE configuration, you can generate code without FIFO and without interrupt.

 first step: follow the instruction, select USIC channel, master mode, PINs and baud rate;

 second step: not select FIFO with 0;

Third step:  goto functions tab, select 3 items below.

Kevin_Wu_0-1692666737430.png

after the code generation, you will get initiation, readData and writeData functions.

thanks, Kevin

 

View solution in original post

0 Likes
3 Replies
lock attach
Attachments are accessible only for community members.

Hello, is there an IIC read and write routine for XC2267M?
Read through IIC, not FIFO, my problem is that I need to read twice when I read in IIC, I want to solve this problem, this is my code.

In the U0C1_IIC_vMasterReceive() function, if the receive function I configured with Dave is not changed to U0C1_IIC_vWriteData(U0C1TDF_MRStart, uwDeviceAddrU0C1 + U0C1IIC_READ), I can't even read it.

Attached is my IIC communication section.

0 Likes
Kevin_Wu
Moderator
Moderator
Moderator
100 sign-ins 50 replies posted 10 likes received

Hi Jony1211,

  Through DAVE configuration, you can generate code without FIFO and without interrupt.

 first step: follow the instruction, select USIC channel, master mode, PINs and baud rate;

 second step: not select FIFO with 0;

Third step:  goto functions tab, select 3 items below.

Kevin_Wu_0-1692666737430.png

after the code generation, you will get initiation, readData and writeData functions.

thanks, Kevin

 

0 Likes