thomaspfeifer / PPM2USB

AVR-based PPM to USB-Joystick Converter using V-USB
http://thomaspfeifer.net/ppm2usb_adapter.htm
59 stars 30 forks source link

Loading the hex #2

Open jacobbloy opened 7 years ago

jacobbloy commented 7 years ago

There is a lot online about using the usbasp to load hex to aurdrino but nothing about loading a hex to a usbasp

agittins commented 7 years ago

Somewhat confused by your statement jacobbloy - this project runs on an arduino, it does not run on a usbasp.

jacobbloy commented 7 years ago

In relation to this http://thomaspfeifer.net/usbasp_to_ppm2usb_mod_en.htm

agittins commented 7 years ago

Ahh, sorry - my mistake. I don't know if you can reprogram a USBASP directly from the usb port, but you could certainly do it using an ISP (in-system-programmer). It connects directly to the MISO/MOSI etc ports on the atmel chip. You can make an SPI programmer using an arduino, here's a writeup on how to do that: http://diyjunky.blogspot.com.au/2011/09/using-your-arduino-to-program-turnigy.html When I built mine (using an Arduino uno) I also had to add a cap of 10uF or more between reset and ground (on the arduino) to hold reset high. I also had to make a change to the EEPROM code that you'll find in the comments there - that was with an older version of the arduino code though so you might not have that issue. As for the pin connections, you might be able to solder to them directly, or trace the board to find a convenient place to connect to, or you can buy a programming tool which places the pins in the right place for you, like this one: https://hobbyking.com/en_us/atmel-atmega-socket-firmware-flashing-tool.html

agittins commented 7 years ago

So I googled "program usbasp firmware" and the first three results (at least) walk you through exactly how to do it.

jacobbloy commented 7 years ago

Yes I was planning you use 2x usbasp to do the programming and I have been looking through them and have tried avrdude TOOL chain with your hex with no luck. Also I see you said you used avr gcc does this batter or can I still use avrdude.

agittins commented 7 years ago

Note that this isn't my project, so the hex file isn't from me and I haven't actually even built one of these ppm2usb modules :-) What I have done though is flash the atmel chip in my turnigy 9x receiver (and on several speed controllers) using an arduino as the ISP. I'm on linux, and I used avrdude to do the flash. The command I used at the time was:

avrdude -c avrisp -p m64 -b 19200 -P /dev/ttyACM1 -v

It seems you have not been very clear with what you are doing or what the problem is. It seems you already knew about the heaps of info that is out there but you said there was "nothing about" doing it.

How about you detail what you have tried, what happened when you tried it, and go from there? This will work better than expecting people to guess what you are trying to do.

jacobbloy commented 7 years ago

sorry mate i thought that it was your project. but i will let you know what i am doing, I'm trying to get my 9x to work in a sim, i run on a mac so i can't use smartpropoplus as my audio inputs are stereo and it down work, so i though i would make one of these ppm2usb, https://drive.google.com/file/d/0Bym9XrdeViekQ3FaeXhHdS1BN1U/view?usp=sharing there is a image of how i flashed the board using avrdudess just a guy version. i seem to upload the hex with no problems but then i plug my usbasp into my computer its meant to show as a hid joystick but nothing the less don't even light up.

jacobbloy commented 7 years ago

I'm sorry mate! i didn't realise i should have been using https://github.com/duststorm/PPM2USB instead of yours. i would say the schematics are different.

agittins commented 7 years ago

In case it's not clear - none of these projects (including this one) are mine, I'm just some random dude who started following this project a year or two ago and thought he could help by clearing up a vaguely written question :-) Sounds like your problem is not with flashing the unit, it's with working out why it's not working. This post might help you gather more diagnostic info, to at least find out what your device gets detected as (if anything) https://discussions.apple.com/thread/4170078?start=0&tstart=0 Since you are now at the "device is flashed but doesn't work" stage you're beyond where I can be of much help, but hopefully someone else will be able to step in with ideas if you post some diagnostics.

jacobbloy commented 7 years ago

Once I used the correct code as in the code I posted a link for in my last post it started working flawlessly. For any one els that reads this is might be helpful.