Hello,
I just got my JeeNodes (one USB and one not) and wondered how to program the JN !
Through the RF12 would be nice, but I'm not sure it's possible.
Maybe use the JU as a USB-FTDI cable, by repeating what come from serial to SPI pins, connected to the FTDI plug of the JN ?
Or is it possible to sit between the FTDI and the ATM chips ?
Of course I can buya USB-FTDI cable, but I can do without, I'd be glad...
Regards
Programming JN via JU
(11 posts) (2 voices)-
Posted 28/02/2010 17:59:50
-
I've been wanting to do ISP programming via a JU, but never got around to it. Would be an interesting project. You don't have to use the relatively expensive cable solution, there's also the USB-BUB (from Modern Device, but it also "happens" to be available from the Jee Labs shop) - there are several other similar interface boards.
Posted 28/02/2010 22:09:10 -
Right, couldn't find USB-BUB on your shop...
How much would you sell it ?
I think I'll try trough JU, at least through serial interface...
Do you think it's possible through RF12 ?Posted 01/03/2010 08:30:55 -
http://shop.jeelabs.com/products/usb-bub
Sending entire sketches through RF12 will take a very long time, especially when sticking to the 1% bandwidth limit, as required for the 868 MHz band in Europe.
Posted 01/03/2010 15:10:05 -
My bad, it was on the last page of the catalog... :-$
Problem is, I think I have nothing else to order for now !
And I'd still like not to have too much different stuff.I can see the problem with RF12 and bandwidth.
Anyway radio updating seems a bit, you know... tricky...Do you think I can make a sketch for JU, that will make it forward everything from USB to serial port (connected to JN) ?
Do you have I idea of how I could tell Arduino IDE to speak to the JN, not the JU ?You said you tried, can I see what you did ? At least not to try the same things ! ;-)
Posted 01/03/2010 15:45:55 -
The forwarding is not the problem. The problem is that the PC pulses the RTS/DTR line, which resets the JU. The boot loader from the JU then takes over. So without further hardware changes, the Arduino IDE will re-flash the JU, regardless what else you attach to it.
Posted 01/03/2010 19:28:03 -
Do you think one can configure avr-dude (which seems to be used to talk to the bootloader) not to do that RTS/DTR thing ?
And maybe fake this signal from the JU...I tried to check to doc about Arduino's process of programming, but I did not understood everything. I also checked the avr-dude.conf shipped with my arduino distro, but it's huge and I'm not sure of how it works !
I've seen that they program an Arduino mini (without USB) through a bigger one but they remove the ATM chip, which we can't do on the JU...
Looking hard at the schematics of the JU, I was wondering :
all the wires out of the FTDI23RL seems to go to headers (PWR/SER/I2C for TXD and RXD, SPI/ISP for DTR) so it seems easier than I thought to plug in a JN to be programmed.
The problem as you said it not to program the JU, so is it not possible to make ATMega freeze somehow ? Maybe using a bug that can only be overridden by powering off the chip...
Or maybe if the chips on JU and JN are not exactly the same, tell explicitly avr-dude to speak to the one on JN ?Posted 01/03/2010 20:33:15 -
After a bit more searching, I found several docs about using a regular Arduino as an AVR ISP.
The most up-to-date seems to be this one :
http://arduino.cc/en/Tutorial/ArduinoISPDo you think I could do that with JeeNodes ?
If I understand well, I won't even need any bootloader at all on the JeeNodes, if I always use my JeeNode USB to program them...Posted 01/03/2010 22:40:00 -
Correct - if you program via ISP, then you don't need a boot loader.
Hey, go for it - you don't need my permission to do so, y' know ;)
Posted 02/03/2010 11:17:23 -
Cool to the save the space of the bootloader this easily !
I was not asking for permission, merely if I don't miss anything big, like pins not being exposed the same way on JU, or whatever Jee specific stuff ! ;)
Tonight I will solder my JeeNode and try this out. :D
I will probably do a quick wiki article for reference about this method with JeeStuff.Posted 02/03/2010 11:48:15 -
Well, it's been a long time... But now it works !
So the method is :
1. link the JeeNodeUSB to the simple JeeNode as in this post
2. upload the ispflash.pde sketch (found here) to the JU
3. use avr-dude to upload your preferred sketch to the JeeNode
First step remainder of wiring :
JN spi/isp -> JU 1 P1 D 2 P1 A 3 P4 D 4 P4 G 5 P4 A 6 P1 +For the last two steps, I use this script :
#!/bin/sh
avrdude -p atmega328p -c arduino -D -U flash:w:ispflash.cpp.hex \ -P /dev/ttyUSB0 -b 57600 avrdude -p atmega328p -c avrisp -D -e -u -U lock:w:0x3f:m \ -U efuse:w:0x05:m \ -U hfuse:w:0xDA:m \ -U lfuse:w:0xFF:m \ -U flash:w:blink.cpp.hex \ -P /dev/ttyUSB0 -b 19200the .hex files come from the compilation of the corresponding .pde by the arduino IDE.
Posted 13/07/2010 21:02:21
