In the new Arduino boards, the traditional FTDI USB-to-serial chip has been replaced with an Atmel ATmega8U2 chip, which has built-in USB. We'd like to do the same on the next APM board, and use this chip to do double-duty: replace the FTDI chip that's now on the IMU shield, and replace the PPM encoder chip (now an Atmega328) that's on the APM board. This will make smaller, simpler, cheaper APM boards for all going forward. And bye-bye FTDI drivers!
There should be enough memory in the Atmega8U2 for both the OptiBoot bootloader and the PPM encoder code. But we need some help in combining them in a way that each won't interfere with the other. We've got a lot of great programmers here at DIY Drones. Who's up for the challenge? (Free boards for any volunteers)
Here are some starting links.
- A tutorial on reprogramming the Atmega8u2 (you need to log into the Arduino forums to see it)
- The APM PPM encoder source code
- Details on how this chip works with Arduino: The ATmega8U2 firmware source code is available in the Arduino repository. The ATmega8U2 is loaded with a DFU bootloader, which can be activated by connecting the solder jumper on the back of the board (near the map of Italy) and then resetting the 8U2. You can then use Atmel's FLIP software (Windows) or the DFU programmer (Mac OS X and Linux) to load a new firmware. Or you can use the ISP header with an external programmer (overwriting the DFU bootloader). See this user-contributed tutorial for more information.
- The Atmega8U2 datasheet. We can move to the 16k or 32k versions if necessary
Comments
@sebastian:
>should it be able to go into USB mode when running?
should be like you said, else the mcu is programmed in such a way that it is unusable.
>eg plug in your lipo first and then plug in USB, that would be more challanging
the lipo provides power to the system. without having a lipo transparent communications would be impossible.
FDTI chip on oilpan can communicate while ppm encoder is working. This is a "must" for ArduPilot (for example trasnmitter calibration). Also it can be used in bench testing to view parameters and communications. FDTI chip is not used for only programming Arduino programs to mega1280.
Switching between programming mode and ppm mode seems a bit wrong to me. I think new chip must be able to handle both ppm and usb communications simultaneously.
@Chris, One issue that may need to be resolved is USB Vendor ID.
It seems that the Arduino folks have purchased their own USB VID. I do not believe they want 2nd parties using their VID. You may have to buy a USB VID from USB.org if it is worth it (Cost savings of FTDI chip/board amortized over the cost of the VID). This USB VID hurdle is what will probably impede clones of the UNO 8U2 style boards regarding the FTDI replacement, this is just my take on the whole situation, i'm not an expert, maybe others could shed additional more promising insight into this.
From the firmware readme.txt of the repository:
"The production version of the arduino-usbserial firmware uses the Arduino VID. This is only for use with official Arduino hardware and should not be used on other products."
sebastian,
the usb interface is located on the 'small' chip. to talk with the other mcu you are in a need having transparent communications because of the 'missing' link provided by the ftdi chip previously.
more challenging, isn't it :)
robert
now we come to the point doing real sw :)
add a command which switches between ppm and download mode.
in essence this would be a new protocoll between the members of the diydrones hw boards.
so:
- source sends application type
- source sends 'enter bootloader' (target compares the mode of the app type and when ok it switches to
bootloader mode - command is saved in the eeprom. on booting it detects the bootflag and enables the bootloader)
it could also be handled that the firmware stays for a couple of ms in bootloader mode when booting.
now the service tool just sends an enter bootloader code and voila...
adding dtr or other pins as bootloader indicator is a waste of pins to me.
robert
-
1
-
2
of 2 Next