Hi
I am working on the Rm48 evl board. I am using halcongen generated driver for the sci and other peripherals. i am trying to read and write to the SCI(LIN/sci) either port. i am able to write through the siclinReg but at the time of receive it stuck at the receive "while ((sci->FLR & SCI_RX_INT) == 0U)". i am not able to proceed further on this path. below are configuration i am using
H/W : J11 pin LIN TX and LIN RX. extra connection coming out of the board and connected to to the putty(PC).
driver setting:
void sciInit(void)
{
/* USER CODE BEGIN (2) */
/* USER CODE END */
/** @b initialize @b SCILIN */
/** - bring SCI out of reset */
scilinREG->GCR0 = 0U;
scilinREG->GCR0 = 1U;
/** - Disable all interrupts */
scilinREG->CLEARINT = 0xFFFFFFFFU;
scilinREG->CLEARINTLVL = 0xFFFFFFFFU;
/** - global control 1 */
scilinREG->GCR1 = (1U << 25U) /* enable transmit */
| (1U << 24U) /* enable receive */
| (1U << 5U) /* internal clock (device has no clock pin) */
| ((2U-1U) << 4U) /* number of stop bits */
| (0U << 3U) /* even parity, otherwise odd */
| (0U << 2U) /* enable parity */
| (1U << 1U); /* asynchronous timing mode */
/** - set baudrate */
scilinREG->BRS = 520U; /* baudrate - 9600 */
// scilinREG->BRS = 12U; /* baudrate - 375000*/
/** - transmission length */
scilinREG->FORMAT = 8U - 1U; /* length */
/** - set SCI pins functional mode */
scilinREG->PIO0 = (1U << 2U) /* tx pin */
| (1U << 1U) /* rx pin */
| (0U); /* clk pin */
/** - set SCI pins default output value */
scilinREG->PIO3 = (0U << 2U) /* tx pin */
| (0U << 1U) /* rx pin */
| (0U); /* clk pin */
/** - set SCI pins output direction */
scilinREG->PIO1 = (0U << 2U) /* tx pin */
| (0U << 1U) /* rx pin */
| (0U); /* clk pin */
/** - set SCI pins open drain enable */
scilinREG->PIO6 = (0U << 2U) /* tx pin */
| (0U << 1U) /* rx pin */
| (0U); /* clk pin */
/** - set SCI pins pullup/pulldown enable */
scilinREG->PIO7 = (0U << 2U) /* tx pin */
| (0U << 1U) /* rx pin */
| (0U); /* clk pin */
/** - set SCI pins pullup/pulldown select */
scilinREG->PIO8 = (1U << 2U) /* tx pin */
| (1U << 1U) /* rx pin */
| (1U); /* clk pin */
/** - set interrupt level */
scilinREG->SETINTLVL = (0U << 26U) /* Framing error */
| (0U << 25U) /* Overrun error */
| (0U << 24U) /* Parity error */
| (0U << 9U) /* Receive */
| (0U << 8U) /* Transmit */
| (0U << 1U) /* Wakeup */
| (0U); /* Break detect */
/** - set interrupt enable */
scilinREG->SETINT = (0U << 26U) /* Framing error */
| (0U << 25U) /* Overrun error */
| (0U << 24U) /* Parity error */
| (1U << 9U) /* Receive */ //lin interrurpt subhash
| (0U << 1U) /* Wakeup */
| (0U); /* Break detect */
/** - initialize global transfer variables */
g_sciTransfer_t[1U].mode = 0U << 8U;
g_sciTransfer_t[1U].tx_length = 0U;
g_sciTransfer_t[1U].rx_length = 0U;
/** - Finaly start SCILIN */
scilinREG->GCR1 |= (1U << 7U);
suggest if i am doing wrong on this. i am facing this issue from past few weeks. immediate help will be anticipated.
And one more thing i am facing is i am not able to send any thing on SCI(sciREG). please help us to make this work.
Regards
Subhash