Author Topic: Programming uPD78F9418A renesas mcu. How to send pulses between two voltages?  (Read 4709 times)

0 Members and 1 Guest are viewing this topic.

Offline CyberPKTopic starter

  • Contributor
  • Posts: 10
  • Country: it
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.
« Last Edit: May 02, 2016, 04:44:01 pm by CyberPK »
 

Offline Bruce Abbott

  • Frequent Contributor
  • **
  • Posts: 627
  • Country: nz
    • Bruce Abbott's R/C Models and Electronics
Which Renesas MCU are you trying to program?
 

Offline CyberPKTopic starter

  • Contributor
  • Posts: 10
  • Country: it
Analog multiplexer? Maybe CD405x?
There isn't a simpler way using some transistors?

Which Renesas MCU are you trying to program?

Hi 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.
« Last Edit: May 02, 2016, 05:00:52 pm by CyberPK »
 

Offline Bruce Abbott

  • Frequent Contributor
  • **
  • Posts: 627
  • Country: nz
    • Bruce Abbott's R/C Models and Electronics
You can use an NPN and PNP transistor to switch Vpp to 10v, and a diode to hold it up to 5v normally.

   
 
The following users thanked this post: CyberPK

Offline CyberPKTopic starter

  • Contributor
  • Posts: 10
  • Country: it
You can use an NPN and PNP transistor to switch Vpp to 10v, and a diode to hold it up to 5v normally.

Thank 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.

CD405x is not as simple as transistors, but can be potentially cheaper. One of the cheapest chips.
You're probably true, but it's hard for me to supply such component.
« Last Edit: May 04, 2016, 05:04:41 am by CyberPK »
 

Offline AndersJ

  • Frequent Contributor
  • **
  • Posts: 408
  • Country: se
The CD405x may have a too high series resistance if the receiver end needs current.
"It should work"
R.N.Naidoo
 

Offline Bruce Abbott

  • Frequent Contributor
  • **
  • Posts: 627
  • Country: nz
    • Bruce Abbott's R/C Models and Electronics
You can use an NPN and PNP transistor to switch Vpp to 10v, and a diode to hold it up to 5v normally.
The problem is the lacking of programming documentation for the uPD78F9418A.
Yes, 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 the Hilo 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...
   
 

Offline amyk

  • Super Contributor
  • ***
  • Posts: 8270
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.html
http://elm-chan.org/works/sp78k/78k_v850.zip
 

Offline CyberPKTopic starter

  • Contributor
  • Posts: 10
  • Country: it
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.
 

Offline CyberPKTopic starter

  • Contributor
  • Posts: 10
  • Country: it
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 fast :( I've just verified it using a pickit2 as logic analyzer.  :palm:
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?
« Last Edit: May 04, 2016, 07:42:23 pm by CyberPK »
 

Offline Bruce Abbott

  • Frequent Contributor
  • **
  • Posts: 627
  • Country: nz
    • Bruce Abbott's R/C Models and Electronics
The pulse must be between 10 and 100 us but i cannot pull up and down DTR as fast... Maybe the 1ms latency of the usb data packet?
Probably. 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.   
 
The following users thanked this post: CyberPK

Offline CyberPKTopic starter

  • Contributor
  • Posts: 10
  • Country: it
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 :)
« Last Edit: May 05, 2016, 05:56:56 am by CyberPK »
 

Offline CyberPKTopic starter

  • Contributor
  • Posts: 10
  • Country: it
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
« Last Edit: May 05, 2016, 05:52:59 am by CyberPK »
 

Offline CyberPKTopic starter

  • Contributor
  • Posts: 10
  • Country: it
Yes, 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 the Hilo 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...
   

Just 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 :(
« Last Edit: May 06, 2016, 07:30:40 pm by CyberPK »
 

Offline CyberPKTopic starter

  • Contributor
  • Posts: 10
  • Country: it
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 8SC

P.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.
« Last Edit: May 07, 2016, 05:16:50 am by CyberPK »
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf