Main Menu

Dead MotionMote?

Started by kaffetero, April 20, 2016, 04:56:34 PM

kaffetero

Hi all,

Just starting out with Moteino and am very impressed.

First device is a MoteinoUSB and works fine, have flashed blinky (had to change sketch to operate on PIN 9 instead of PIN 13) and other sketches and have done some simple sketch revisions, including loading the MoteinoMote.ino sketch and all appear to work fine.

Now I'm working on a MotionMote and hit a wall.

- Followed the guide and removed the diode and bridged the contacts on the PIR shield. Didn't mess with the PIR voltage regulator.
- Rest of assembly went fine, no problems.
- Plugged in the assembled MotionMote to the same USB cable and setup I had used with the MoteinoUSB to start programming and got the battery charging LED to light up.
- Tried to load blinky, and got an error:

   avrdude: ser_open(): can't open device "\\.\COM12": The system cannot find the file specified.

- Same cable, same PC, same setup as MoteinoUSB.
- Switch back to MoteinoUSB, load blinky again. No problem.
- Start trouble-shooting MoteinoMote:
-- Checked battery voltage at PCB connector => 4.11v
-- Checked voltage across open switch => 2.65v
-- Checked voltage across GND and VCC on 3 pin PIR connector => 3.5v
- Start trouble-shooting Moteino:
-- Checked voltage across GND and VIN on Moteino (switch closed) => 3.5v
-- Checked voltage across GND and 3v3 pin on Moteino => 0.0v !!!!!!!!!!!!!!!!!!!!
-- Checked voltage across GND and PWR on Moteino FTDI pin-out => 3.5v
-- Checked voltage across GND and 3v3 on Moteino AR pin-out (next to antenna) => 0.0v !!!!!!!!!!!!

Next, I replaced the questionable Moteino on the MotionMote with the MoteinoUSB and got the blinking LED (blinky was still loaded on the MoteinoUSB).

-- Checked voltage across GND and VIN on MoteinoUSB (mounted on MotionMote shield) => 3.5v
-- Checked voltage across GND and 3v3 pin on MoteinoUSB (mounted on MotionMote shield) => 3.25v
-- Checked voltage across GND and 3v3 on Moteino AR pin-out (next to antenna) => 3.25v

Then tried to load a modified blinky sketch onto the MoteinoUSB (through the USB connection on the MoteinoMote shield) and got the same error as before, "can't open device", etc.

Moved the USB cable to the USB port on the MoteinoUSB (still on the MoteinoMote shield) and was able to successfully load and run a revised blinky sketch.

So, at this point I'm thinking I have a bad FTDI or related connection on the MoteinoMote shield and *also* something fishy with the 3.3v on the Moteino. :(

Any thoughts, other tests I could try, etc?

In the meantime, I'll order an FTDI module and another simple Moteino to be able to test both the old and new Moteino w/o the MoteinoMote shield.

Thank you!

Felix

Hmmmm... I have seen where that regulator has some wild swing dropout voltage on the range of 1.5v or even more. So if you feed 3.5V into the Moteino regulator it's already below the Moteino regulator dropout which is a bad thing. You want to keep voltage going into the Moteino above around 3.6v. A LiPo has a max of 4.2v fully loaded, so it might quickly dip below that limit if your PIR has one of those regulators with a high dropout. My first suggestion is to remove the PIR regulator like in the guide.

You could run without the PIR just for debugging. Put a 10K resistor between GND and D3 (to keep it stable). Then you could touch D3 to 3.3V when you want to simulate motion. The Mote should then work as if there was motion etc.

Let me know if this helps.

kaffetero

#2
Hi Felix,

Thanks for getting back to me so quickly.

So I removed the voltage regulator and bridged the contacts on the PIR module per the guide and ran thru all the tests previously mentioned with the same results.

I've got to say, upon reflection, I wasn't really surprised this didnt help as before when I plugged the MoteinoUSB into the MotionMote shield, I could see that it was operating correctly (blinky was flashing the LED in the sequence i had uploaded previously) even though I wasn't able to communicate with it over the serial interface on the shield. So it seems at least the basic power to the Moteino is actually OK.

I also setup the Arduino IDE on another machine (laptop this time) to make sure I wasn't having any driver/COM port conflicts with old stuff on my desktop. Got the same results, the MoteinoUSB (R5-USB) works fine, the Moteino (R4) that came with the MoteinoMote kit won't communicate on the serial port.

I did notice that I get a different serial port active on both the PC and laptop depending on which device I plug in, e.g. on the laptop, connecting the MoteinoMote shield via USB cable activates COM4 (which doesn't work) and the same connection to the MoteinoUSB activates COM3.

Also, if I don't have the right COM port selected in the IDE, I get an error of:

    avrdude: ser_open(): can't open device "\\.\COM3": The system cannot find the file specified.

whereas on the MoteinoMote, with the appropriate COM port selected I get:

    avrdude: stk500_recv(): programmer is not responding
    avrdude: stk500_getsync() attempt 1 0f 10: no in sync: resp=0x07

errors (10 of them).

Another test I just ran was to try to load the blinky sketch onto the MoteinoMote *without* the Moteino installed. Got exactly the same errors and messages.

So, it seems that

- Power is OK
- PC recognizes the COM port on the MoteinoMote shield
- The serial connection between the shield and the Moteino is bad or there is something wrong with serial comm on the Moteino itself.

Does that make sense? Either way, what do I do next?

Btw, I did order the FTDI module and another Moteino, so should be able to try various permutations based on those shortly.

I do have a Raspberry PI 3.

Is there any way I can wire a direct connection (w/o the FTDI) between the R4 and Pi to at least verify serial comms on the Moteino are good?

Anything else I should try? :-\

Thank you!

Brett

perky

#3
The MCP1703 will act like a small resistor for input voltages above the LDO's working voltage of 2.7V (the pass transistor will be hard on). You can calculate that from the spec, which is max 975mV at 250mA, i.e. 3.9 ohms. You'll get a small voltage drop depending on pulsed current and the amount of capacitance on it's output. It'll start to regulate when it's input voltage is above 3.3V by the dropout voltage for the load current, and this is linearly dependent on load current (see figure 2-13). So I don't think an input voltage which is below the dropout voltage plus the regulation voltage is much of a problem.
Mark.
Edit: That assumes you have a clean supply of course, if your supply is noisy and you require regulation then you need to have some headroom above 3.3V.



kaffetero

So I've made some progress, but still having some issues.

I was able to communicate with and upload a blink sketch to the R4  that has been giving me trouble using avrdude on a RPI and the GPIO pins per the posting at

   https://learn.adafruit.com/program-an-avr-or-arduino-using-raspberry-pi-gpio-pins/configuration

That being said, I still can't communicate with this R4 after mounting it on the MotionMote shield or using an FTDI adapter. No serial port is recognized (Device Manager on Windows doesn't reset or show a new COM port as it does with the other two Moteinos I've tried).

Furthermore, the fuses on this R4 appear to be erratic.

Just running the verification command below generates different results pretty much every time I run it, with some runs generating no errors, but often generating the results below.

In contrast, the other R4 in the same rig (w/ the GPIO pin connection to the RPI) consistently runs the verification command w/ no problems or errors.

At this stage, it looks like this R4 is defective w/ regard to either the fuses and/or serial comms, although it does run the Blink sketch.

pi@raspberrypi:~ $ sudo avrdude -p atmega328p -C /etc/avrdude_gpio.conf -c pi_1 -v

avrdude: Version 6.1, compiled on Jul  7 2015 at 10:29:47
         Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
         Copyright (c) 2007-2014 Joerg Wunsch

         System wide configuration file is "/etc/avrdude_gpio.conf"
         User configuration file is "/root/.avrduderc"
         User configuration file does not exist or is not a regular file, skipping

         Using Port                    : unknown
         Using Programmer              : pi_1
         AVR Part                      : ATmega328P
         Chip Erase delay              : 9000 us
         PAGEL                         : PD7
         BS2                           : PC2
         RESET disposition             : dedicated
         RETRY pulse                   : SCK
         serial program mode           : yes
         parallel program mode         : yes
         Timeout                       : 200
         StabDelay                     : 100
         CmdexeDelay                   : 25
         SyncLoops                     : 32
         ByteDelay                     : 0
         PollIndex                     : 3
         PollValue                     : 0x53
         Memory Detail                 :

                                  Block Poll               Page                       Polled
           Memory Type Mode Delay Size  Indx Paged  Size   Size #Pages MinW  MaxW   ReadBack
           ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
           eeprom        65    20     4    0 no       1024    4      0  3600  3600 0xff 0xff
           flash         65     6   128    0 yes     32768  128    256  4500  4500 0xff 0xff
           lfuse          0     0     0    0 no          1    0      0  4500  4500 0x00 0x00
           hfuse          0     0     0    0 no          1    0      0  4500  4500 0x00 0x00
           efuse          0     0     0    0 no          1    0      0  4500  4500 0x00 0x00
           lock           0     0     0    0 no          1    0      0  4500  4500 0x00 0x00
           calibration    0     0     0    0 no          1    0      0     0     0 0x00 0x00
           signature      0     0     0    0 no          3    0      0     0     0 0x00 0x00

         Programmer Type : linuxgpio
         Description     : Use the Linux sysfs interface to bitbang GPIO lines
         Pin assignment  : /sys/class/gpio/gpio{n}
           RESET   =  12
           SCK     =  24
           MOSI    =  23
           MISO    =  18

avrdude: AVR device initialized and ready to accept instructions

Reading | ################################################## | 100% 0.00s

avrdude: Device signature = 0x1e950f
avrdude: safemode: lfuse reads as DE
avrdude: safemode: hfuse reads as DC
avrdude: safemode: efuse reads as 5

avrdude: safemode: lfuse reads as DE
avrdude: safemode: Verify error - unable to read hfuse properly. Programmer may not be reliable.
avrdude: safemode: lfuse reads as 0
avrdude: safemode: hfuse reads as 0
avrdude: safemode: efuse reads as 0
avrdude: safemode: lfuse changed! Was de, and is now 0
Would you like this fuse to be changed back? [y/n] n
avrdude: safemode: hfuse changed! Was dc, and is now 0
Would you like this fuse to be changed back? [y/n] n
avrdude: safemode: efuse changed! Was 5, and is now 0
Would you like this fuse to be changed back? [y/n] n
avrdude: safemode: Fuses OK (E:05, H:DC, L:DE)

avrdude done.  Thank you.