MultiWii disables serial RX - how to fix?

This forum is dedicated to software development related to MultiWii.
It is not the right place to submit a setup problem.
Software download
Post Reply
User avatar
Hamburger
Posts: 2578
Joined: Tue Mar 01, 2011 2:14 pm
Location: air
Contact:

MultiWii disables serial RX - how to fix?

Post by Hamburger »

Hi,
I have two copters both with arduino nano, one with FreeIMU sensors, other with wmp+bma020.
Both run a modified version of MultiWii v1.7 with patches for telemetry.
Following is true on both copters:
somehow MultiWii disables the RX from the serial interface, writing still works. Also the nano has an ftdi onbaord and with this read and write both work. It is only the RX on the serial that does not work.
As a consequence I cannot run to the GUI over bluetooth, nor can I use the buttons of my LCD to activate telemetry.

The nano hardware itself works, because if I run a simple sketch that reads and prints to serial then with terminal attached (over external ftdi) that works. It also works over the embedded ftdi of the nano itself.

So the question is - what part of MultiWii could deactivate the RX of the serial while keeping the onboard ftdi intact?
How to fix this?
I do not yet post the MultiWii sketch here, so you do not harm your copter. The symptom is now kinda permanent - it occurs with older /versions of MultiWii as well. My simple test sketch verifies the hardware is not broken.

I am at my wits end here.
Ideas?
Hamburger

foomatic
Posts: 17
Joined: Fri Jan 21, 2011 1:33 pm

Re: MultiWii disables serial RX - how to fix?

Post by foomatic »

Hamburger wrote:The nano hardware itself works, because if I run a simple sketch that reads and prints to serial then with terminal attached (over external ftdi) that works. It also works over the embedded ftdi of the nano itself.


You only tested the serial port using FTDI-adapters but not the BT-adapter that will be used for fligth? Am I understanding this correctly?
Does your test program work using the exact setup that will be used during fligth?

If your test works using the FTDI but doesn't work using BT I suspect the BT might be setup incorrectly.

Code: Select all

Here's a sketch of the wiring on a arduino including a FTDI:
ATMEL RX ---- FTDI TX --\
ATMEL TX ---- FTDI RX ---- USB


Attaching a different serial-device (like an external FTDI or BT) results in this:

Code: Select all

ATMEL RX -+-- FTDI TX ---- USB
          \-- BT TX

ATMEL TX -+-- FTDI RX ---- USB
          \-- BT RX

Note that the FTDI and BT cannot talk to each other. Also one must be silent for the other to be able to talk (because they share a wire which is supposed to be an end-to-end connection).

User avatar
Hamburger
Posts: 2578
Joined: Tue Mar 01, 2011 2:14 pm
Location: air
Contact:

Re: MultiWii disables serial RX - how to fix?

Post by Hamburger »

thank you for your thoughts on my problem.
Actually I tested both variants.
First with BT slave at nano's serial port
a) to access MultiWii from the GUI on PC with BT and also
b) to connect from my LCD TEXTSTAR terminal+BT-master. (the terminal has buttons and can send some single chars)
Second by removing BT slave from serial nano interface and connecting directly with wires
a) use an external ftdi hooked to the serial pins (not the onboard ftdi on the nano) and connect to PC with either GUI or terminal programm
b) with serial cable from my LCD TEXTSTAR terminal

all vairants did not work with MultiWii running on the nano.
But using the nano's onboard ftdi over usb cable did work.

Also, running my simple Serial read/write sketch did work over BT and over cable (and over inbuild ftdi).

All variants I have described above did work when I started using the LCD terminal both over BT and over wire.

So I thought that maybe the RX pin was semi-permanently misconfigured (similar to what Alex does to use simple 3-wire cable)

--
anyway, I have reloaded various sketches in unknown order and now I have the nano-s serial functionality back!
Unfortunately, I now have destroyed the sending functionality of my BT-master module due to high mechanical impact on the module.
The module can receive bytes alreight, just sending does not work.
Will have to get another module BT-master. Hate the configuration nightmare.

Hamburger

Alexinparis
Posts: 1630
Joined: Wed Jan 19, 2011 9:07 pm

Re: MultiWii disables serial RX - how to fix?

Post by Alexinparis »

Hi,

At the beginning the serial port is opened at 115200 baud.
There is only situation where the serial is altered after: when the sparkfun LCD is activated.

Code: Select all

    Serial.end();
    //init LCD
    PINMODE_LCD //TX PIN for LCD = Arduino RX PIN (more convenient to connect a servo plug on arduino pro mini)

I don't see other reasons where the RX could be broken

User avatar
Hamburger
Posts: 2578
Joined: Tue Mar 01, 2011 2:14 pm
Location: air
Contact:

Re: MultiWii disables serial RX - how to fix?

Post by Hamburger »

Alexinparis wrote:At the beginning the serial port is opened at 115200 baud.
There is only situation where the serial is altered after: when the sparkfun LCD is activated.

Code: Select all

    Serial.end();
    //init LCD
    PINMODE_LCD //TX PIN for LCD = Arduino RX PIN (more convenient to connect a servo plug on arduino pro mini)

I don't see other reasons where the RX could be broken


I had to fiddle with the address of the acc from the FreeIMU and tried different values.
Could this have side effect on the nano hardware/firmware maybe?

Alexinparis
Posts: 1630
Joined: Wed Jan 19, 2011 9:07 pm

Re: MultiWii disables serial RX - how to fix?

Post by Alexinparis »

No, I don't think the change of an I2C address could imply this problem.

Post Reply