Hello,
I am trying to establish UART communication using the SCI module on the RM48L950 and HALCogen. I am new to this processor and started by trying example_sci_uart_9600.c, which worked without any issues. Now I am trying to modify the project to use the SCI module instead of SCI2 (LINSCI). I need to be able to use pins N2HET1 [6] and N2HET1 [13] to transmit and receive data.
I have made the following changes in HALCogen in trying to get it to work:
1. Disable SCILIN and enable SCI driver
2. Disable VIM 13 (LIN1 High)
3. Enable VIM 74 (SCI Level 1)
I have RX INT set under the SCI tab, however I am not able to receive or transmit data. The followign is my code for the project:
/* USER CODE BEGIN (0) */
#include "uart_main.h"
#include "sci.h"
#include "system.h"
/* USER CODE END */
/* Include Files */
#include "sys_common.h"
/* USER CODE BEGIN (1) */
static unsigned char command;
/* USER CODE END */
/** @fn void main(void)
* @brief Application main function
* @note This function is empty by default.
*
* This function is called after startup.
* The user can use this function to implement the application.
*/
/* USER CODE BEGIN (2) */
/* USER CODE END */
void uart_main(void)
{
/* USER CODE BEGIN (3) */
/* Enable IRQ */
_enable_IRQ();
/* Initialize SCI module */
sciInit();
/* Send user prompt */
sciSend(sciREG, 21, (unsigned char *)"Please press a key");
/* Await user character */
sciReceive(sciREG, 1, (unsigned char *)&command);
/* USER CODE END */
}
/* USER CODE BEGIN (4) */
void sciNotification(sciBASE_t *sci, unsigned flags )
{
/* Echo back received character */
sciSend(sci, 1, (unsigned char *)&command);
/* Await further character */
sciReceive(sci, 1, (unsigned char *)&command);
}
/* ESM interrupt notification (Not used but must be provided) */
void esmGroup1Notification(int bit)
{
return;
}
void esmGroup2Notification(int bit)
{
return;
}
/* USER CODE END */
I observed that if I try to type anything into Terminal, the TX LED on the RM48 board comes on, but not the RX, and the initial message "Please Press a Key" is never transmitted.
Are there other configurations that have to be changed in order to use SCI instead of SCI2?
Any help is much appreciated. Thank you,
Rafael