Home > Electronics, FPV, Programming, RC Planes > Showing APM telemetry data on Hitec Aurora’s screen (revisited)

Showing APM telemetry data on Hitec Aurora’s screen (revisited)

In my previous post I described building adapter which converts APM telemetry data to be shown on Hitec Auroras screen. Since then APM2 hardware has been released and some code changes made previous version unusable. I updated the hardware and software to support also APM2. I couldn’t get SPI transfer to work in APM2, but fortunately it has a spare serial port to use. The good thing is that now only three wires need to be connected to APM2 and nothing needs to be soldered.

APM1 is still supported, wiring instructions are in the previous post. When using with APM1, USE_SPI must be defined in main.cpp.

This version also includes support for showing GPS coordinates. Previously I thought it’s not really useful feature, but I changed my mind after searching for crashed plane in wintery forest in the light of the setting sun for a long time. Coordinates would have been useful after all. Time and Date are still unsupported since APM internal date format is yet to be decided.

hss

Updated schematic

Connecting to APM2. Only three wires are needed.

Sources are uploaded to github: https://github.com/JanneMantyharju/apm-hss-emulator

Update 5.1.2013 – Error in schematic corrected. Added fet to power video transmitter after GPS lock has been acquired.

Update 7.1.2013 – Kind of a long shot, but if somebody wants to borrow me a Spectrum or Graupner system, I could modify the device to support different telemetry protocols.

  1. Francesco
    18/09/2012 at 22:36

    hello,
    I really like the ability to have the the Ardupilot mega 2 data on the aurora telemetry.
    I’m not an expert in electronics and information …
    … so, sorry for my questions!

    I bought a kit with ATMEGA328P-PU with programmer.

    I had downloaded the software at the link below, patched and compiled the arduplane 2.61.

    To compile the main.ccp I had to change

    // # include “WProgram.h”
    // with

    # if defined (ARDUINO) && ARDUINO> = 100
    # include “Arduino.h”
    # else
    # include “WProgram.h”
    # include
    # endif

    and in hss.pde

    houses hss_airspeed:
    ui = airspeed.get_airspeed_cm () / / before it was: ui = airspeed;
    break;

    Now everything is compiled but I do not know if that changes are ok or they are wrong.

    The other thing that I would like to ask regard the wiring diagram: the programmer Atmega328 shema says to connecting vcc and gnd (7:08) 2 rx and tx 3 for programming

    I understood from your schema that ardupilot mega2 have to beconnected to sv2 (which is used by the programmer) and I think the optima’s data port have to be connected to sv1, am I right?

    about isp port of your diagram, is this for AMP1 connection?
    May you post a connection schema to Optima?
    thanks and hello

    Francesco

    • 19/09/2012 at 13:20

      Hello and thanks for the comments. Your modification seem correct, I can verify those later this week as I thought to update the patch to match the latest APM firmware.
      SV2 is indeed used to connect to APM2 (you only need to connect rxd and gnd). If you have programmer that uses txd and rxd pins, program the ATMEGA first and then connect it to APM.
      SV1 is used to connect to Optima receiver. The easiest way is to use Hitec servo cable, as it’s wires are colored black,red and white, matching to the schematic. The connector on Optima side is normal servo connector.
      ISP connector is used for APM1, but I’m also using it to program the ATMEGA itself. This way I can buy bulk chips that don’t have the Arduino bootloader preprogrammed and I don’t need to reserve space for the bootloader.
      To program an empty avr, you need a programmer like this: http://www.ladyada.net/make/usbtinyisp/

  2. Francesco
    19/09/2012 at 14:56

    hello,
    many thanks for your answer.

    To program the ATmega I bought this kit:
    http://www.ebay.com/itm/221121384301?ssPageName=STRK:MEWNX:IT&_trksid=p3984.m1497.l2649
    I hope it’s right!
    In this case could I don’t build the ISP circuit part?

    Do you think it would be possible to make an interface for the aurora’s 2.4 module (like this: http://www.hitecrcd.com/products/aircraft-radios-receivers-and-accesories/telemetry/telemetry-interfaces/hts-iview.html) to see on an Android device the mission planner’s horizon?

    Thank you again
    Francesco

    • 19/09/2012 at 15:40

      You can use that programmer and omit the ISP connector, but note that you must add the 16MHz resonator circuit as shown on the eBay page. By default (most) avr’s run from internal 8MHz clock, but arduino assumes 16MHz external clock.
      Also don’t use the included Makefile but instead use the Arduino IDE to compile and upload the code. The Makefile is hardcoded to AtMega88 chip with 8MHz clock which I used.

      It’s certainly possible to build the module interface. I once saw the protocol described somewhere and it was a little bit easier to communicate with than the receiver.

  3. Francesco
    19/09/2012 at 17:23

    Ciao,
    you are a GURU!!

    one more question, I hope the last …. at the moment

    I compiled the arduplane with patches in the arduino’s IDE. With the same tool I can upload the “firmware” on ardupilot.
    To setup the dual aileron, enable airspeed and configure ardupilot I have to use the APM planner: does it overwriting “my” software ?

    • 19/09/2012 at 17:30

      APM configuration parameters are stored in the eeprom memory and thus they don’t overwrite the program memory. However if you choose to upgrade APM firmware from the mission planner it will replace your modifications with the stock firmware, so don’t use that feature.

  4. Francesco
    20/09/2012 at 14:57

    right, thanks!
    About my previous post, I believe that the more difficulty would be to add the inclination data to be trasmitted through hitec’s telemetry to pass at copter-gcs’ HUD (https://lh4.ggpht.com/z4VNWc7QDMKAq9gs9aC4FkItMuI_U1ABureW4-DeTtInwf43VrVunSpvt9ts2AGO4g = h230).

    Would be, otherwise, possible to replace the optima receiver and the aurora 9 module with “3DR Radio Telemetry Kit”?

    On the plane there should no problems (http://code.google.com/p/ardupilot-mega/wiki/Joystick) but I have no idea about how to connect the air module to the Aurora.

    Do you know if already exist a similar project that can be used?

    I’m looking for a way to be able to have all the data to the ground without filling with transmitters and antennas the airplane and for don’t need to have around a PC

    Francesco

    • 20/09/2012 at 15:58

      Inclination is a bit tricky since Aurora doesn’t support that. You can however use any field for your own purpose. For example I’m using RPM-1 to show mAh used, RPM-2 for airspeed and TEMP-2 for throttle position. You can even conviently rename these fields to what you want on Aurora. RPM 1-2 and TEMP 1-4 are usable.

      It’s possible to just use 3DR telemetry for everything. The easiest way is to use adapter which connects to the student port on the Aurora and with USB to computer and converts all channels send from Aurora to joystick axels on PC. No additional software needed. I have one extra adapter if you happen to need one. The downside is that if your computer freezes or the mission planner crashes, you are out of luck.

      More reliable way might be to use microcontroller (like Arduino) to read channel values from Aurora, wrap those to Mavlink packets and send them via 3DR radio often enough and between those packets accept packets from PC and send those also. This way you would not lose control if something happens to the computer. I did something like this in my earlier blog post: http://wp.me/p12J9M-a

  5. Francesco Magni
    22/09/2012 at 16:41

    hello,
    I read Making of XBee-PRO 868 based r / c controller, wonderful project, but I fear too hard for me.

    Being able to rename the fields of telemetry hitec, this probably is the best choice for what I would do.

    the hitec HP-22 could transmit telemetry data via USB to a PC.
    I think it might be possible to attack even a android device.
    I read that the copter-gcs it difficult to interface with the USB and I do not know if there may be problems with the protocol with Copter-GCS.

    What do you think may be the easiest solution to get the hud working?
    thanks
    Francesco

    • 24/09/2012 at 15:37

      I don’t think there’s any easy way for Android. If you want to use PC with mission planner, I suggest you to use standard XBee radios for the flexibility and use Aurora features for redundancy.
      If you want to use Android, there is quite a bit more to do. First you would need to create Android application, which would display the data you want. Then create interface from for example IOIO board (https://www.sparkfun.com/products/10585) and write code to parse data that the Aurora outputs.
      Since nobody has done it before, there’s no way you can get away without coding =)

  6. Francesco Magni
    06/10/2012 at 01:22

    hello,
    At the moment I decided to see only telemetry data on aurora.
    I’m afraid to have made a mistake, but I do not understand what is wrang.
    I compiled without errors ArduPlane with patches and also main.cpp.
    when I connect the APM 2.5 to the optima data port I can see the new telemetry entries but without any data.
    What could it be?
    thanks
    Francesco

    • 06/10/2012 at 11:49

      Ok, lets start to debug it. Connection between the adapter you built and Optima seems to be working since the new menus appeared. Next thing to check is that APM sends data to adapter board. If you have FTDI cable, connect it to “to device RXD” cable and gnd. The data is in binary, but if at least some garbage appears to terminal it’s probably ok. If nothing is being transmitted then something went wrong when applying your changes to APM firmware.
      If APM sends the data, the next thing to suspect is that the adapter does not receive it correctly. The most probable reason for this is that the AVR runs at different clock speed than the code is compiled for. In this situation the UART speed is set incorrectly and AVR does not understand the data it receives. I don’t know about your device, but if you build the one described in the blog post, note that you must program the fuses for 8MHz clock speed. By default (most) AVRs run at 1 MHz, but the code is compiled for 8 MHz speed.

  7. Francesco Magni
    07/10/2012 at 00:01

    Ciao,
    I have tested the tx2 signal connecting the APM to the USB to RS232 converter. In “arduino’s serial monitor” I can see scrolling same sign.
    I have take a look to the arduino IDE searching for the 8MHz but i can’t find it.
    My device to work needs the 16MHz resonator circuit. Could be that?
    May I change the serial speed of uart2 istead?
    thanks

  8. Francesco Magni
    13/10/2012 at 22:36

    hello,
    I went ahead with debugging.
    I tried to give some fixed values ​​to variables in the patch and the serial monitor, and everything is ok.
    I tried then to give fixed values also ​​to variables in the device, like temp and airspeed, but on radio telemetry data no change happens
    How can I monitor the data transmitted over i2c?
    Can fuses affect the transmission Optima?
    thanks

    • 14/10/2012 at 19:16

      Fuses shouldn’t affect the I2C communication as it has clock signal. Monitoring I2C requires logic analyzer of some kind, so there is no simple way to do that. You could try with a different value pull-up resistors (R1 and R2) as wire length affects to them. Also, insert some debug message to Send_hitec() function. If you see the debug message, then at least optimas request for data is received correctly.

  9. Francesco
    05/11/2012 at 00:21

    hello,
    I’m waiting for an AVR ISP programmer USBtinyISP to upload the bootloader as Arduino Pro (3.3V, 8MHz) ATMega328, I think it is what you used.
    in the same time I i saw some i2c interface scheme to the optima and I read somewhere that the operating voltage for the optima data is 3.3V. then I made a schema with pull-up resistors connected to a SDA and the SCL. I also added a voltage regulator and two BSS138 on SDA and SCL lines as in the diagram http://www.d68.nl/sensorboard/resources/schematic.pdf
    No change happens in the telemetry data of the aurora: temperatures remain at -40 speed and altitude and fuel are empty and everything else is 0.
    May you tell me how to just send static value to to optima, I tried writing the value in the case statement I did not understand how to write the data in the send function to the optima.
    thanks
    Francesco

    • 12/11/2012 at 16:53

      At the beginning of the source you can see the array that holds all the measurement values. When Optima queries the data, device sends parts of this array row by row. All setter functions like setrpm modify this array and write new values to it. The simplest test is to remove everything inside the loop function and put just one row like setRpm(1, 100); and check can you get value 100 to appear on Aurora screen.

  10. Francesco
    14/11/2012 at 00:10

    IT WORKS!!
    When I got the ISP programmer I tried to rewrite the fuse on the device, after that I could not load the software.
    I rewrote the bootloader using, this time, it as a device in the ATmega 328 Arduino IDE 16MHz 5V (it was previously set as one arduino).
    At this point I have compiled a program made ​​from only the parts of the code related to the serial and closely linked to the main loop.
    I connected the device to the RXD of the APM and the TXD port to the PC and I saw it clear the encoding of comunicazione. I have then compiled your code and it still communicate with the APM running with clear data over the serial port, yet no changed since appeared in the radio display.
    Then I came back on my feet and I excluded the part of the circuit that I had copied from d68 (the one with the 3.3 V regulator and BSS138) leaving that suspended and soldering up to the pin scl and sda and now the telemetry value appare and change!
    Now my device is done by an ATmega 328 P – PU, the crystal is at 16MHz and the two condensarori of the resonant circuit (pin gnd 9 10), for serial connection i have gnd and RXD, for I2C gnd 27 and 28 with a resisteza pull-up one between 27 and vcc, other between vcc and 28 (only difference to the publication of your project together the bootloader)
    I am very happy that it works, I think having the APM telemetry data to the radio’s telemetry is great.
    I want to thank you very much for the kindness with which you have explained me, and I understand that my inexperience have made ​​me stupid questions …so Thank you.
    I will write you again when I recive a Aduino mini with I like to try to have the inclinations of an Android or on a screen than to arduino.
    by
    Francesco

    • 14/11/2012 at 01:18

      Good to know that it finally worked for you =)

  11. Anonymous
    04/12/2012 at 23:43

    hello,
    have you a code example to get data from the form AFHSS aurora module?
    I tried a google search but I only found Optima interfaces.
    I’m waiting for an arduino with display and I want to show on graphical roll and pitch …
    Thank you very much
    Francesco

    • 06/12/2012 at 23:45
      • Francesco
        09/12/2012 at 01:08

        Hello,
        I saw this code:
        http://www.rcgroups.com/forums/showthread.php?t=1389908&page=9
        The library and the code give two sequences of data but at the moment I have not been able to decipher properly

      • Francesco
        11/12/2012 at 23:54

        hello Antibore,
        I found the data I need into the array.
        Now I can receive data from APM, pass them to the optima’s telemetry port via your device, see on aurora screen data and process them with another arduino ….
        all flow works!
        The more relevant data for me are transmitted as temp1 (airspeed), temp2 (various), temp3 (roll) and temp4 (pitch).
        My problem, now, is the update delay between amp and aurora’s display: it take almost 1 second for data upgrade and these time is too much for various, roll and pitch.
        Have you any experienced about?
        Do you think the problem might be a defect in the hitec telemetry trasmission system (in apm planner mav via usb data are updated in real time)?
        Have you have any suggestions for me?
        Can I do anything to reduce this delay?
        Thanks and ciao
        Francesco

      • 12/12/2012 at 00:55

        About the update rate, you can see that in the ArduPlane.pde file, hss_update function is called in medium_loop function, which is not run that often and each call updates one value. You can do some of following: 1) move hss_update to loop that is run more often. 2) Make data that is important to you update more often than others 3) Reduce amount of data sent from apm to the device.

        Be aware that doing 1. takes time away from APM to perform the actual flying, so be sure to test well!

      • Francesco
        12/12/2012 at 02:15

        hello,
        when I look at the debug data to the serial port of your device I see that the data is updated quickly.
        I read in HITEC 2.4GHz Receiver Instruction among the Warning that “there could be a possible time delay in receiving telemetry data from the HTS-SS (sensor-station)–depending on the conditions in the area you fly” but in my case I have almost two seconds of delay trying the system in the same room.
        So I think the delay is on the optima.
        I can try to reduce the number of transmitted data and see if the radio becomes faster (option 3). I hoped there was a way to tell optima do not waste time within the data transmission (I2C).
        If I can try tomorrow, I will let you know the test result.

      • Francesco
        13/12/2012 at 01:54

        Hello Antibore,
        you’re always right.
        I tried the solution 3) by removing the less important data (for me) from the hss and from your device: In this case the radio update have half delay than with all data
        I also tried the solution 1) with all the data and it was even faster.
        Perhaps the best solution is the number 2), but I did not know to how do that:
        If I give priority to some data, in the hss or in adapter code, with a cycle that transmit some data often then others, can optima understand or in my display I obtain intermittent telemetry?
        How can I do that
        thank

  12. Jaime
    07/12/2012 at 04:51

    Hello,

    I ran accross this project and I became very interested in building the circuit.
    I have bought the components online and I am waiting for them to arrive.

    I am really newbie in arduino, so sorry for the very basic questions….

    I took a look in the zip with the source, and found out that there is a single file called Master.
    With what program should I open this?

    Also, do you know if the circuit/program works with APM 2.5+ ?

    Thank you very much.

    Jaime

    • 10/12/2012 at 00:15

      Hi!

      I don’t know how you were able to download sources as a zip file. The code is available from gitorious as a git repository, so you need some git client program to clone your own copy. If you want to skip the hassle, you can open individual files from web interface and save them to your computer one by one, since there’s not that many files.

      I don’t own 2.5+ version myself, but it looks similar enough to work without modifications.

      • Anonymous
        10/12/2012 at 14:07

        Hello,

        Could I get power directly from servos output of the reciever or apm?

        Thank you

      • Francesco
        12/12/2012 at 00:00

        I’m working with a APM 2.5 and for me your code work with the only change in 1th post

  13. Francesco
    09/12/2012 at 01:21

    Hello,
    in the antibore software there are the patches to be applied to arduplane code and the software for the interface device.
    You can find all the code in his link above (https://gitorious.org/apm-hss-emulator/apm-hss-emulator/archive-tarball/master)
    I did the first device with a atmega388 after with a arduino nano and also with arduino mini and since I’ve understood the pull-up resistor all the configuration has work well in all cases.

    • Anonymous
      10/12/2012 at 14:09

      Hi francesco

      Could you send a link to your final schematics, please?

      Thank you,
      Jaime

  14. Francesco
    11/12/2012 at 22:30

    Ciao,
    you can find it in the 2nd chapter of:

    Click to access an97055.pdf

  15. Jaime
    23/12/2012 at 19:25

    Merry christmas!

    I am thinking about using a power regulator (LM7805) to provide 5V from the servo connector. Do you think this will work?
    Do you have any suggestions on the power source?

    Also, I purchased the programmer below. Do you know if I will need aditional components to use it to program the circuit?

    http://translate.google.com.br/translate?sl=auto&tl=en&u=http%3A%2F%2Fproduto.mercadolivre.com.br%2FMLB-449268453-usbasp-avr-programador-para-cpu-atmel-atmega-arduino-_JM

    Thank you,
    Jaime

    • 23/12/2012 at 21:18

      Since you have to connect the device to APM anyway, it’s easier to get power from APM. You can use regulator, even LM78L05 for smaller size because the device needs just few mA of power. You should not then connect +5v signal from device to APM to avoid devices regulator try to power the whole APM+servos.

      BTW, normal servo voltage is +5v, do you need regulator anyway? and if you are using 6v servo voltage, you need select low-voltage dropout regulator instead of 7805.

      The programmer looks ok.

      • Jaime
        24/12/2012 at 01:24

        Thank you for your prompt response.
        From your comment, I understand that I could connect the Chip Set (SS) of SV2 (also pin 16 of mega88) directly to VCC of your diagram. Is my understanding correct?

  16. 24/12/2012 at 01:30

    If you are using APM 2.x you can leave SS unconnected, it’s only needed with APM 1.x when using SPI data transfer. Just connect GND, VCC (+5V) and RXD to APM.

  17. 01/01/2013 at 08:30

    Hi Francesco,

    I have built Antibore’s device and done the patches.
    I am now at the same stage you were when the menus appeared on the Aurora, but the values were not updated.

    By you comments I undestood that you did some changes on the connections on the pin 28, by adding a resistor between pin 28 and VCC. Is that it?
    Could you inform the value of the resistor you used?

    Were there any other changes?

    Thank you,
    Jaime Felipe

  18. Francesco
    01/01/2013 at 11:56

    hello
    I have used the schema that you can find in the philips document on page 9 (http://ics.nxp.com/support/documents/interface/pdf/an97055.pdf Section 2.2) you can find the same shema at http://en.wikipedia.org/wiki/I% C2% B2C

    basically you have to connect the pins 27 and 28 directly to the AFHSS plug and connect resistor between each line and the +5 v.

    with this change for me came the data in addition to the menu.

    about the values ​​of the resistors I used different values ​​in my test (4.7-2.2-3.3-1.5) now I have two devices one with 4.6K (yellow blue red) and the other with 3K (brown black red)
    (with all thelisted values the device worked for me )
    here explains in easy way what happens when you change the values ​​of the pull-up
    http://dsscircuits.com/articles/effects-of-varying-i2c-pull-up-resistors.html

    the changes that I made ​​after were for pitch and rolland variometer (altimeter) that interested me.

  19. 02/01/2013 at 22:23

    Hello,

    I tryed to use the pull-up resistors: 2 x 4.7K: One resistor between VCC and 27 and another resistor between VCC and 28 (also tryed 2.9K).
    Pin 27 is also conencted to pin 2 of Optima 7 data connector.
    And pin 28 is also connected to pin 1 of Optima’s connector.

    I am getting VCC from pin 2 of APM connector.

    With this configuration, the telemetry options do not show on the menu of Aurora.

    If I add a 120 ohms resistor between VCC and 27, the menu is shown, but no data is displayed.

    Francesco, could you inform if this configuration is any different from the one you have obtained success?

    Do you have suggestions of how can I debug the solution to pinpoint the problem?

    Thank you,
    Jaime

    • Francesco
      03/01/2013 at 00:26

      hello
      I also had trouble with this step.
      my suggestion is to see first if your device receives data.
      In Antibore’s sofrware there are many Serial.print who write on the TX port of your device the values ​​that you want to view.
      I have attached the txd pin and gnd pin to a usb to serial adapter, connected to the PC, and I can monitor the port with arduino’s serial monitor in the ide or I can saw the data scrlling in zoc emulator or with an advanced serial monitor (i don’t remember name: it was go out of trial..).
      if you are in this situation then you know that the data arrive well in the device and you just have to use them, but if you do not receive the data, before understand what is wrong in transmitting to aurora you have to understand whay you don’y read that from apm.
      As I wrote I now use an arduino arduino pro mini and micro, so I have taken my working prototype built with the ATmega328 and the pull-up resistors are brown black red => 3k (check it).
      if you can read well data data from device serial port, the problem is on i2c.
      hear a “txt schema”:

      27______________________________sda
      3k|
      VCC_______|
      3k|
      28_________|_____________________scl
      GND_____________________________gnd

      if you have a place where I can send the pictures let me know I will send you the front and back of the device, or if you prefer a design (although it is the same as the philips)

  20. Jaime
    03/01/2013 at 16:47

    Thank you for all the attention and patience Francesco,

    I used an FTDI cable in order to read serial output from the adapter and I verified that an error is happenning for every interaction of the main loop on the adapter.
    So I guess, there is a problem in the communication from APM to the adapter.
    After going through all the connections without finding any problems, I will check the SW ardplane.
    What I did was that I applied the patch manually (still trying to figure out how to apply the patch in an import like manner) on the latest version of arduplane.
    I guess I did something wrong on this proccess and data is not going through.

    Next, I am going to download the 2.61 version as you did, and apply the patch over that.
    Another thing I am going to try is to use FTDI cable to read what’s coming through from APM.
    How did you apply the patch in arduino ide? Also, I saw 2 patch files. Do you remember which one did you use?

    Well that’s only part of the problem….
    The menus still don’t appear on the aurora, using the 4.7k pullup resistors. Now, I think it might be a problem with the version of the firmware of optima 7.
    I will do an firmware update just to be sure.

    I feel really stupid about this I2C communications, since it seems very simple, but is not working for me. I checked the phillips design on page 9, and it seems exactly what I am doing.

    Researching the web, I came accross this project that is also focused on the I2C communications between APM and optima, and it has a more complicated I2C interface.

    Click to access schematic.pdf

    If the firmware upgrade of the optima doesnt work, I might give a shot on this more complex I2C design.

    Best regards,
    Jaime

    • 03/01/2013 at 21:26

      I just tried out, the patch does not apply to the latest head of ArduPlane, the ArduPlane has changed too much since I made the patch. I will be updating the patch to newest version of ArduPlane, but I’m quite busy right now so I can’t give any time estimate. I’ll also modify it to be used with ArduCopter since I bought myself hexa as a xmas present.
      In the meantime you can use version proved to work, like 2.63. I removed the old patch file (0001-Hitec-sensor-station-support.patch) which was left on the repository by mistake.
      Patch can’t be applied with Arduino ide, to add patch you need to have git installed and use git am command. The patch inserts only few lines (marked with +) so you can do it quite easily manually.

    • Francesco
      03/01/2013 at 22:01

      Hello.
      if you have an error for each CILO means you do not meet any condition of the case.
      If you do not meet any condition of the case then it means that your APM and your device is not riscono to communicate with each other in the right way.
      I do not really know the ftdi but I think it is similar to the usb serial adapter that I used.
      if he works the same way then I would look at the transmission rate set for the serial.
      your APM, if you have not changed the changes antibore, communicates to 38400 No 8b para.
      You must see that your device has the serial speed set to the same speed and with the same parameters.

      For the patch I tried the command on windows but not tyrovandolo I applied the differences by hand.
      Basically you adjust the setup dell’arduplane and set the speed of your serial, then modify the loop and tell it to use the hss to transmit data to your device.
      The changes are in the patch file that can be read as a dif

      If you connect with something (fdti) apm to your PC you can see on your apm transmits something, but if so what you see are strange characters, then check the serial port parameters: if you are set as the device speaks see the name value pairs.

      From what you tell me the idea that I would make is that you speak to APM 38400, your PC and your device at the same speed patlano different from 38400: well then you see “err” because nothing good comes.

      Regarding the firmware dell’optima, if you first saw the data or you see the power dell’optima (see also the station without telemetry connected) then it is not ‘a problem rìfirmware version of the receiver.

      The fact that you do not see the menu means either that you do not speak sull’I2C or device addresses are wrong.
      Also I have gone through the scheme of d68 that you put in your mail.
      The entire management of the sensors you do not need, I bought the BSS138 SMD and I have welded, but it did not work because the bus is 5V and the schema (you can also find the document philips) is for use on the same bus devices to 5V together with devices to 3 V fixed.

      My first working scheme was taking scl and sda before the two BSS138

      I did a test for you with a device that does not funziaona with the optima (I used what I connect to dawn looking for an divwrso id):
      if you connect it to a date dell’optima i2c and do not leave the new menu means that the head + of your resistors are not connected to the 5V

      Ciao

  21. 04/01/2013 at 01:18

    Hi,
    The problem of the communications with APM is indeed the baud rate.
    Even though the function Setup of the adapter sets the baud rate to 38400, the serial monitor only shows valid data when I set the speed to 4800 on the Serial Monitor.

    After figuring this out, I changed the speed in the APM code to 4800. After that, there was communication between APM and the adapter.
    I am still trying to understand why the speed of the adapter is 4800 instead of 38400.
    Could it be something with the fuse bits? I haven’t changed them.

    I am also thinking about the possibility that this speed problem might be influencing the communication with Optima… I have double checked the connections of the pullup resistors and they are ok.

    Here is the drawing of the circuit I have built.

    Regarding the patch files, I did the changes on the APM code manually, as suggested.

    Thank you very much.

    Regards,
    Jaime Felipe

    • 04/01/2013 at 10:35

      That’s why the communication with APM does not work. You have default fuse bits, which cause ATMega to divide internal clock (8MHz) by eight, causing it to run at 1MHz. Subsequently the baud rate changes to 38400/8=4800. Check CKSel bits on low fuse.
      Here’s a handy calculator: http://www.engbedded.com/fusecalc

  22. Jaime
    04/01/2013 at 16:43

    Problem with baud rate is solved.
    Thank you for the tips antibore. That calculator is very good.

    The only problem now is the communication with optima in which the menus are still hidden.

    I will try with another optima receiver and make sure that the firmware of aurora, optima and module are updated.

    Regards,
    Jaime

  23. 05/01/2013 at 20:43

    Patch is now updated for the latest head of ArduPlane.

  24. 05/01/2013 at 21:36

    There was also mistake in the schematic. Check connections of pins 27 and 28.

  25. Jaime
    13/01/2013 at 18:58

    It’s my turn to say: IT WORKS!!! 😀

    Thank Antibore and Francesco for all the support.
    To make it work, I rebuild the circuit from scratch using new components and a new PCB. I don’t know what was wrong with my previous circuit…

    I had to do a change in the software to fix my altitude reading which wasn’t right.
    I was testing the device at 900 meters high. However the reading was about 200 meters.

    After analysing the software, I found the problem.
    The variable that is used to send the altitude from APM to the device is an unsigned int which holds a value up to 32K (16 bits).
    This would be ok, if the value sent wasn’t multiplied by 100. In this case, the maximum altutude supported is about 320 meters.
    What I did was to change the place of the division of the altitude by 100. Originally the division was being done just after receiving the value by the module. I placed that division in the APM code, just before sending to the device. So now, the maximum altitude is about 32K meters.

    What I am going to do next is to send the absolute and the ground distances from the plane to the point of launch.

    I did a test with an atmega328p, instead of the 88, but I got error on the verification of the write process in extreme burner.
    Do I have to do anything special with the 328? Also, can I use the internal clock?

    Thank’s again

    Best regards

  26. Jaime
    13/01/2013 at 19:32

    Just a correction on my last post: an unsigned int can hold up to 65535, so the maximum altitude with the original code is 655 meters above sea.

  27. 13/01/2013 at 23:07

    Thanks for your input. If you made changes to code, please send me the code or preferably patch of changes. If you cloned the git repository, you can create patch with “git format-patch” command.

    Changing the processor to 328 should not require anything other than compiling the code again with the right processor type. Internal clock can be used, just make sure it runs 8MHz, not 1MHz. I’m currently making another device for myself with atmega168, because there’s no space left in 88. I’m also making a circuit board using smt parts and I hope to add support for other radios that Hitec in the future if I can get my hands on Spectrum or other brand.

  1. 10/05/2012 at 19:51

Leave a reply to antibore Cancel reply