Programming uPD78F9418A renesas mcu. How to send pulses between two voltages? - Page 1
Forum section: electronics / general

author: CyberPK
author_rank: Contributor
timestamp: May 02, 2016, 04:20:47 pm
content: I'm trying to modify an already existing project to program renesas mcu via uart.Can anyone help me tocreate a circuit to switch between vdd and vpp to send 8 pulses ?Thank you.

author: Bruce Abbott
author_rank: Frequent Contributor
timestamp: May 02, 2016, 04:28:14 pm
content: WhichRenesas MCU are you trying to program?

author: CyberPK
author_rank: Contributor
timestamp: May 02, 2016, 04:42:44 pm
content: Quote from: blueskull on May 02, 2016, 04:24:32 pmThere isn't a simpler way using some transistors?Quote from: Bruce Abbott on May 02, 2016, 04:28:14 pmHi Bruce, I was just editing your open source programmer. The uPD74F9418A is a little different than 78k0s/kx1+I'm trying to program via uart ad uPD74F9418A.The first stage is to obtain the 8 pulses on vpp.I've thinked to use DTR to accomplish this goal but I lack the electronics knowledge to flicker between the vdd and vpp on DTR hig or low.

author: Bruce Abbott
author_rank: Frequent Contributor
timestamp: May 02, 2016, 08:34:04 pm
content: You can use an NPN and PNP transistor to switch Vpp to 10v, and a diode to hold it up to 5v normally.

author: CyberPK
author_rank: Contributor
timestamp: May 03, 2016, 02:41:25 am
content: Quote from: Bruce Abbott on May 02, 2016, 08:34:04 pmThank you. Exactly what I want to build with component at home.Now at work to edit your program and write the mcu. The problem is the lacking of programming documentation for the uPD78F9418A. I've modified your program to accept 32kb hex and write 1kb blocks (according to other resenas mcu with 32kb flash memory) and rewrited the connection procedure, but still can't get any communication from the mcu. Strangely it keeps rx low.Thank you.Quote from: blueskull on May 02, 2016, 08:52:09 pmYou're probably true, but it's hard for me to supply such component.

author: AndersJ
author_rank: Frequent Contributor
timestamp: May 03, 2016, 04:56:07 pm
content: The CD405x may have a too high series resistance if the receiver end needs current.

author: Bruce Abbott
author_rank: Frequent Contributor
timestamp: May 04, 2016, 09:23:11 am
content: Quote from: CyberPK on May 03, 2016, 02:41:25 amYes, that is a problem. I can't find any information on programming the uPD78F9418A apart from what is in the datasheet. The only programmer I know of that works with it is theHilo All-11. An experienced hacker might be able to decompile the program that controls it (WAUPD78X.exe) and figure out the programming algorithm. Unfortunately my Windows hacking skills are very poor and I don't have the time to waste on it...

author: amyk
author_rank: Super Contributor
timestamp: May 04, 2016, 11:28:25 am
content: If I remember correctly they use an async serial protocol which is common amongst all the 78K/0S devices.This might be of some use:http://elm-chan.org/works/sp78k/report_e.htmlhttp://elm-chan.org/works/sp78k/78k_v850.zip

author: CyberPK
author_rank: Contributor
timestamp: May 04, 2016, 03:31:04 pm
content: elm-chan and bruce abbot work appear not compatible to requirement. If i'm not wrong there are differences in the initialization and in the packet communication.I just got some clues and I'm just starting to modify the Bruce Abbot software to accomplish my requirement (I'll share it if I'll get it working).Downloading the PG-FR5 configuration file for uPD78f9418A (pr5-78f9418_v101.zip) I just found a pdf referring to 78k0/Kx1 so I'm trying to follow U17593EJ1V0AN00.pdf (78k0/Kx1 programming guide) with the only difference in the uart selection.

author: CyberPK
author_rank: Contributor
timestamp: May 04, 2016, 06:02:25 pm
content: Probably my idea of using DTR to send pulses isn't good. The pulse must be between 10 and 100 us but i cannot pull up and down DTR as fastI've just verified it using a pickit2 as logic analyzer.Maybe the usb to rs232 interface be the problem? (a prolific clone, as discovered on driver updates)Maybe the 1ms latency of the usb data packet?Any idea?

author: Bruce Abbott
author_rank: Frequent Contributor
timestamp: May 04, 2016, 10:44:05 pm
content: Quote from: CyberPK on May 04, 2016, 06:02:25 pmProbably. One USB packet could store several commands, but the USB-serial driver may only allow one DTR change per packet.One answer might be to generate the pulses with serial TX data, using DTR and a few logic gates to switch between pulsing Vpp and sending to SI. If you set the baud rate to 19200 you should get a bit time of about 52us. Then set the serial format to 8 bits no parity 1 stop, and send 2 bytes 0xAA and 0xAF which should produce 8 pulses.

author: CyberPK
author_rank: Contributor
timestamp: May 05, 2016, 12:00:35 am
content: Just trying to use one additional adapter to send the 8 pulses, sending two bytes 0x55 and 0xf5. (isn't LSB?)With pickit2 verified it is the right sequence.If I get all working, i'll modify it as you suggested

author: CyberPK
author_rank: Contributor
timestamp: May 05, 2016, 03:16:29 am
content: My circuitry now seems good but still can't get communication with the mcu. Either, whenever I can check the input to the transistor schematics you suggested before arrives with the correct timing, I cannot directly check the 10- 5v pulses because i don't own the equipment to do it. Just tryed 10v - 0v removing the 5v pullup and seems good. (tryed to use the 5v level as ground but the power supply became crazy because it provide both 12v and 5v.). Any other idea?Just a question. I need an explanation about times in the following table.For example, 78704/fx, with an fx of 5Mhz, how long it is? 15ms or i'm wrong?Thanks

author: CyberPK
author_rank: Contributor
timestamp: May 06, 2016, 04:54:05 pm
content: Quote from: Bruce Abbott on May 04, 2016, 09:23:11 amJust gave it a look.It seems to load a binary for each mcu family into the programmer containing instruction on how to write it. I took a look to this binary but cannot figure out any useful information.I think I should give up

author: CyberPK
author_rank: Contributor
timestamp: May 07, 2016, 05:13:31 am
content: Ok, finally i got it working!!!I made a mistake in the timings to send the reset commands. Sending it within us instead ms made the magic.I've just managed to erase the chip and receive correct informations like signature.Now the problem is the writing. I think i'll get it working very soon.Would be useful a datasheet explaining the communication with 78K/0S series 8SCP.S.The commands aren't like the datasheet one, but i managed to get it working reading the code of another opensource programmer (www.creasol.it) and porting to Bruce Abbott one.