UART2 and AC3

I've seen serial prints are discouraged in AC3, so I am wondering if there is any good way at all to talk to a simple RX/TX device over the unused UART2 on the APM2.5 without using MAVLink.

It's a small processor listening for serial transmission using PySerial. Any suggestions? I just need to send a signal from UART2 to this small chip once or twice a second!

Basically, how do I do this (http://www.diydrones.com/forum/topics/auxilary-tm-output-using-uart2-serial2) in AC3?

Thanks!

You need to be a member of diydrones to add comments!

Join diydrones

Email me when people reply –

Replies

  • Developer

    Paul,

         We have thise lines in ArduCopter's system.pde which looks like they might initialise the gcs3 so it can be used.  I'm not completely use that hal.uartC is connected to the correct serial port that you want on the APM2 but it's worth a try.  I suspect you'd need to do a search through the code to ensure that tons of other places in the code don't try and send stuff out on that uart once it's initialised.

    #if CONFIG_HAL_BOARD != HAL_BOARD_APM2
        // we have a 2nd serial port for telemetry on all boards except
        // APM2. We actually do have one on APM2 but it isn't necessary as
        // a MUX is used
        hal.uartC->begin(map_baudrate(g.serial3_baud, SERIAL3_BAUD), 128, 128);
        gcs3.init(hal.uartC);
    #endif

         after it's initialised you should be able to do things like this:

                      hal.uartC.console->printf_P(PSTR("hello"));

This reply was deleted.