Project

General

Profile

Resolved: Problems with programming Jeenode Micro

Added by cwanzi almost 3 years ago

Hi everyone,

For the past few months I have been using jeenodes for prototypes in my final year university project . I thne bought a jeenode micro so that I could use the electronics in the real size model. However, I have had a lot of difficulty programming the jeenode micro. I have followed all the steps in the programming tutorial on the jeelabs website ( http://jeelabs.org/2013/03/21/programming-the-jn%C2%B5-at-last/#), but I haven't had any success.

Initially I was using the latest version of arduino (1.6.7), but then changed to back to an earlier version (arduino 1.6.0). However this still didn't work, as I am receiving the following error:

avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 1 of 10: not in sync: resp=0x01
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 2 of 10: not in sync: resp=0x01
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 3 of 10: not in sync: resp=0x01
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 4 of 10: not in sync: resp=0x01
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 5 of 10: not in sync: resp=0x01
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 6 of 10: not in sync: resp=0x01
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 7 of 10: not in sync: resp=0x01
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 8 of 10: not in sync: resp=0x01
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 9 of 10: not in sync: resp=0x01
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 10 of 10: not in sync: resp=0x01

I have connected the jeenode to the ISP pins of the flashboard (i.e. MOSI to MOSI, MISO to MISO etc). Additionally, I have switched some of these connections (MOSI on the flashboard to MISO on the jeenode micro etc) but this is also not working. I have asked the technicians at my university and they can't see anything wrong with my set up. I have added a picture of my set up for clarity.

Please can someone help? I really need this to work soon as my final hand in is in a few weeks.

Thanks
Jeenode with the flashboard mounted on top connecting to the jeenode micro through the ISP pins

jeenode_micro_picture.jpg (761 KB) jeenode_micro_picture.jpg Jeenode with the flashboard mounted on top connecting to the jeenode micro through the ISP pins
2478

Replies (28)

RE: Problems with programming Jeenode Micro - Added by JohnO almost 3 years ago

Is this the first time you have tried to burn anything to the node?
Might you have access to a USBASP programmer?

RE: Problems with programming Jeenode Micro - Added by cwanzi almost 3 years ago

Hi

I have been trying unsuccessfully for months, so I've tried many times to burn something to the jeenode micro. I don't have a USBASP programmer personally, but I could try to get one. What would I use it for?

Thanks

RE: Problems with programming Jeenode Micro - Added by JohnO almost 3 years ago

No guarantees but I have a number of programmers and some seem to have more grunt than others. The USBASP is very inexpensive £3-5 and appears to work where others fail. Although the radio isn't powered until you power up the MOSFET in your sketch it seems to apply a drag to the SPI lines used for programming as well as accessing the radio hardware.

It might also be a good idea to shorten all your cable lengths and ideally eliminate the breadboard. I have 20cm female to female dupont cables going directly from the programmer to the JeeNode Micro - no joints. Another trick is to power the JeeNode Micro from the same PSU as your programmer and power it up before attempting to program. This allows the code already loaded on the JeeNode Micro to initialise the radio and go quiet on the SPI lines before the programmer kicks off with a reset etc.

Can you let us know which programmer you have selected in Arduino - Tools/Programmer. If there is concern in this area you could use avrdude directly from the command line, see this tutorial

RE: Problems with programming Jeenode Micro - Added by cwanzi almost 3 years ago

Hi

I've eliminated the breadboard, so the the only thing connecting the jeenode to the jeenode micro are wires. I've also tried using a new jeenode that has never had anything burned to it before, but this had still resulted in the same error. I will try using a USBUART programmer in the next hour or so, and I'll let you know if that makes a difference.

I could try to connect the jeenode micro to a battery cell to power it at first, otherwise I don't know how I would be able to power it (except connecting it as shown).

I have selected arduino as ISP as the programmer in the tools/programmer menu (following the instructions on the jeelabs page).

Thanks

RE: Problems with programming Jeenode Micro - Added by JohnO almost 3 years ago

Good luck.

The new JeeNode will typically come already programmed. Hopefully you will have success with the USBASP as I don't think the dry-cell idea has enough detail yet.

RE: Problems with programming Jeenode Micro - Added by cwanzi almost 3 years ago

I tried with the USBUART, but had no success. I've ordered a USBASP which should arrive tomorrow. Hopefully that will make a difference.

RE: Problems with programming Jeenode Micro - Added by JohnO almost 3 years ago

Do you have a link to the USBUART device that you tried? When Googling for the device I haven't found anything that looks like a programmer for the ATTiny84.

RE: Problems with programming Jeenode Micro - Added by cwanzi almost 3 years ago

This is the USB UART programmer that I used. I think it is intended for use with an ATMEGA328, but I tried it anyway.

http://start.shrimping.it/kit/cp2102.html

RE: Problems with programming Jeenode Micro - Added by JohnO almost 3 years ago

Ah, that is the equivalent of an FTDI serial adapter. It can't do any programming with the your ATTiny as it is at the moment.
It is possible to serial program an ATMega328 using the Arduino IDE only if the ATMega328 has an Arduino bootloader burned into it. A USBASP or similar type programmer would still be required to put the bootloader into a blank ATMega328 chip. Once this has been done the serial connections from your USBUART go to the TXD & RXD pins on the ATMega328.

RE: Problems with programming Jeenode Micro - Added by cwanzi almost 3 years ago

I have tried using the USBASP programmer, I am now getting a different error message:

Arduino: 1.6.0 (Windows 8), Board: "JeeNode Micro"

Third-party platform.txt does not define compiler.path. Please report this to the third-party hardware maintainer.

In file included from C:\Program Files (x86)\Arduino\hardware\jeelabs\avr\cores\tiny\WConstants.h:1:0,
from C:\Program Files (x86)\Arduino\hardware\jeelabs\avr\cores\tiny\WInterrupts.c:36:
/Arduino/hardware/tools/avr/avr/include/math.h:426:15: error: expected identifier or '(' before 'double'
extern double round (double x) __ATTR_CONST;
^
C:\Program Files (x86)\Arduino\hardware\jeelabs\avr\cores\tiny\wiring.h:136:26: error: expected ')' before '>=' token
#define round(x) ((x)>=0?(long)((x)+0.5):(long)((x)-0.5))

                      ^

Error compiling.

This report would have more information with
"Show verbose output during compilation"
enabled in File > Preferences.

I have selected USBASP as the programmer in the tools/programmer menu, and then used file/upload using programmer. I have downloaded and installed drivers for the USBASP programmer by following the instructions I found here https://netmaxtech.com/how-to-make/install-usbasp-driver-windows-8-and-windows

However, I still don't have an option to select USBASP in the tools/port menu. Am I doing this correctly?

RE: Problems with programming Jeenode Micro - Added by JohnO almost 3 years ago

I have the following entry in my \arduino\hardware\arduino\avr\programmers.txt

usbasp.name=USBasp
usbasp.communication=usb
usbasp.protocol=usbasp
usbasp.program.protocol=usbasp
usbasp.program.tool=avrdude
usbasp.program.extra_params=-Pusb


RE: Problems with programming Jeenode Micro - Added by JohnO almost 3 years ago

You will need a restart of Arduino to read in the updated programmers.txt file.

RE: Problems with programming Jeenode Micro - Added by JohnO almost 3 years ago

Hold my last thoughts, I see the same problem as you.

RE: Problems with programming Jeenode Micro - Added by JohnO almost 3 years ago

How did we move from compiling but not uploading to failing to compile.

RE: Problems with programming Jeenode Micro - Added by JohnO almost 3 years ago

However, I still don't have an option to select USBASP in the tools/port menu. Am I doing this correctly?

The USBASP doesn't actually use a COM port, the USBASP is found if it is connected to a USB port.

RE: Problems with programming Jeenode Micro - Added by JohnO almost 3 years ago

Changing:

extern double round (double x) __ATTR_CONST;

to

extern long roundf (double __x) __ATTR_CONST__;

in the file /Arduino/hardware/tools/avr/avr/include/math.h:426

works for me.

RE: Problems with programming Jeenode Micro - Added by cwanzi almost 3 years ago

Hi,

I have changed the code in the math folder, by replacing "extern double round (double x) ATTR_CONST;" with "extern long roundf (double _x) __ATTRCONST;"

This included deleting the underscores after "ATTRCONST". Is this what you did? I am slightly confused that some of your last post was in bold, was I only meant to replace the ATTR_CONST with "extern long roundf (double _x) __ATTRCONST"?

I am I am still getting this error:

(x86)\Arduino\hardware\jeelabs\avr\cores\tiny/WProgram.h:6:0,
from C:\Program Files (x86)\Arduino\hardware\jeelabs\avr\cores\tiny/Arduino.h:4,
from C:\Program Files (x86)\Arduino\libraries\jeelib-master/Ports.h:10,
from C:\Program Files (x86)\Arduino\libraries\jeelib-master/JeeLib.h:17,
from RF12demo.ino:11:
/Arduino/hardware/tools/avr/avr/include/math.h:425:36: error: expected initializer before '__ATTR_CONST'
*/extern long roundf (double __x) __ATTR_CONST;
^
Error compiling.

I chose

RE: Problems with programming Jeenode Micro - Added by JohnO almost 3 years ago

I think my post was corrupted - I just changed double to long.

RE: Problems with programming Jeenode Micro - Added by JohnO almost 3 years ago

... and round to roundf

RE: Problems with programming Jeenode Micro - Added by cwanzi almost 3 years ago

I've got it working now, messed around a little bit with the code. Thank you so much!

One last question - how do I set up the RF12 settings? Normally I'd do it through the RF12 demo, and use the serial monitor to set it up, but I can't access the serial monitor now as it is connected through the USBASP.

Thanks again!

RE: Problems with programming Jeenode Micro - Added by JohnO almost 3 years ago

The USBASP is connected to the ISP connector. With a JeeNode Micro the serial capability is accessed a little awkwardly:

// Serial support (output only) for Tiny supported by TinyDebugSerial
// http://www.ernstc.dk/arduino/tinycom.html
// 9600, 38400, or 115200
// hardware\jeelabs\avr\cores\tiny\TinyDebugSerial.h Modified to
// move TinyDebugSerial from PB0 to PA3 to match the Jeenode Micro V3 PCB layout
// Connect Tiny84 PA3 (D7) to USB-BUB RXD for serial output from sketch.
// Jeenode AIO2
//
// With thanks for the inspiration by 2006 David A. Mellis and his AFSoftSerial
// code. All right reserved.
// Connect Tiny84 PA2 (D8) to USB-BUB TXD for serial input to sketch.
// Jeenode DIO2
// 9600 or 38400 at present.
// http://jeelabs.net/boards/7/topics/3229?r=3268#message-3268

RE: Problems with programming Jeenode Micro - Added by JohnO almost 3 years ago

By default the serial speed of the Tiny running rf12Demo is 38400 I think. You should be able to use your USBUART to connect to the Tiny84 or the FTDI board you use to connect to the ATMega328.

RE: Problems with programming Jeenode Micro - Added by cwanzi almost 3 years ago

Hi, I've managed to connect the JNu to the FTDI board, and I can get it to receive the serial code from a modified blink sketch.

When I upload the RF12 Demo sketch nothing shows up on the serial monitor, on any baud rate. I've tried changing the #define serial_baud terms at the start of the code, but haven't had any success. Do I need to change something else in the RF12 demo sketch?

Thanks

RE: Problems with programming Jeenode Micro - Added by JohnO almost 3 years ago

RF12Demo doesn't need any changes to work on the Tiny, the baud rate is 38400. The RF12Demo sketch is cut back to fit into the limited flash of the Tiny84, it doesn't have a help display but will be able to configure itself fine. Have you connected up as I suggested, can you post a photograph? While connected at 38400 try entering "212g" and post what you see.

RE: Problems with programming Jeenode Micro - Added by cwanzi almost 3 years ago

Hi

I've attached a picture of how I've set it up. I have a wire running from RX on the FTDI BUB to the JNu's PA3 pin, a wire running from TX on the FTDI to the PA2 pin on the JNu, and a wire connecting the ground pins together.

When I open the serial monitor, nothing appears, unless I press the reset button on the JNu. Then the writing seen here comes up. Nothing happens when I type "212g" into the serial monitor.


(1-25/28)