|
Post by duddex on Dec 23, 2021 14:19:49 GMT
I think I made a horrible mistake - both of my GRAINS modules don't show up in the Port selection menu of the Arduino IDE anymore. The "Port" menu is disabled I have tested different cables and I tried different USB ports. And I am still able to connect my other Arduino Nano development board. So I think I broke both of my GRAINS modules This is what I did: I wanted to see if the PINs can be used as output PINs and how much voltage I get from the outputs. This is my sketch: #define NUMBEROFPINS 8 int pins[NUMBEROFPINS] = {A0, A1, A2, A3, A4, 8, 9, 11};
void setup() { for (int i=0; i<NUMBEROFPINS; ++i) { pinMode(pins[i], OUTPUT); } }
void loop() { for (int i=0; i<NUMBEROFPINS; ++i) { digitalWrite(pins[i], HIGH); } delay(3000);
for (int i=0; i<NUMBEROFPINS; ++i) { digitalWrite(pins[i], LOW); } delay(3000); } I set all the PINs as "output" PINs in the setup()-routine and then alternate between setting them LOW and HIGH in the loop()-routine. After one of the GRAINS modules (serial port) stopped showing up in the Arduino IDE (and also in the Windows Device Manager) I wanted to double check what happened and uploaded the sketch to the other GRAINS module (which probably was a stupid idea). Do you think it is possible that the code above disabled the serial communication? Do you think there is a way to reset GRAINS? Or another way of connecting to GRAINS to reprogram it?
|
|
|
Post by duddex on Dec 23, 2021 14:37:39 GMT
I noticed that the LED on my GRAINS is flashing constantly. I don't know if this has anything to do with this problem...
Sorry - this is a little dark - I hope you can see what I mean
|
|
|
Post by MikMo on Dec 23, 2021 15:32:08 GMT
Does some of the pots and switches on the Grains connect to the pins you used ?
Hav you tried powercycling the AE?
Mikael
|
|
|
Post by duddex on Dec 23, 2021 16:15:48 GMT
I wanted to connect my multimeter to the output PINs. But I didn't get to this point. So nothing is connected.
And I switched the AE off and on several times
|
|
|
Post by maydonpoliris on Dec 23, 2021 19:54:04 GMT
oh no. Hope this can be sorted for you. above my pay grade unfortunately, wish I could help!
|
|
|
Post by duddex on Dec 23, 2021 20:30:21 GMT
|
|
|
Post by admin on Dec 23, 2021 21:26:39 GMT
|
|
|
Post by MikMo on Dec 24, 2021 12:15:43 GMT
My concern is that if one of the potentiometers is connected as a voltage divider between an anlog pin and ground, and it was at zero when you ran the code you could hav shorted that pinto ground, allowing to much current to flow through the pin.
|
|
|
Post by pt3r on Dec 24, 2021 12:31:51 GMT
To me it looks like a software issue, the blinking light was the same thing I saw with my bricked pro micro, that was cause by a buffer overflow error in my firmware. If you fried the chip would it not completely die?
|
|
|
Post by duddex on Dec 24, 2021 13:18:00 GMT
Thank you all so much for your support. I will try to fix the issue with the links you sent during the next days. Happy Holidays, Everyone
|
|
|
Post by duddex on Dec 25, 2021 10:50:14 GMT
It worked! My two GRAINS modules are back! Thank you all for your support! I used the hint on this page: learn.sparkfun.com/tutorials/pro-micro--fio-v3-hookup-guide#troubleshooting-and-faq and tried to reset the board. The problem was finding the RST Pin on the GRAINS. And honestly: I am not 100% sure what I did - it was try and error. I tried all of the PIN setting to ground until something happened. I think it was one of the PINs on the upper right of the chip. When I set the PINs to ground I heard the "new device found"-Windows-sound on my computer and the COM port showed up in the Arduino IDE.
|
|
|
Post by pt3r on Dec 26, 2021 17:05:44 GMT
Let's add a word of warning to the GRAIS wiki, to make sure people triple-check their firmware for buffer overflows (for example writing data outside the range of an array) before uploading it to their GRAINS, since that is a foolproof way to crash your bootloader :-(.
|
|
|
Post by duddex on Dec 26, 2021 21:17:02 GMT
And of course I would not recommend doing what I did: setting ALL of the pins to ground because I was not sure which pin the RST-pin was. I know I was lucky that I didn't damage my GRAINS by creating a short circuit
|
|
|
Post by admin on Dec 26, 2021 21:37:53 GMT
Let's add a word of warning to the GRAIS wiki, to make sure people triple-check their firmware for buffer overflows (for example writing data outside the range of an array) before uploading it to their GRAINS, since that is a foolproof way to crash your bootloader :-(. Thanks for the suggestion, I've added a warning to the wiki page with a link to this thread.
|
|
|
Post by duddex on Sept 18, 2022 15:46:57 GMT
Oops!…I Did It Again I wanted to try the original Solina code from Jan Ostman ( synthworks.eu/arduino-string-synthesizer/) with the GRAINS module. I already was able to do this, but I had some problems (see other thread). Jan's code is similar to my code which bricked my GRAINS in the first place (see above). I wanted to use the PINs A0 to A4 as output PINs. So I don't think that this is a buffer overflow problem, but a problem when the PINs A0 to A4 are set to OUTPUTvoid setup() { ...
//Keyscanner outputs pinMode(14, OUTPUT); // 14 is A0 pinMode(15, OUTPUT); // 15 is A1 pinMode(16, OUTPUT); // etc pinMode(17, OUTPUT); pinMode(18, OUTPUT);
... } Of course I am not sure if this is really the problem. But please be careful with the INPUT/OUTPUT PINs. Right now the serial port does not show up again and now I am trying to reset my GRAINS (no luck so far)Edit: I was lucky again. It works
|
|
|
Post by pt3r on Sept 18, 2022 16:42:07 GMT
Oops!…I Did It Again I wanted to try the original Solina code from Jan Ostman ( synthworks.eu/arduino-string-synthesizer/) with the GRAINS module. I already was able to do this, but I had some problems (see other thread). Jan's code is similar to my code which bricked my GRAINS in the first place (see above). I wanted to use the PINs A0 to A4 as output PINs. So I don't think that this is a buffer overflow problem, but a problem when the PINs A0 to A4 are set to OUTPUTvoid setup() { ...
//Keyscanner outputs pinMode(14, OUTPUT); // 14 is A0 pinMode(15, OUTPUT); // 15 is A1 pinMode(16, OUTPUT); // etc pinMode(17, OUTPUT); pinMode(18, OUTPUT);
... } Of course I am not sure if this is really the problem. But please be careful with the INPUT/OUTPUT PINs. Right now the serial port does not show up again and now I am trying to reset my GRAINS (no luck so far)Edit: I was lucky again. It works Thanks for the heads up on the possible cause, and good to hear you managed to unbrick your Grains (again).
|
|
|
Post by duddex on Nov 16, 2023 19:09:28 GMT
|
|
|
Post by feijai on Dec 5, 2023 0:32:16 GMT
Well, it looks like I have bricked my GRAINS as well. I stupidly uploaded a very large experimental project (not one of mine) as an Uno rather than as a Nano. The Uno has a smaller bootloader and has more space, and so it thought it had the extra space and probably scribbled on the Nano bootloader. So I'm in trouble.
|
|
|
Post by Kyaa on Dec 5, 2023 0:58:43 GMT
If you y'all grab a cheapo CH340 USB to serial board off eBay, and get the GRAINS pinout from robertlanger , y'all should be able to re-flash your units.
|
|
|
Post by rockysmalls on Dec 5, 2023 18:20:21 GMT
Well, it looks like I have bricked my GRAINS as well. I stupidly uploaded a very large experimental project (not one of mine) as an Uno rather than as a Nano. The Uno has a smaller bootloader and has more space, and so it thought it had the extra space and probably scribbled on the Nano bootloader. So I'm in trouble. oh no! sounds like that might slow your current prolific Grains firmware output down a lot, i’m more than unhappy about that!! hopefully Robert can sort you something out double quick?? btw , was delving into physical modeling & ended up here: cs.gmu.edu/~sean/book/synthesis/is this you by any chance?
|
|
|
Post by feijai on Dec 5, 2023 21:09:03 GMT
It is indeed.
|
|
|
Post by feijai on Dec 7, 2023 18:03:14 GMT
Well 20 euros later and I have my GRAINS working again, I *think*. Had to buy TWO bootloader programmers, plus some headers, thanks Amazon. Anyone need a programmer?
|
|
|
Post by rockysmalls on Dec 7, 2023 19:00:38 GMT
Well 20 euros later and I have my GRAINS working again, I *think*. Had to buy TWO bootloader programmers, plus some headers, thanks Amazon. Anyone need a programmer? that’s funny , they only supply them in pairs??!
|
|
|
Post by pt3r on Dec 8, 2023 7:36:29 GMT
Well 20 euros later and I have my GRAINS working again, I *think*. Had to buy TWO bootloader programmers, plus some headers, thanks Amazon. Anyone need a programmer? You did not have a spare uno lying around which you could double as a programmer?
|
|
|
Post by feijai on Dec 8, 2023 9:15:00 GMT
Well 20 euros later and I have my GRAINS working again, I *think*. Had to buy TWO bootloader programmers, plus some headers, thanks Amazon. Anyone need a programmer? that’s funny , they only supply them in pairs??! Yep. Welcome to Prime in Italy. Well 20 euros later and I have my GRAINS working again, I *think*. Had to buy TWO bootloader programmers, plus some headers, thanks Amazon. Anyone need a programmer? You did not have a spare uno lying around which you could double as a programmer? Nope. I mean, I have probably 50 in DC (for robots).
|
|