Re : RL78/G13 Controller Flash Programming with Uart

Hello Sir,

       I am Using R5F100FE Controller. I want to Program this controller with UART Port.

       I have already tried to program with Renesas Flash Program Ver .2.04.01. unfortunately,not successes. 

       I used Max232 IC for level converter between PC and Controller.

       I used Uart1 ( i.e. PIN No 42, and 43.) and also tried  Uart0 ( i.e. PIN No 29 and 30.)

       below , I have attached images of Schematic which I had used for programming  

        Reset Connect to GND and TOOLO Pin Pulled Up with 1000 ohm.(i.e. 1 kOhm)

 

 

  • Hi Harsh,
    Sorry, but you cannot use RFP with ToolRxD and ToolTxD communication. You can only use RFP with Tool0 and MCU RESET Line. (Of course VDD and VSS must also be connected too). If you want to have cheaper Flash programmer than E1, then use Circuit Type B.


    There are 3 main ways to program RL78 MCU on Tool0, RESET, VDD and VSS:
    1. Using E1 (or E2 or E2Lite) emulator/flash programmers with RFP Software

    2. Using Circuit type B (3 chips including RS232) with RFP Software. Go to:
    www.renesas.com/.../r20ut0857ej0300_rfpsplcrct.pdf
    And see page 3, Sample Type B Circuit. (this uses MAX232, Tri-state buffer and simple inverter chip). Please note that since most PC don't have the RS-232 interface, you may need USB-to-Serial adaptor. It must have an active RTS signal to use with Circuit Type B.

    3. PG-FP5 or PG-FP6 dedicated Flash programmer box with its own GUI software.


    By the way, RL78 Flash programming with ToolRxD and ToolTxD communications is called "Protocol A" 2-wire interface. See RL78 Protocol A) Programmer Edition document at:
    www.renesas.com/.../r01an0815ej0100_rl78.pdf

    The disadvantage of Protocol A, is you have to write your own RL78 Flash programming SW running on a PC (or other Host Hardware), using the Protocol A specification.

    Regards,
    Mike
  • Thank you sir ,
    your support help me lot,

    As Per your great reply, I understand that I have to make "Sample Type B Circuit (1-wire UART)".


    Can I used Below IC?
    1.) 74HC125 As a Three State Buffer IC?
    2.) ULN2003A As a Inverter?
    3.) Max232 As a Signal Conversion IC

    if Possible can you send me schematic of "Sample Type B Circuit (1-wire UART)" with Pin
  • In reply to Harsh:

    Hi Harsh,

    I had the same problem before and solved it by writing my own tool:

    rl78flash: https://github.com/msalau/rl78flash

    The tool can flash RL78 MCUs using both 2-wire UART and 1-wire UART.

     

    Here is how you can connect an RL78 MCU to a generic UART (USB-to-UART or RS232-to-UART):

    Pre-built binaries are available here: https://github.com/msalau/rl78flash/releases

     

    Regards,

    Maksim.

  • In reply to Maksim Salau:

    Harsh,

    As I mentioned before, Circuit type B schematic can be found at:
    www.renesas.com/.../r20ut0857ej0300_rfpsplcrct.pdf

    Do a search at www.renesas.com on r20ut0857ej, and a link to the document should appear.

    Regards,
    Mike
  • In reply to Maksim Salau:

    Hi Maksim Salau,
    Good job first of all !

    In case of a RL78/G13 MCU's dump with a 512K Code Flash and a 8K Data Flash, what's the right command for writing it on the dedicated MCU with your software ?
    Also, can you please give a reference schottky diode to use with your schematic ?

    Regards,
    Martin
  • In reply to Mart:

    Hi Martin,

     

    Any diode will work. E.g. BAT54

    Try the following command:

    rl78flash -mX -vvia /dev/ttyUSB0 firmware.mot

    Where X is the operating mode 1 to 4. Also you can add -n to invert the reset signal if necessary.

     

    Regards,

    Maksim

  • In reply to Maksim Salau:

    Hi Maksim,

    Thanks for sharing your tool on github.

    I am developing a piece of code that does this MCU programming via UART and hit into some problems.

    I managed to get the MCU into programming mode and send the baudrate set command. I got an ACK from the MCU. However, on my next command, which is the reset command, I got a malformed frame from the MCU. Below is the frame exchange (in hex):

    Baudrate Set: 01,03,9a,00,1e,45,03
    Status Reply: 02,03,06,20,00,d7,03

    Reset: 01,01,00,ff,03
    Status Reply: 02,40,50,03

    As you can see, the status reply to the reset command is wrong. Frame length of 0x40 is not defined in the protocol. I can't figure out what else is wrong, given that I had a successful reply to my baudrate command. I added more than sufficient delays between commands but still no joy.

    Can you please advise me on how to get this right?
    Thanks again.
  • In reply to David:

    Hi David,

    Do you have a logic analyzer or an oscilloscope to capture actual response? I find such tools extremely useful.
    Also please try the same commands without actual baudrate switching, since switching to a different baudrate may be faulty on PC side.
    As an option you can try my tool and capture UART traffic to compare with your results (my tool accepts several '-v' arguments, more '-v' present - more verbose output is).

    Regards,
    Maksim