Project

General

Profile

Resolved: Programming Jeenode Micro from Uno

Added by Lahorde about 5 years ago

Hi,

My issue is quite simple :
I’m trying to program a Jeenode Micro v3a with an Arduino UNO used as ISP programmer. I get following error when trying to burn bootloader :

avrdude -C/home/remi/Developpement/Embarqué/Arduino/IDE/arduino-1.5.2/hardware/tools/avrdude.conf -q -q -pattiny84 -cstk500v1 -P/dev/ttyACM0 -b9600 -e -Ulock:w:0xFF:m -Uefuse:w:0xFF:m -Uhfuse:w:0xD7:m -Ulfuse:w:0xC2:m
avrdude: stk500_getsync(): not in sync: resp=0x6f

Lot of topics describe easy ATTiny 84 programming using UNO. In my case it does not work, may be due to RFM12B connected threw SPI.

I’ve read “official procedure” as described here http://jeelabs.org/2013/03/21/programming-the-jn%C2%B5-at-last/

But now, I have no flash board.

Now I’m wondering if there is a way to program Jeenode µ with UNO?

Lahorde


Replies (23)

RE: Programming Jeenode Micro from Uno - Added by JohnO about 5 years ago

May I ask on what day you downloaded the https://github.com/jcw/ide-hardware
I ask because this library was updated yesterday.

RE: Programming Jeenode Micro from Uno - Added by JohnO about 5 years ago

Also, what O/S are you running your Arduino IDE on, I note that your port is is called /dev/ttyACM0.

RE: Programming Jeenode Micro from Uno - Added by Lahorde about 5 years ago

Yesterday I downloaded ide hardware. I’m working on a ubuntu workstation with 1.5.2 arduino ide. On arduino uno, I uploaded isp sketch from examples.
Lahorde

RE: Programming Jeenode Micro from Uno - Added by padvinder95 about 5 years ago

The flash board, when used as ISP programmer, is just a nice way of routing the ISP wires. There should therefore be no reason why it does work with flash board and doesn’t work with an UNO board.

Can you walk us through your procedure? (How did you wire things up, what sketch did you load on the UNO, what did you select for board and programmer, etc.)

RE: Programming Jeenode Micro from Uno - Added by jcw about 5 years ago

Here is a summary of several ISP options, including Arduino’s: http://jeelabs.org/2011/05/29/summary-of-isp-options/

There is a lot more info on the weblog, try http://jeelabs.org/tag/isp/ to see everything related to ISP programming.

RE: Programming Jeenode Micro from Uno - Added by JohnO about 5 years ago

Is /dev/ttyACM0 the port you actually used when your programmed the Uno, can you confirm which sketch you used.

Do you know if you downloaded https://github.com/jcw/ide-hardware before or after it was updated?

When all set up to program your JeeNode Micro, using the Arduino IDE click on “Tools” and take a look at the “Port” option. While there check the “Board” option to ensure that “JeeNode Micro” is selected. Now, again in the “Tools” menu click on “Programmer” and tell us what is selected.

RE: Programming Jeenode Micro from Uno - Added by Lahorde about 5 years ago

Here are performed steps :

uno upload procedure :
* arduino uno connected on ACM0
* upload ArduinoISP sketech from Arduino 1.5.2 IDE : upload OK

jeenode µ programming - jeenode µ v3a with RFM12b soldered
* wiring :
10µF cap between reset and ground (I’ve also tried without it)
Uno 3.3V to Jeenode µ +3V
Uno GND to Jeenode µ GND
Uno PIN10 to jeenode µ RESET
Uno PIN11 to jeenode µ MOSI
Uno PIN12 to jeenode µ MISO
Uno PIN13 to jeenode µ SCK
* on IDE :
open a new sketch
select jeenode µ board
select “arduino as ISP programmer”
select ACM0 port
click on burn bootloader

Yesterday I cloned ide-hardwere. You talked about a yesterday update, on github I do not see it, last check in was done 3 days ago (https://github.com/jcw/ide-hardware/commit/4ffe696c4f1dd0b1eb71d3ab69c3abcc9af3aa1d)

Rémi

RE: Programming Jeenode Micro from Uno - Added by padvinder95 about 5 years ago

I think you need to swap MOSI and MISO?

RE: Programming Jeenode Micro from Uno - Added by Lahorde about 5 years ago

I’ve modified given MOSI MISO wiring indication given in my previous post.

And a good news :
i’ve solved my problem by changing upload speed!
19200 bps bootloader burn and sketch upload works. I've checked it by getting Serial logs from jeenode µ.
9600 bps bootloader burn and sketch KO

Have you an explanation for this issue???

Lahorde

RE: Programming Jeenode Micro from Uno - Added by JohnO about 5 years ago

So we needed a MOSI/MISO switch and a change of speed.

Is documentation wrong regarding MOSI/MISO or was it a slip?

RE: Programming Jeenode Micro from Uno - Added by jcw about 5 years ago

MOSI/MISO is very confusing for the ATtiny. Would welcome suggestion for docs improvement.
Also let me know (whoever volunteers to help), if you don’t have wiki edit access, and I’ll fix it.

IIRC, the way you have to interpret this for ISP is the opposite from when it’s used to talk to the radio.

RE: Programming Jeenode Micro from Uno - Added by Lahorde about 5 years ago

For MISO/MOSI, it was a slip, you can just insert such image : http://commons.wikimedia.org/wiki/File:SPI\_three\_slaves.svg
You could also add some simple explanation about 10µF capacitor http://playground.arduino.cc/Main/DisablingAutoResetOnSerialConnection

your post http://jeelabs.org/2013/03/21/programming-the-jn%C2%B5-at-last/ was very clear

For 9600bps, why does it fails?

Moreover in some cases I’ve following error with fuses during code upload:

avrdude: please define PAGEL and BS2 signals in the configuration file for part ATtiny84
avrdude: please define PAGEL and BS2 signals in the configuration file for part ATtiny84
avrdude: verification error, first mismatch at byte 0x0000
         0x12 != 0x00
avrdude: verification error; content mismatch
avrdude: safemode: lfuse changed! Was c2, and is now 0
Would you like this fuse to be changed back? [y/n] n
avrdude: safemode: hfuse changed! Was d7, and is now 0
Would you like this fuse to be changed back? [y/n] n
avrdude: safemode: efuse changed! Was ff, and is now 0
Would you like this fuse to be changed back? [y/n] n

I’ve changed board .txt to upload sketch @19200bps, but this modification is not taken into account when burning bootloader, where can I set bootloader upload speed?

RE: Programming Jeenode Micro from Uno - Added by Lahorde about 5 years ago

I’ve encountered some other problems when trying to compile a sketch, below are described solutions
Issue 1: in WString.h

class __FlashStringHelper;
#define F(string_literal) (reinterpret_cast(PSTR(string_literal)))

// An inherited class for holding the result of a concatenation.  These
// result objects are assumed to be writable by subsequent concatenations.
class StringSumHelper;

is missing

Issue 2 : round defintion in math.h - workaround consist in adding

#undef round

in wiring_private.h

can you add modifications in your project?

RE: Programming Jeenode Micro from Uno - Added by JohnO about 5 years ago

There are a number of issues in this thread that need capturing for consideration. Are you willing to raise then on the issue tracker? http://jeelabs.net/issues/

RE: Programming Jeenode Micro from Uno - Added by JohnO about 5 years ago

Lahorde wrote:
> You could also add some simple explanation about 10µF capacitor http://playground.arduino.cc/Main/DisablingAutoResetOnSerialConnection

I don’t think this applies to the JeeNode Micro programmed via the ISP connector. I believe it can be used with the ATMEGA based units using a boot loader. I don’t recall using it with a JeeNode.

RE: Programming Jeenode Micro from Uno - Added by JohnO about 5 years ago

Lahorde wrote:

> i’ve solved my problem by changing upload speed!
> `19200 bps bootloader burn and sketch upload works. I've checked it by getting Serial logs from jeenode µ.

`9600 bps bootloader burn and sketch KO

I am pleased your problem is reduced, can you list where have you made speed changes to achieve success. If we can capture them on http://jeelabs.net/issues/ or maybe suggest the appropriate fix via http://github.com/jcw/ide-hardware/ your pain won’t have been in vain.

RE: Programming Jeenode Micro from Uno - Added by Lahorde about 5 years ago

JohnO,

> > You could also add some simple explanation about 10µF capacitor http://playground.arduino.cc/Main/DisablingAutoResetOnSerialConnection
>
> I don’t think this applies to the JeeNode Micro programmed via the ISP connector. I believe it can be used with the ATMEGA based units using a boot loader. I don’t recall using it with a JeeNode.

Without capacitor upload is not possible

avrdude: stk500_getparm(): (a) protocol error, expect=0x14, resp=0x14

So DO NOT FORGET 10µF capacitor if you upload code to Jeenode µ from UNO programmed as ISP

I will create new issues for problems described in previous posts in Github.

Lahorde

RE: Programming Jeenode Micro from Uno - Added by JohnO about 5 years ago

Interesting characteristic, I think we need to get to the bottom of it. While I no longer use the Arduino ISP approach to programming I have successfully programmed each of the three generations of JeeNode Micro without use of a capacitor. The only problem I experience happens only when programming a node for the second and subsequent times. The first time I program a JeeNode micro(particularly V1) it works fine but the second time is difficult unless I add a few milliseconds delay at the start of the Setup procedure in the sketch. I have always attributed this requirement for a slight delay in Setup to some interaction between the RFM12B start-up process and the first phase of the ISP programming sequence.

It may well be that a capacitor is require somewhere.

Could you perhaps give my technique a spin to test if it changes anything?

void setup() {
  delay(5000);  // Startup delay

Another test might be to erase the JeeNode Micro using avrdude and a capacitor. Then try to program the chip without a capacitor.

RE: Programming Jeenode Micro from Uno - Added by JohnO about 5 years ago

Musing on this I may be misunderstand your position. is the capacitor to prevent the Uno resetting?

RE: Programming Jeenode Micro from Uno - Added by Lahorde about 5 years ago

Yes, adding capacitor prevent resetting done on DTR line. I will check upload with delay()

RE: Programming Jeenode Micro from Uno - Added by JohnO about 5 years ago

Lahorde wrote:

> uno upload procedure :
> * arduino uno connected on ACM0
> * upload ArduinoISP sketech from Arduino 1.5.2 IDE : upload OK

Can you also try using https://github.com/jcw/jeelib/blob/master/examples/Ports/isp\_flash/isp\_flash.ino as the sketch installed on your Uno.

RE: Programming Jeenode Micro from Uno - Added by BobCochran13 about 5 years ago

Hi!

@Lahorde in reviewing this thread, I wonder if you are positive that your avrdude command string is correct? I keep seeing references to the ‘stk500’ as the programmer part, and that is wrong. I think you need to specify ‘arduino’ as the programmer:

http://www.nongnu.org/avrdude/user-manual/avrdude\_12.html\#Programmer-Definitions

I agree with JohnO that a 10 uF capacitor should not be necessary.

One thing that is not clear to me is your exact circuit. Can you please post a photo of your hardware setup? I think it will be a help.

I will continue studying this thread and will comment more soon. I have a JeeNode Micro that I set up to switch on a desk lamp, through a relay. That project is still in progress.

I may order some ATiny chips from Mouser and play with them in order to help with this.

As to the documentation, I’m the one who promised JohnO and some others that I’ll work on the documentation. I got sidetracked somewhat, but I want to come back to this and continue working on it and keep my word.

Many thanks

Bob Cochran
Greenbelt, Maryland, USA

RE: Programming Jeenode Micro from Uno - Added by Lahorde about 5 years ago

Hi,

> @Lahorde in reviewing this thread, I wonder if you are positive that your avrdude command string is correct? I keep seeing references to the ‘stk500’ as the programmer part, and that is wrong. I think you need to specify ‘arduino’ as the programmer:
>
> http://www.nongnu.org/avrdude/user-manual/avrdude\_12.html\#Programmer-Definitions

With stk500 I can successfully set fuses, but now I’m using -carduino in avrdude options, it also works

> Could you perhaps give my technique a spin to test if it changes anything?
>
> void setup() {
> delay(5000); // Startup delay
I added delay in ISPExample : KO

but with this solution :

> Can you also try using https://github.com/jcw/jeelib/blob/master/examples/Ports/isp\_flash/isp\_flash.ino as the sketch installed on your Uno.

It works!

Here is my set up to successfully set Jeenode micro fuses, upload sketch from UNO used as ISP, getting logs from Jeenode Tx Pin using USB BUB II:

here are command lines, upload and fuse set wasn’t possible 9600 but ok19200 :

avrdude -C/home/remi/Developpement/Embarqué/Arduino/IDE/arduino-1.5.2/hardware/tools/avrdude.conf -q -q -pattiny84 -carduino -P/dev/ttyACM0 -b19200 -e -Ulock:w:0xFF:m -Uefuse:w:0xFF:m -Uhfuse:w:0xD7:m -Ulfuse:w:0xC2:m

avrdude -C/home/remi/Developpement/Embarqué/Arduino/IDE/arduino-1.5.2/hardware/tools/avrdude.conf -q -q -pattiny84 -carduino -P/dev/ttyACM0 -b19200 -Uflash:w:/home/remi/Developpement/Eclipse/juno_workspace/JeenodeMicroExample/Release/JeenodeMicroExample.hex:i

Sometimes I get some error about invalid signature (" avrdude: Yikes! Invalid device signature." ) or code verification (“avrdude: verification error; content mismatch”), I try again upload and it works.

Many thanks to jcw and other contributors. Working with JeeNodes is a pleasure.

Remi

    (1-23/23)