Apologies if this has been asked before or if its just a stupid question
I'm brand new to anything Arduino related and am trying to learn a bit about how to upload the program once I have my bluetooth adapter in front of me. I'm debating between buying this: http://www.amazon.com/gp/product/B00E5WJSHK?refRID=73W8K5JZZTWXQYK1CGP7&ref_=pd_ybh_a_1 or the cable that has been suggested: http://www.amazon.com/gp/product/B00DJBNDHE/ref=s9_simh_gw_g147_i1_r?pf_rd_m=ATVPDKIKX0DER&pf_rd_s=desktop-1&pf_rd_r=18ND6GKKEZE2PKW3Y53X&pf_rd_t=36701&pf_rd_p=2079475242&pf_rd_i=desktop I figure if I get hooked on arduino projects the Uno would be more versatile, while the cable would allow me to upload programs directly onto the PCB without removing the chip. The Uno would also let me correct things if I screw something up and need to upload a bootloader to a new chip. Anyway, I've read the tutorials and the process seems pretty simple and is well documented for using the Uno, but what board do I select in the dropdown menu if I use the cable to program? And does anyone have a reason why I should pick the Uno over the cable or vice versa? Thanks! |
I'm also a total n00b when it comes to Arduino, but with some prior knowledge of basic programming it's just a matter of refreshing my memory so I can hack the code ;D I myself bought the Sparkfun 3.3v FTDI basic adapter. Could not upload no matter what I did. After some consulting with Karlis and Seth I changed the adapter to 5v and it worked without any problems. So I would recommend the 5v cable. Or Sparkfun's basic FTDI adapter. Just a solder bridge to choose between 3.3v and 5v. In the Arduino IDE you select board Arduino/Genuino Uno and the right com port for your FTDI cable.
Saab 9-5 Aero MY01 AS3 - 270hp/240hp Biopower
Saab 9-5 SE MY00 AS1 - 210hp+ |
Glad I'm not the only one ;) So just so I understand, if I get the cable I can just tell the IDE that it is a Arduino/Genuino Uno and it will still work? And the cable is able to do all the same functions, upload the bootloader and software code as a 'full' Uno? Sorry for being dense, I'm just trying to figure out what the cable does/doesn't do vs. the Uno since there seems to be more tutorials for me to read on how to use the Uno. |
Administrator
|
So the 328 needs to have a boot loader installed on it, if it doesn't have one. When you buy a 328, unless it says otherwise, it won't come with one installed. So the easiest thing to do is buy a 328 with a boot loader pre installed. I'm pretty sure all boot loaders that come pre installed are "Uno" compatible. The 328 doesn't support USB, so you need a USB to TTL converter, which is what the ftdi cable/adapter does.
NC, USA
|
In reply to this post by Viggen
To upload new software to the BlueSaab module the ftdi cable is enough. Here is some reading on how to burn a bootloader. https://www.arduino.cc/en/Hacking/Bootloader?from=Tutorial.Bootloader
Saab 9-5 Aero MY01 AS3 - 270hp/240hp Biopower
Saab 9-5 SE MY00 AS1 - 210hp+ |
Great, thank you both for the help!
I have the 328 that came with the bootloader preloaded so it sounds like I was just making it more complicated than it needs to be. I will order the cable and call it a day then and wait for the PCBs to arrive... |
I'm planning to program the 328 using an Arduino Nano I found in the lab. My 328 right now is empty from Mouser, no bootloader.
You think the following guide will work? http://www.martyncurrey.com/arduino-nano-as-an-isp-programmer/ Thanks! |
Administrator
|
looks really good. good luck!
NC, USA
|
I built the board (v3.2) but I am having a lot of trouble with the software upload described at the beginning of this thread. I struggled for a while to upload the bootloader and finally found this page this page that showed how to put the ATMEGA328 in a breadboard and upload a bootloader to to that chip from an Arduino Uno. I chose the 16MHz bootloader since the BlueSaab module has a 16MHz resonator. I plugged the ATMEGA328 into an Arduino Uno board and was ableto upload and run a sketch, so that proved the bootloader was OK. Also, an LED on the Uno blinks three times quickly when it is reset, which is an indication there is a working bootloader.
Now, I am struggling to communicate with the ATMEGA328 on the BlueSaab module so that I can program the RN52. The instructions say "plug in the FTDI cable" and "upload the codeto BlueSaab module". I plugged in my FTDI adapter and thepower LED on the BlueSaab module lit. I wasn't really sure how to "upload the code to BlueSaab module", but I guessed that since the 328 is essentially the same as an Arduino Uno, I set my Arduino IDE Board to be an Uno. No luck, it gave me an avrdude error about failing to sync and said it failed to upload. I tried many other boards and different settings but nothing worked. I eventually put the 328 back into the Uno, uploaded the RN52 sketch, then popped it in to the BlueSaab board. I figured that since the sketch was already loaded, I should be able to connect with a terminal program (minicom) and see the message about being in RN52 programming mode immediately. Still no luck. I saw the earlier post about using the 5V FTDI instead of the 3V3 so I tried that. Ever since then, the power LED no longer lights. :-( I have a multimeter with a diode check function and that seems to show the power LED is OK, so what else can I check to figure out why it no longer lights up? While doing all of the above, I noticed that the voltage regulator IC3 gets really hot when the board is powered from the 6 pin header. Is that normal?
NC, USA; 1999 9-3 S, AS2; BlueSaab v3.2, software 4.1
|
Administrator
|
Hey,
Yeah, the voltage regulator shouldn't get *too* hot. At least not to the point where one cannot hold a finger on it. Not being "Captain Hardware", I'd start looking at diodes and see if any of those hasn't been put the other way around. Seth might chime in on this once he can.
2001 9-5 SE V6; 2006 9-5 Wagon; iOS; BlueSaab version = "latest and greatest" :)
|
Administrator
|
In reply to this post by NeilR
I agree with Karlis; double check all the diodes (they should conduct in one direction, and not in the other), and they should all be in the correct way. 5v at the FTDI input won't hurt anything; that's what it was built for, and that's why the voltage regulator is there; to drop it to 3.3 (that pcb might actually be 3.6, then diodes drop it some more).
If you can take some up close, clear, pictures, maybe we can take a look and see if anything seems out of whack. So first I would check that the pcb has power where it's supposed to; ~3.3v on the vcc pins with power applied. If you can't upload code then, look at the crystal; the chip can't upload without a good clock signal from the crystal. You did good troubleshooting by taking that chip and uploading bootloader & code via the Uno board so you know the chip isn't broken. It just comes down to power, and possibly the clock (my guess is power).
NC, USA
|
OK, thanks for the tips, I'll check it out. I'll also put the 328 chip back in the Uno to make sure it didn't get fried. I assume power checks can be done without it in place. I'll check the diodes but some diodes being the wrong way around wouldn't explain why the power LED lit always with 3.3V but will not light since I put 5V to it, right?
BTW, thanks for doing all the work to design this, I'm really looking forward to having the extra audio inputs in my 1999 9-3. I added a 200W subwoofer several years ago using the regular amplifer connections.
NC, USA; 1999 9-3 S, AS2; BlueSaab v3.2, software 4.1
|
Administrator
|
We'll help you figure it out :)
Yes, you can do voltage checks without the 328 installed. Just use a multimeter to check the voltages and basically follow it from the source until it stops, and there's your problem.
NC, USA
|
In reply to this post by NeilR
Hi,
When building this BlueSAAB version I struggled a lot like you. I had never been able to use my FTDI cable which was a 3V3 : really unsufficient power in to have a proper 3V3 on board after voltage regulator. A good 5V is really better, at 3V3, the regulator goes really hot ! I got rid of this cable and went to UART programming and used Arduino UNO as ISP to handle the whole programming job. First, I removed the Atmega from BlueSAAB and pulled RN52's GPIO9 down (RN52 going to CMD mode) by putting a wire between PIN 6 of atmega328 socket and board's GND (that's why Atmega is removed) I also soldered a small piece of metal between GPIO7 and closest GND pin on RN52 (this forces it to be constantly @9600 bds and avoids any mis-communication in case of factory reset (SF,1)...) I connected the BlueSAAB and Arduino UNO like this : Arduino UNO BlueSAAB 3.2 5V output -----------------------------> FDTI 3V3 input GND output ---------------------------> FDTI GND ~5 PWM ------------------------------> UART RX ~6 PWM ------------------------------> UART TX ArduinoISP sketch is uploaded into Arduino Uno board. From here, I was able to communicate with RN52 via serial monitor in Arduino IDE software. I sent the whole batch of commands and could check the proper pairing and comms with my bluetooth device. After all this, Atmega328 is put back on BlueSAAB board and the Arduino uno (as ISP) is used to upload SAAB-CDC.ino code. Same connections between boards and using "Atmega328 on a breadboard" as device in Arduino IDE software and "upload with a programmer" option. Either, put the Atmega328 on Uno board and upload the code directly... maybe faster and easier. Having done all this, with Atmega328 back on board, it should work... That's the strongest and reliable way I was able to have 3.2 working flawlessly ;) Good luck !
01' 9.3 SE Conv - AS3 - Nexus 5 Android M 6.0.1 - BlueSaab v4.2 + Amp - Latest CDC repo.
|
I tried applying 12V through the CDC connector (until now I had only applied 3V3 through the 6 pin header) and on the v3.2 board that I have, there is a point market 3V3 right near that connector. The voltage there was only a fraction of a volt and the voltage regulator was hot enough to fry eggs, so I'll be looking for a short somewhere before doing anything else. :-)
@homerisback, I also did that deliberate short between GPIO7 and GND on the RN52. I see an ArduinoISP sketch in the Examples of the IDE, I assume that's the one you used. However, according to the comments in that sketch, it looks like on an Uno I should use the SCK, MISO and MOSI pins which are on the ICSP header or are pins 11,12,13. I'm wondering how it worked with pins 5 and 6 on your Uno. It's a bit of a pain prying the 328 in and out of the Uno, so I'd like to try this method once the power issues are sorted out. Thanks!
NC, USA; 1999 9-3 S, AS2; BlueSaab v3.2, software 4.1
|
Administrator
|
Thanks, HomerIsBack, that's some great information.
NeilR, that's one of the first things I do when I build a new module; I assemble the power section FIRST, and just do a test to make sure I'm getting 3.3v on the vcc pins. If that's not right, and I installed a bunch of parts, they all might get fried if the vcc isn't working right. It definitely sounds like you have a short somewhere, which is why the vreg is so hot; it's an 800mA regulator and it's trying to push all 800mA (or more!). Normally, the module only draws 50-100mA when it's working right :) There are several caps between vcc and gnd for power filtering; I would check those (check the polarity of the caps; newer boards went to ceramic so there is no polarity, but older boards had electrolytic, which are definitely polarized).
NC, USA
|
In reply to this post by NeilR
@NeilR : you're right ! I mixed up steps as it's been a long time I didn't deal with a v3.2... my apologizes.
With the described connections, I uploaded the RN52_PRG sketch (not ArduinoISP) available from Karlis github on the Uno board. Then I was able to set up RN52 via serial monitor. Actually, after unsuccessful attempts with FTDI or USBasp programmer, I made a 328 breadboard myself that is kind of a shield for Uno board. Foolproof and very handy to hook on Arduino Uno. On one side it connects into power from Uno (5V, 3v3 and GND) and on the other side it connects into 10-11-12-13 pins (Reset, Sck, MISO & MOSI). A switch to choose voltage, a 16mhz oscillator, a 328 socket and 10 usbasp layout ext pins make it multipurpose. With ArduinoISP sketch uploaded in the Uno, I'm able to burn bootloader and program any 28-DIP 328. Today, I keep using it to burn bootloader to SMD Atmega328 on latest BlueSAABs (v5.1-5.3) with a little homemade foolproof harness connected to the USBasp pins of my breadboard. Regarding your latest tests, as Seth said before, I would double check every polarized component on board : diodes, capacitor(s), chips and shortcuts of course. Did you use enough flux to solder ? When I began in SMD soldering, I was to shy with it and my job wasn't clean enough ; it really is useful !
01' 9.3 SE Conv - AS3 - Nexus 5 Android M 6.0.1 - BlueSaab v4.2 + Amp - Latest CDC repo.
|
It turned out to be the C1 capacitor. I didn't realize it was electrolytic and had it backwards. After reversing it and applying 12V at the connector, the Power LED lights and the BT1 and BT2 LEDs alternately flash. Onward!
NC, USA; 1999 9-3 S, AS2; BlueSaab v3.2, software 4.1
|
Administrator
|
Yay! Good catch! Let us know how it goes further on. :)
2001 9-5 SE V6; 2006 9-5 Wagon; iOS; BlueSaab version = "latest and greatest" :)
|
In reply to this post by NeilR
Yes ! Good news indeed !
01' 9.3 SE Conv - AS3 - Nexus 5 Android M 6.0.1 - BlueSaab v4.2 + Amp - Latest CDC repo.
|
Free forum by Nabble | Edit this page |