MotionMote programming problem: DTR doesn't reset [solved]

Started by sdo255, October 01, 2017, 06:50:00 PM

sdo255

We've put together my MotionMote kit, but I'm not managing to program it through the on-board mini USB.

I'm able to program the Moteino directly through its FTDI header.

I'm able to connect to the FTDI on the MotionMote main board, but it's
not resetting the Moteino when I open the serial port and DTR goes
down.
Power, TX and RX do work through it. I can even upload a sketch if I
manually briefly short the Moteino's reset pin to ground at just the
right moment.
Removing the moteino and probing with a multimeter, it does seem like
the DTR line from the FTDI chip goes down as it should.

What could be the problem? How can I further debug this?

I don't entirely understand the reset process, I gather reset normally
has a pull-up and somehow DTR is wired to it through a cap... and the
DTR and cap are replicated on the MotionMote board?
I read that "a delay cap was added to DTR" in Moteino r6 though, I
don't quite get how that works; does that change anything for the
MotionMote board?

Thanks

Felix

It should not change anything, the MotionMote is basically containing the FTDI for convenience.
So you probed the RST Moteino header on the MotionMote PCB and it pulls down?
That should reset the Moteino.

Does the Moteino ever pulse the LED repeatedly when you plugin the MotionMote?
To really tell whats going on you'd need a scope, happen to have one?

sdo255

No the RST isn't pulled down.
It's the DTR that I probed, at the DTR/RTS jumper, and that does go
from high to low when opening the serial port on the computer.

Continuity seems OK
-between the RST pin and one side of the C3 cap,
-between the other side of C3 and the DTR/RST jumper,
-and between the DTR/RTS jumper and one pin of the FTDI chip.

I tried to check the capacitance of C3 but got nothing, not sure if
I'm supposed to be able to measure it in circuit...

So at this point, C3 seems suspicious.

So we tried and soldered a through-hole 0.1uF cap between the DTR/RTS
jumper pad and the RST pin, and voilĂ , now it resets properly and I'm
able to program it through the on-board USB port.

So AFAICT it looks like my MotionMote main board had a bad C3 cap...

I don't have a scope here, but I could use one at the office at some
point this week if there's something else that you recommend checking.

Thanks

Felix

#3
Thanks for bringing this to my attention.

Actually I think that C3 should not even be there.
I will have to replace all existing ones with shorts and manufacture the rest with 0 resistors instead of the cap.
That cap will cause the RST to not be pulled low enough, and I think that's the cause of what you're seeing. On the R4 that was not a problem but with the new RST cap on R6 this will be the effect that you see.

To recap: the C3 cap needs to be shorted out, you can simply solder a piece of wire across it:




Read this later post for a better fix.

sdo255

Thanks much for looking into it.

I am somewhat confused though.

If I understand correctly, shorting C3 means the DTR signal from the
FTDI chip will be brought directly to the Moteino RST pin?

Won't that keep the RST pin low as long as the port is open? Won't
that keep it in reset indefinitely?

As a quick try I shorted the extra through-hole cap that we had added
before, unless I'm mistaken it should be equivalent... and the moteino
did not respond in that case.

I'm probably missing something as to how this is supposed to work. I
guess the Moteino RST pin doesn't go directly to the ATMEGA RST pin so
maybe keeping it down is OK? Only that didn't seem to work for me.

Felix

The DTR goes low for a few pulses when the serial port is open, not permanently. Those few pulses are supposed to short the target (moteino).

perky

Interesting. What happens to not allow the cap to pull it low? Is it that the cap needs to charge (or rather discharge) at the beginning? Is the DTR high time not sufficient?

Mark.

Felix

Quote from: perky on October 11, 2017, 12:29:57 PM
Interesting. What happens to not allow the cap to pull it low? Is it that the cap needs to charge (or rather discharge) at the beginning? Is the DTR high time not sufficient?
The pulse is too short, the cap too large value perhaps even at 0.1uF.

Felix

An update: I went through the exercise of fixing and testing all existing assembled boards. Turns out replacing the 0.1uF C3 with a short may have a problem with some revisions, causing repeated resets, which I cannot fully explain without digging more into how the FTDI chip asserts DTR. Anyway the one fix which works for all Moteinos is to replace C3 with a 1uF capacitor, this has roughly the same effect as the circuit on the Moteino R6, and resets the board as expected.
The same thing was done for SonarMotes which had the same 0.1uF.

For anyone having this issue, soldering a 1uF radial capacitor in parallel with the existing 0.1uF capacitor should be equivalent (0.1 + 1 = 1.1uf which is ~1uF).