Maximum SPI Speed in RL78G14

Hello All,

I am working on Renesas RL78G14 RDK.
I wanted to know the maximum operating frequency the SPI(CSI) supports?

I am able to configure SPI upto 2 MHz, above 2 MHz results in wrong variable clock frequency.

I using the Channel-1 & Unit-3 of CSI. The system CLK(fMCK)) is set to 32 MHz.
I am using the SPI as Master with clock from High-speed on-chip oscillator.

Below are the register loaded values:

Register                        Value
----------------------------------------
[Option byte setting]
Address: 000C2H      0xF8U

[Serial clock select register]
SPS1                            0x0000U

[Transfer clock setting]            
SDR13                            0x0200U (32 Mhz/4 = 8MHz)

The SPI works fine upto 2MHz above that the clock becomes unstable.
Could any share feedback regarding this issue?

Thanks!!

regards,
Hemanth

Parents
  • Hi Hemanth,

    Theoretically, the RL78/G14 can support up to 8MHZ on CSI ports if using HIGH SPEED MODE @32MHZ, VDD = EVDD = 2.7V or greater.

    I think I have used YRDKRL78G14 CSI21 to Okaya Graphics display at 4MBPS (4MHZ) successfully.

    You may be having a Hardware problem.  If the P52/SO31, and P54/SCK31 outputs are using Open Drain setting and the internal pullup resistor, this could be the problem, since internal pullup resistors are very weak. (20K typical, 10K min to 100K Max), and the RDK board pullups are 47K, which doesn't help much (too weak).  If you put an oscilloscope on these lines (SO31, and SCK31) and see too much ramp time from low to high state, it is because there is high loading capacitance and pullup resistor value is too high.

    There are 2 possible solutions:

    (1) Add two external 1K pullup resistors, one between EVDD and P52/SO31, and one between EVDD and P54/SCK31, if using OPEN DRAIN output mode.

    (2) or if you only have one CSI Slave connected to the RL78 MCU, you can program P52/SO31, and P54/SCK31 to CMOS PUSH-PULL output mode.

    The default CSI31 connection on YRDKRL78G14 is the GainSpan WiFi module.  I don't know if you are using it, but you should check the GainSpan WiFi module spec to see if it can handle 4MHZ CSI clocking.

    -Mike

  • Hi Mike,

    Thanks for the response.

    I am using Gainspan Wifi module using this SPI.

    The Gainspan Module supports upto 10 MHz.

    But the clock becomes unstable after 2 MHz.

    Any alternative/work around for using clock above 2 MHz in this RDK board?

    Regards,

    Hemanth

  • Hi Mike,

    Thanks for the response.

    I am using Gainspan Wifi module using this SPI.

    The Gainspan Module supports upto 10 MHz.

    But the clock becomes unstable after 2 MHz.

    Any alternative/work around for using clock above 2 MHz in this RDK board?

    Or Solution-1 is only way around?

    I am using SPI as Master.

    Regards,

    Hemanth

  • Hello Hemanth,

    I strongly recommend you use an oscilloscope to look at P52/SO31, and P54/SCK31 output lines.  

    If they have too slow rise time, the CSI communications will not work.

    You can use solution (1) or (2), but (2) is easier since it just means setting Software:

    POM5 = POM5 & 0xEB;   //  Clears POM52 and POM54 to make P52/SO31, and P54/SCK31 outputs Normal CMOS Push-pull mode, which is stronger than OPEN DRAIN drive with pullup resistors

    Personally, I don't know if 8MHZ serial speed for CSI31 will work on this YRDKRL78G14 board layout.  It may work if you change the P52/SO31, and P54/SCK31 outputs to CMOS Push-Pull mode, but the CSI31 interrupts will be happening very frequently, since it only takes 1uSEC to transfer one byte at 8MHZ.  You may be able to do this, but since the CPU only has 32cycles per 1uSEC, you won't be able to keep up at 8 MBPS continuous transmission.  It may be better to use 4MBPS or lower speed.  

    After you try POM5 = POM5 & 0xEB;

    you could start at 2MHZ speed and step gradually to higher speeds from 32MHZ/16, 32MHZ/14, 32MHZ/12, and higher, until it stops working.

    SDR13                            0x0200U (32 Mhz/4 = 8MHz)

    SDR13                            0x0400U (32 Mhz/6 = 5.33MHz)

    SDR13                            0x0600U (32 Mhz/8 = 4MHz)

    SDR13                            0x0800U (32 Mhz/10 = 3.2MHz)

    SDR13                            0x0A00U (32 Mhz/12 = 2.667MHz)

    SDR13                            0x0C00U (32 Mhz/14 = 2.286MHz)

    SDR13                            0x0C00U (32 Mhz/16 = 2MHz)

    However, I want to stress if your CSI31 AC timing is not meeting the Specifications in the electrical spec chapter, then you may see problems @8MHZ/8MBPS serial speed.  That is why I recommend oscilloscope capture of P52/SO31, and P54/SCK31 to see what AC timing is.

    -Mike

Reply
  • Hello Hemanth,

    I strongly recommend you use an oscilloscope to look at P52/SO31, and P54/SCK31 output lines.  

    If they have too slow rise time, the CSI communications will not work.

    You can use solution (1) or (2), but (2) is easier since it just means setting Software:

    POM5 = POM5 & 0xEB;   //  Clears POM52 and POM54 to make P52/SO31, and P54/SCK31 outputs Normal CMOS Push-pull mode, which is stronger than OPEN DRAIN drive with pullup resistors

    Personally, I don't know if 8MHZ serial speed for CSI31 will work on this YRDKRL78G14 board layout.  It may work if you change the P52/SO31, and P54/SCK31 outputs to CMOS Push-Pull mode, but the CSI31 interrupts will be happening very frequently, since it only takes 1uSEC to transfer one byte at 8MHZ.  You may be able to do this, but since the CPU only has 32cycles per 1uSEC, you won't be able to keep up at 8 MBPS continuous transmission.  It may be better to use 4MBPS or lower speed.  

    After you try POM5 = POM5 & 0xEB;

    you could start at 2MHZ speed and step gradually to higher speeds from 32MHZ/16, 32MHZ/14, 32MHZ/12, and higher, until it stops working.

    SDR13                            0x0200U (32 Mhz/4 = 8MHz)

    SDR13                            0x0400U (32 Mhz/6 = 5.33MHz)

    SDR13                            0x0600U (32 Mhz/8 = 4MHz)

    SDR13                            0x0800U (32 Mhz/10 = 3.2MHz)

    SDR13                            0x0A00U (32 Mhz/12 = 2.667MHz)

    SDR13                            0x0C00U (32 Mhz/14 = 2.286MHz)

    SDR13                            0x0C00U (32 Mhz/16 = 2MHz)

    However, I want to stress if your CSI31 AC timing is not meeting the Specifications in the electrical spec chapter, then you may see problems @8MHZ/8MBPS serial speed.  That is why I recommend oscilloscope capture of P52/SO31, and P54/SCK31 to see what AC timing is.

    -Mike

Children