Hello,I am using Renesas RL78G14 RDK board. I downloaded the sample IAR project from below link:http://in.renesas.com/support/downloads/download_results/C1000000-C9999999/tools/yrdkrl78g14_factory_demo_v39.jspI am unable to see UART communication in any mode supported.I guess it looked like clocking issue.I found multiple definition for clock freq./* YRDKRL78G14.h */#define RL78_MAIN_SYSTEM_CLOCK 12000000 /* MHz */#define RL78_SUBSYSTEM_CLOCK 32768 /* kHz */#define RL78_INTERNAL_LOWSPEED_CLOCK 15000 /* kHz *//* UART.c */#define MAIN_SYSTEM_CLOCK 32000000Could anybody confirm which value needs to be used for baud rate calculation?Current code uses macro MAIN_SYSTEM_CLOCKAlso if any other issue is suspected in UART in RL78G14 board would really helpfulThanks!!regards,Hemanth
UPDATE:
Enabling of UART-1 Tx & Rx by setting the Register "SS10", causes Higher 7 bits of the serial data register SDR02 & SDR03 to reset. How can i prevent the reset happening?
Are you sure the bits are reset, or can you only not see the value any more?
I think the values are only not shown when the serial interface is in use.
When you disable the serial interface you should see the value again.
As it comes, the yrdkrl78g14_factory_demo_v39 project only uses these serial ports on SAU1 (Serial Array Unit 1):
- CSI20 on port P13/P14/P15 pins (same as 3-wire SPI) to interface to GainSpan GS1011 module
- CSI21 on port P70/P71/P72 pins (same as 3-wire SPI) to interface to Okaya Graphics LCD panel
- and also uses IICA0 on port P60/P61 pins (I2C in Master Mode) to interface to Accelerometer, Temp and Light Sensors
If you want to use UART1 which is on Channel 2 and Channel 3 in SAU0, you will have to issue R_SAU0_Create() which is in source file folder path \Factory_Demo_V39\YRDKRL78G14\applilet3_src\r_cg_serial.c
R_SAU0_Create() turns on the clock (SAU0EN = 1U;) for SAU0 and calls R_UART1_Create()
Then you can use the other UART1 functions to start or stop and run UART1.
The baud rate can be set separately for both UART1 receive and UART1 transmit.
SPS0 register sets which main clock and divider that goes to SAU0, channel 2 (UART1 Transmit shift register) and channel 3 (UART1 Receive Shift register).
SPS0 is set in R_SAU0_Create(void)
SDR02 (upper 7 bits) sets the UART1 transmit baud rate divisor
SDR03 (upper 7 bits) sets the UART1 receive baud rate divisor
Both SDR02 and SDR03 are set in R_UART1_Create() function.
Have you called R_SAU0_Create() first?
-Mike/Renesas
Hi Mike,
Thanks for the detailed response.
I was trying the "App_PassThroughSPI" mode. When I went further I figured out that the UART is not communicating.
I tried monitoring of COM port for transmission("PassThroughSPI:\r\n") in UART after entering "App_PassThroughSPI" but couldn't see anything.
While debugging I figured the Upper 7-bits(SDR02[15:9] & SDR03[15:9]) are reset after enabling UART-1
(SS0 |= _0008_SAU_CH3_START_TRG_ON | _0004_SAU_CH2_START_TRG_ON; /* enable UART1 receive and transmit */)
Not sure if this is the issue Or not.
But I am unable to see any data in COM port.
regards,
Hemanth