Hello and thanks for the reply. I appreciate the feedback as I want to get this little project of mine completed as soon as I can.
I have already uploaded a sketch on the black widow that has two empty functions (loop and setup) and this did not work. I found this tip on some forum. When you say empty sketch do you mean completely empty? The reason I am asking is because a completely empty sketch does not compile.
I retried the process now just to be sure and I am still having the same issue as before.
I have tried the same process with another rainbowduino which was unused and I got an error which said something like programmer out of sync.
The sketch that I tried uploading was some 3_0 version of a rainbowduino firmware.
The second time onward when trying to upload the sketch it gives me the same type of error that astcoolnameleft reported.
Maybe you are right about the wiring. I am expecting some new wires so that I can connect GND and VCC according to the diagram. At the moment I do not have those two connected as I am using an external power supply on the rainbowduino. Do you think that this could be the problem?
I got this when sending the firmware pde file by using the arduino022 ide. The wiring is now as follows:
Therefore I am now no longer trying to power the rainbowduino through the JST connection.
I do first load an empty sketch on the arduino and I do select the duemilanove 328 device on the IDE.
My devices connect to a usb port on a MacBook Pro. I dont know if the IDE on MAC OS could have any issues that is why I am mentioning it. Also sometimes usb ports dont output the voltages/amps as the usb specification mentions. Maybe laptops are worse than desktop pcs?
Do you know any people that have managed to flush a rainbowduino through an arduino where both devices have the ATMEGA328 chip installed on them? I already spend about 150-200 dollars on electronics equipment + other on this project and if possible I would like to avoid spending another £15 on a UartSB (unless if this is the only option).
the wiki page is now a very thorough presentation of the Rainbowduino - the one that was missing! So, thanks an awful lot from me too.
I had the very same problem, due to the fact that my Arduino and my Rainbowduino both have the same IC, namely the Atmega 368. Let me try to explain in some detail - bear with me, it takes quite a few words.
Imagine that you have a dual boot machine: at power on time it waits a few seconds for you to select something, and if you don’t touch the keyboard it then goes on with the default OS.
More or less, this is what happens when you power on an Arduino-derived card. The boot loader waits a few instants for a signal on the DTR serial line (marked as RESET on standard Arduinos). If it doesn’t see anything, it starts the sketch on the board. If it sees DTR go low during the boot phase, it will start the flashing routine instead. The latter code talks serially (using just RX/TX) to the flasher utily on your PC (avrdude in your case) and transfers the compiled sketch right into the board flash memory.
Now, back to our situation: the connection described by Michu is intended for using the Arduino as if it were an USB to serial adapter for the Rainbowduino. The trouble arises from the fact that at boot, when you want to flash the Rainbowduino, both cards will receive the reset signal and start their flashing routines.
All goes well if the two boards have different chips (say the 168 on the Arduino and the 368 on the Rainbowduino), because they use different serial protocols for flashing. The Arduino bootloader receives the wrong commands and times out, while the Rainbowduino bootloader goes on: net result, you end up with the sketch to the correct board. When you have the same chip on both cards, on the other hand, they will both happily answer at the same time to avdrude, thus corrupting the firmware upload process.
To avoid this problem, you only need to use a different serial adapter to connect your Rainbowduino to the PC: instead of the Arduino, use anything that drives RX/TX/DTR . I’ve used http://eshop.acmesystems.it/?id=DPI, but anything else would do.
If you only have one with RX/TX, don’t despair: just press the reset button on the Rainbowduino as soon as your IDE finishes compilation, to simulate the DTR low signal. It might take a couple of attempts to get the timing right, but it’s an easy trick.
To end with, I read that you might simply remove the Atmega chip from your Arduino in order to use it as a dumb USB to serial converter: it sounds like a nice idea, but I have not tried and I don’t know if it is really working or not.
hey antonio, thanks for your detailed message - i didnt know that.
however, I flashed my rainbowduino v2 (using an atmega 328) fw at least 50times without any issues using:
-upload clean sketch to arduino
-connect rx+tx (other cables are always connected)
-upload rainbowduino fw
-upload arduino fw
what happens if you connect the reset line from the arduino with the rainbowduinos, isn’t that like a pass through? (like rx/tx)?
@miso: strange - I also use an mac book, without any issues…
Unfortunately I have not managed to upload any sketches to the rainbowduino through the black widow device. I have powered it up using the JST but also through the 5v pin. What I found strange was that some onboard leds on the rainbowduino were still on when only tx,rx and gnd where connected between the two devices (no power was provided through jst).
@antonio - Thanks for the info, this makes sense. I found some posts in the past, where people said that using two atmega328 devices in such a configuration was not possible but this is the best explanation. As far as removing the atmega it is too risky so I prefer not to try it. I believe in some post that I came across in the past someone mentioned something about putting a resistor between some of the pins on the arduino but I cant remember what the purpose was exactly and where i found that post.
@michu - Since your configuration works, I can only think of two things that could be happening. 1) My black widow which is based on the duemilanove does something differently to your device. 2) Something I am doing is not right or I damaged the equipment.
I would like to believe that I am just doing something wrong. If we don’t manage to resolve this issue during the weekend I will have to place an order for a UARTSB device like antonio suggested. Please let me know if you have any other suggestions that can help me avoid that.
The link you have provided me in a previous post is great for checking the wiring. In other pictures i found, it was not clear where exactly the pins/wires were connecting and as you know both devices have more than one connections named the same and that brought some confusion as whether my wires were connected correctly.
My wiring is exactly the same as the diagrams with the exeption that I have provided a 9v input through the JST or a 5v input through the arduino.
Thanks for your efforts.
I have placed an order for a UARTSB device from airsensor.co.uk/shop.html?pa … oduct_id=4 as they offer next day delivery and I need to make some faster progress. I would have otherwise order the other device from seeedstudio.
Do you know if this device can be used through the arduino ide in the same way as any arduino type device? I am right to assume that you just plug it in the rainbowduino, connect the usb to it and just upload the sketch?
I tried exactly the same thing with my Arduino Duemilanove (368 based) and Rainbowduino v2 (same chip) with no luck (it was the very reason that lead me to study the Arduino bootloader process, in fact). What I can tell is that in theory your setup with identical chips should not work, since they share the same bootloader. One possibility is that one of the two boards uses the old 19200 baud bootloader, while the other has the new running at 57600 - the Arduino IDE is smart enough to notice when programming the board, and you won’t even know it.
You’re welcome; I gathered the info looking a bit further in the Arduino docs, everything was already there - if you only know where to look, as usual
I followed the same path, and used a serial device I already had.
I have an original Arduino 2009 and a Rainbowduino v2 - my results are the same as yours, and from the various posts on the forum you see that quite a lot of people have had the same problem in the past.
The only thing I can think of is reflashing one of the two bootloaders and use a different version (maybe the older one, which was slower). But you would need an AVR programmer of some sort for that, AFAIK.
Thanks for the new information.
As I already purchased a new device, I think for the time being I will not spend time learning more staff about bootloaders but start having some fun with programming some LED effects.
I will start some new posts regarding my project in the near future.
thanks for this answer ant9000, I just added it to the wiki. what do you think happens with an arduino UNO - as this device uses a different bootloader is there a chance the firmware upload will work fine?
As a matter of fact, reading on from the thread linked there, I’ve found this piece of advice:
If it really works on the Uno, I’d venture to say that you could use any Atmega 368 based Arduino as a real USB to serial converted by simply connecting RESET and 5V with a suitable resistor. To let the Rainbowduino enter flash mode, though, you won’t be able to use the RESET signal taken from the Arduino any more. Hence, you have to resort to the trick of pressing the Rainbowduino reset button a few seconds after starting the upload in the IDE.
Apologies to Miso for letting you into buying a converter befor attempting this one ;-(
No need to apologise, contrary thanks to the new info. The UARTSB device is a much straight forward way of doing it anyway. No faffing with resistors and reset buttons. It is a very small device as well. Smaller than my thumb.
I came across the resistor trick in the past but I could not remember where I read it.