RL78/G14 IICA0调不通,求指导

使用RL78/G13开发板调试IICA0调试成功,相同的代码程序在R5F104PJ上面就是调不通,困惑中,请给指导一下。

void main(void)
{
R_MAIN_UserInit();
/* Start user code. Do not edit comment generated here */
add = 0xae;
tx_buf[0] = 0x03;
tx_buf[1] = 0xAA;
tx_buf[2] = 0x22;
tx_buf[3] = 0x33;
tx_buf[4] = 0x44;
tx_buf[5] = 0x55;
tx_buf[6] = 0x66;
tx_buf[7] = 0x77;
tx_buf[8] = 0x88;
tx_len = 9;
rx_len = 8;
R_IICA0_Master_Send(add,tx_buf,tx_len,200);
cnt = 10000;
while(cnt>0)
cnt--;
R_IICA0_Master_Send(add,tx_buf,1,200);
cnt = 10000;
while(cnt>0)
cnt--;
add = 0xA0;
R_IICA0_Master_Receive(add,rx_buf,rx_len,200);
while (1U)
{
;
}
/* End user code. Do not edit comment generated here */
}

void R_IICA0_Create(void)
{
IICA0EN = 1U; /* supply IICA0 clock */
IICE0 = 0U; /* disable IICA0 operation */
IICAMK0 = 1U; /* disable INTIICA0 interrupt */
IICAIF0 = 0U; /* clear INTIICA0 interrupt flag */
/* Set INTIICA0 low priority */
IICAPR10 = 1U;
IICAPR00 = 1U;
/* Set SCLA0, SDAA0 pin */
P6 &= 0xFCU;
PM6 |= 0x03U;
SMC0 = 0U;
IICWL0 = _4C_IICA0_IICWL_VALUE;
IICWH0 = _55_IICA0_IICWH_VALUE;
IICCTL01 |= _01_IICA_fCLK_HALF;
SVA0 = _10_IICA0_MASTERADDRESS;
STCEN0 = 1U;
IICRSV0 = 1U;
SPIE0 = 0U;
WTIM0 = 1U;
ACKE0 = 1U;
IICAMK0 = 0U;
IICE0 = 1U;
LREL0 = 1U;
/* Set SCLA0, SDAA0 pin */
PM6 &= 0xFCU;
}

Parents Reply Children
No Data