Main Menu

Dead R3?

Started by englund, August 07, 2013, 04:20:42 PM

englund

Hi, I have been playing around with my R3:s and suddenly one of them is not starting the program after uploading from the arduino IDE. The led on the R3 blinks rapidly in sync with the ftdi adapter blinking just like before but when the IDE says "Done uploading" nothing happens. I've uploaded a blinky sketch that also prints to the serial port but it doesn't blink or print anything. My other 2 R3:s are working just fine and blinking and printing when programmed with the same sketch. I have tried to reset the R3 manually by grounding RST and that makes it blink fast twice and the long once but nothing is printed on the serial port.. any ideas?
Could it be something with the on board flash? Stuck in a faulty update loop?

Oh, I forgot, the "blinky sketch" I'm using is actually the WirelessProgramming_node. And I just tried the Arduino blinky sketch with just the blinking and nothing else and that works fine..

Added some serial printing to the blink sketch and that works fine too. So it seems it only not works when I have all the other code in WirelessProgramming_node in there... but the code works fine on the other two R3:s... hmm

englund

By adding a printout right after serial.begin I see that it stops at radio.initialize(). Any ideas why that might happen?

Felix

So you are saying, the "dead" R3 worked fine (transmitting, receiving) up until a point when it stopped working?
Sounds like the radio has an issue being initialized. I do test all of them before shipping with the Gateway/Node examples to make sure they can receive and send. I have never seen a Moteino or Arduino work then stop working (regardless if we're talking about an SPI transceiver, chip, sensor, etc), unless the Arduino/Moteino is damaged - and that can be done in maaany ways :). However I was never able to destroy a Moteino/Arduino unintentionally.

Can you try a few things ...

1) Add the printout inside the initialize() function in RFM69.cpp to see where it stops
2) Add a 10K pullDOWN on the MISO pin (GND - 10K - MISO)
3) You don't happen to have a logic analyzer?

englund

#3
Yeah, it worked fine, but I maybe only programmed it two times before it started failing.

1. It stops at line 69 in RFM69.cpp:
do writeReg(REG_SYNCVALUE1, 0xaa); while (readReg(REG_SYNCVALUE1) != 0xaa);


2. Adding a pulldown didn't change anything.

3. Not really, I have an arduino if u know any logic analyzer sketch for it and if it's fast enough.. I've written a oscilloscope software for it myself but it only supports one channel and about 500sps (I can probably crank it up to 5000sps but I'm guessing that's not fast enough)

englund

Only D2, D8, D9 and D10 are used by on board stuff on the R3, right?

Felix

Yes, those pins are used by the transceiver, FLASH and LED.
Could you try putting a 10k pullUP this time on the D8, maybe the FLASH is somehow interfering with that initialize loop. Basically that's a check that the transceiver is responsive. If the FLASH SS is for some reason being pulled down, it will start crosstalking the transceiver MISO data. If you had a logic analyzer you would see exactly what is happening. I recommend the saleae logic analyzer (8 channel, $150, very worth every penny).

Since the Moteino worked out of box ... and it worked when I flashed it, it's highly unlikely it just started having electrical issues. Unless some high static discharge damaged some internal circuitry simply by touching it.... but never had this happen to me, and I never have the time to take the precautions others take (grounded wrist wraps, expensive desk conductive mats, etc).

Can you please update all your libraries from my github, including the SPIFlash and RFM69. I made changes lately, some relating to the SS pins.

If nothing works, I would be more than happy to analyze your Moteino and exchange it if it turns out it's bad. But you would need to ship it to me.

englund

D11, D12 and D13 are also used by the transceiver, right? Maybe that should be shown here http://lowpowerlab.com/wp-content/uploads/2013/03/Moteino_PINOUT_final2.png

Pullup on D8 did nothing. I checked out all repos 2 days ago and the only change I see since then is the one you did yesterday to the wireless programming or am I missing something?
I never take anti static precautions either, I have never been able to damage anything with static discharge...
A logic analyzer is a bit out of my budget right now (plus, I can get many Moteinos for $150! ;D)

I tried removing the radio init in setup() and just run the flash.initialize(). I get a "SPI Flash Init FAIL!" but all the debug commands (i, d, 0-1) seem to work fine, I can read an ID (6710) and read back flash data and write to it and then the read back data is changed as expected. Well just a side note.

Very kind of you to analyze it, I will send it today using the FROM address from the envelope they where delivered in (shipping is only $2 from sweden to the US for mail under 20g).

Felix

Yes the SPI pins are used by both the transceiver and FLASH. I didn't make special note because I didn't think it was necessary, but you may have a good point. I guess some people have no idea what SPI is and they might just want to get some code running while trying to connect things on the SPI pins without knowing something else is using those pins. If I make changes to that diagram I will update this as well.

Interesting, when you press "i" in the Node sketch the FLASH should return "EF30" not "6710". Also the message should say "Flash init OK!". I am assuming you got the FLASH chip from me, and the code uses 0xEF30 in the constructor of the SPIFlash class.

So it may mean that the FLASH chip has some kind of issue... if you send me the unit I will look into it.