So, I want to program my diavolino, but my ttl serial adapter is taking ages to come in. It occurred to me today that I also have a freetronics leostick, and that the leostick has a second uart; the first is a virtual one run by the atmega. So, I thought I might use a simple sketch to get some data onto the diavolino. I wired pins 0 and 1 to their opposite pins in the ftdi connector, hooked the leostick's power to vin on the diavolino, wired the grounds together, and picked another random pin to hook into reset on the diavolino. At that point, I wrote a simple sketch that opens both serial ports at a fixed rate, checks to see if this is the first data it's seen from the host side, and if so, pulls reset down briefly. Afterward it will read available data from one serial device and write to the other, and continue to do so until it's reset again.
Anyway, I wrote this to the leostick, switched board types in the arduino environment, but kept the port set properly. Of course it won't upload anything to the diavolino that way. It does reset when it begins to see data, but then the blink sketch just picks right back up and eventually the arduino software complains about being out of sync. So, it occurs to me that I know absolutely nothing about this process. How is it supposed to work? You reset the unit, send it some data really fast (how fast, by the way? There's no perceptible delay between the time you release reset and the time the led begins to blink...). The auto reset is usually handled by a flow control signal? You -- what? -- raise rts or something to reset the board? Any idea what I'm missing that explains why this doesn't work?
Chris
Comments
Chris
Chris
Chris
So, I thought I'd try the ArduinoISP stuff and see if I could get a loader on there. Unfortunately, the Leonardo platform seems to have some problems with it. MISO, MOSI, and SCK have been moved off of the usual pins and isolated in the ISP header. This isn't a deal breaker, since I can run them out from there. I've redefined reset in the sketch to use pin 10 instead of pin SS. This all should work in theory, but there appears to still be some problem with the process, since avrdude keeps seeing different device signatures on the chip. (Further, trying this with a separate, fresh ATMega on a breadboard achieves the same result, so I'm assuming that this is a problem with my ISP programming and not with the chip or the board.)
At home I have a FutureTech TTL adapter, which maybe I could use to bit-bang the loader in through the ISP connection, so Google tells me. Haven't tried actually using it yet, though, and who knows? I'm not having the best of luck with this so far. Any other ideas?
Chris
As for the capacitor, that handles the auto-reset function, doesn't it? So what's the best way to test that this is correctly installed? Is there a way that I can check the function of the auto-reset reliably? Also, (hopefully) this thing is non-polar, right? I don't remember from when I was assembling it.
Chris
If I use the FutureTech board, (even without trying to wire it into the ISP header) it does work exactly as it should. Let me change my question again. Do you think the other FTDI board is hopeless? I'd kind of like to get it working, but I'm not sure where to start. It does apply power just fine. Doesn't seem to reset the boards -- hopefully I can say that with some certainty now since I've replaced blink with my own soft PWM fade sketch, so the difference between the twitch from the power-on and the running sketch is obvious. I also haven't been able to get it to program properly even resetting it manually, nor does swapping rx/tx seem to help. I thought it might have them backwards, but perhaps not.
Chris
As for the other TTL adapter, so far I know that a loopback does work as expected. There's actually a pin on this adapter labeled "reset," which makes it pretty obvious where it's supposed to go, and as I said, the power is at least working sufficiently well to drive the board. I do wonder what (if anything) it's doing with that reset pin, and perhaps I should tack a multimeter onto the end of it and see.
Luckily, I also have a pro-mini clone -- the intent here is to use the Diavolino in development of a project to be built with the pro-mini -- so I can verify that the Diavolino isn't the only thing which will program with one TTL board and not the other.
Chris