Before few months I’ve bought bright new Hitec Aurora 9 radio transmitter with optima 7 receiver. I didn’t have time to play with it till now. I’ll not write how cool and robust radio it is. You can find it by yourself. The topic I’m going to write about is: “Adding PPM output into optima 7 receiver”.

Soon after I received the package i saw that it is based on ATMega48 and ATMega168 MCUs which I’m familiar with. I checked that pins to servos are connected to ATMega48 which generates PWM signals and communicats with ATMega168 by UART pins.

By oscilloscope I’ve found that the speed is 115200 8N1 and connected it to PC. There are 21 bytes being send from ATMega168 to ATMega48. Starting with 0xFF 0xFF then 9 channels 2 bytes per channel and ending 0xEE. The same research was published here
I’ve double checked, that no boot loader or anything is sending signals back to ATMega168. The connection path actually exists on Hitec Optima 7 receiver but oscilloscope showed in several situation (even upgrade) that ATMega48 is silent. ATMega48 is clocked by 7.3728MHZ crystal oscillator hidden on the other side of board. The fuses are:lfuse=0xfd hfuse=0xdd efuse=0x01 it means that flash is write only mode and could not be backup on the PC..

While ATMega48 is just a sister (with limited flash and RAM and without bootloader) of ATMega328 used in Arduino I developed PPM capable Firmware on it comparing timing with original Optima 7 receiver on oscilloscope. In the result the channel 1..6 behaves very much similar as in original FW. Channel 7 is providing PPM output.

Then I modified my biprog ISP by changing ATMega8 for ATMega8L to 3.3V ISP since the receivers part CC2500 is only 3.3V capable!!! And by soldering MISO, MOSI,SCK,RES,GND wires to the Optima 7 i managed upload the FW into receiver.

Now the problems:
Adding ATMega48 into arduino.
Edit hardware/arduino/boards.txt and add lines:

hiteco7.name=Hitec Optima

hiteco7.upload.protocol=stk500
hiteco7.upload.maximum_size=4096
hiteco7.upload.speed=19200

hiteco7.build.mcu=atmega48
hiteco7.build.f_cpu=7372800L
hiteco7.build.core=arduino

The Clock speed is actually not working correctly (Arduino 022)
In order to make UART working one has to modify hardware/arduino/cores/arduino/HardwareSerial.cpp
the line:
if (use_u2x) {
*_ucsra = 1 << _u2x;
//baud_setting = (7372800 / (8 * baud)) - 1;
baud_setting = (F_CPU / 4 / baud - 1) / 2;

} else {

Then recompile the project.

Using avrdude.
Since there is no boot-loader in ATMega48 for using arduino directly I used avrdude from Ubuntu. The hex file is stored after compilation in arduino IDE in /tmp/build./optima_ppm.cpp.hex and then uploaded by avrdude from command line.

AttachmentSize
optima_ppm.pde1.5 KB
HardwareSerial.cpp8.24 KB
optima7_dump.dat3.61 KB
IMG_0592.JPG1.3 MB