[Q]How to program Nano 3.0 with CH340G usb controller chip using Flip?[Q]

As the title suggests. I have a chinese Nano 3.0 brought from here - Nano 3.0 Alixpress but it comes with the CH340G usb controller chip and not the FTDI which is more common. Basically it's giving me problems trying to get it recognized in Flip so that I can program a hex file to it, specifically a PSGrade factory service mode dongle hex file so it's a pre made file, no sketches or knowledge/guides on how to create it either! I've tried many different ways with no luck, I do have a Teensy++2.0 as well which I usually use as a FSM dongle but it's also used for NAND & NOR reading and writing so i'd like to try and get the uno 3.0 working to replace it and save having to keep writing and changing the code on my Teensy. HID bootflash also didn't work and I can't find any other way to flash a hex file to it so i'm lost as to what to try next. I'm hoping that someone else has experience of these chinese versions with the CH340G and maybe knows how to get Flip or at least a way to write a hex file to it.

Any help is greatly appreciated, thanks in advance.

Hi, welcome to the forum.

I don't understand what you are trying to do...

You need to install a driver for the CH340G, after that is it just another COM port. http://www.wch.cn/downloads.php?name=pro&proid=65 In linux the CH340G is already working.

Can I run Flip in Windows 7 without installing Java ? I don't want to install Java, it was hard enough to remove everything of the (security risk) Java.

I'm trying to program a .hex file instead of a standard arduino sketch as I don't have a way to code it nor is there any info out there on how to do it. The problem is that Flip doesn't pick up the board because it's not listed in the device selection section 'cos it's filled with AT90USB162 kind of chips and not CH340G or 328P which the Nano has on board. I have installed the driver for the CH340G chip and it reports a COM port but I get nothing, either no response, errors or just continuing to upload with no action on the RX/TX lines. I've also now tried AVRDude in combination with the XLoader GUI for it and again nothing so i'm now at a loss as to what to try next to program a hex file to this Nano. I have tested that the Nano accepts sketches normally by running 2 different kinds of blink sketches, 1 faster than the other so I know it programmed ok but that was using USB & Arduino 1.0.6 which doesn't program hex files (although once a sketch is compiled it's converted to .hex file and uploaded so why isn't it possible to skip a step & give Arduino only a .hex file to program?)

As for can you install Flip without Java, i'm not sure, it doesn't ask for it when installing or prompt to install it so I don't think it does (could be wrong though!). Either way if you try to install and it needed it it would prompt you to accept the download which you could decline. There is 1 file I found in the Flip directory though which is util.jar so it's possible java is needed.

The Arduino Nano clone is working allright then. That is good to know.

Flip 3.4.7 requires Java.

Is the hex file a firmware file, or a file to be uploaded when there is a bootloader in the Nano ?
A compleet firmware file needs a programmer that is connected to MISO, MOSI and the other signals.
A file to be used with a bootloader can be uploaded via usb via the CH340G to RX / TX.

The Arduino IDE uses avrdude, so you have to focus on that.
A few simple options with -vvv shows extended information.

Do you have a programmer ?
Try this : avrdude -c -p atmega328p -vvv
Or something like this : avrdude -c -p atmega328p -P COM7 -b 57600 -vvv

I could not find a good explanation, but here are two links:

I tried running Flip in linux, but I have 64-bit linux and 64-bit Java, and the Flip 32-bit refused to start. I guess there is no 32/64 bit Java compatibility.

I've got it sorted now, finally! Before I read your post I'd read that Arduino compiles your sketch into an Intel hex file and then programs it so I knew it was possible somehow 'cos I could upload a sketch normally! So, I then found out to look into using avrdude as that's what arduino uses to program and in arduino itself to change preferences to verbose mode so I could see what command was being piped through which I could then repurpose for my own use. Suffice to say I found the commands needed using verbose mode and managed to program a hex file directly using avrdude command line!

Unfortunately the hex file didn't work with the ps3 as expected but that may be because either the usual dongles have very fast bootloader (the hex on the dongle has to run within about 200ms due to me having to press the power button and then eject within that time span to tell the ps3 to look for the dongle) or they don't have bootloaders although I can't see that 'cos I usually use a Teensy++2.0 from PJRC which has their bootloader built in to it. All I've got to do though is try a couple of ways with a couple of different psgrade hex files (there's a few out there, some for older firmwares so may not be useful for my purposes). I may even look into using my teensy as an arduinoISP and see if I can pick up programming that way.

I've only just started with these chips, just trying to find new ways to do different things and possibly saving me a bit of time in the process so is a new experience for me due to teensy having teensy loader which installs hex files in seconds. Learning a few bits now might help me with other work in the future or at least give me another option to look at.

Thanks for your replies though, it's much appreciated and your last reply was spot on even though i'd found out the answer finally! For anyone interested this is the command I got using verbose mode and which I used to run my commands, just adjust the parameters to suit your system.

avrdude -CC:\avr\etc\avrdude.conf -patmega328p -carduino -P\.\COM4 -b57600 -D -Uflash:w:C:\avr\PSGradenew.hex:i