SparkFun Forums 

Where electronics enthusiasts find answers.

Have questions about a SparkFun product or board? This is the place to be.
By mettapera
#118818
First time poster, long time reader.

Design files:
Board
Schematic

As the headline says, when I power the board with 3.3v and try to program it via arduino IDE I get no response. However, when powering with 5v ( a bit risky considering the 3.3V LDO - it's still in a working condition, though) I can program it like any arduino board.

I have tried to isolate the problem by correcting some design failures and by other changes, but to no avail so far.

Here's a list of the changes I made (The files linked are the original):
- CTS floating instead of tied to GND
- FT232's VCC and VCCIO both changed to 3.3v from LDO instead of 5v from USB

Any ideas how to get this thing work with 3.3v supply?
By mettapera
#118993
When you "power the board with 3.3v", to what point in the circuit are you applying the 3.3V?
3.3v should be the voltage from the LDO which input is connected to lipo which in turn is charged by max1555 with 5v from USB. Thus 3.3v is used by most components on board. As I've chosen a lcd which may not be 5v tolerant I have to power at least atmega and that lcd with 3.3v. When it comes to FT232RL chip, I suppose as far as its IO voltage is 3.3v there shouldn't be a problem with a serial connection.
Also, what did you mean by "a bit risky considering the 3.3V LDO"?
If I remember right, the datasheet of the LDO I'm using (LP2950) warns about having its output higher than input or something like that. When I tried whether the board works with 5v I disconnected the lipo, so LDO's input is actually floating. No problems with that so far.

I've experimented a lot with FT232RL's Vcc inputs using every reasonable combination of 5v and 3.3v I can think of. Still, I can't upload sketches when powering atmega - in some cases FT232 too - with 3.3v. It has a 8 MHz crystal so it should work with that voltage. I haven't programmed the FT232 in any way, it should still be in a default configuration. The atmega is running Arduino Pro's 3.3v bootloader for atmega328p.

More info:
It seems that the problem I'm having originates from atmega itself: I uploaded a blink sketch to it in 5v configuration, switched to 3.3v, connected a led to corresponding pin, nothing happens. The bootloader is default. Brown-out detector is set to 2.7v. However, I'm not sure if that's the cause. I've checked the circuit with multimeter and when running it from battery (3.3v) I've seen only 0.01v variation in voltages in Vcc line. Thus decoupling should be fine.

Any ideas? If you notice I missed something crucial info I'm happy to provide more.
By esklar81
#119052
mettapera wrote:3.3v should be the voltage from the LDO which input is connected to lipo which in turn is charged by max1555 with 5v from USB. Thus 3.3v is used by most components on board. As I've chosen a lcd which may not be 5v tolerant I have to power at least atmega and that lcd with 3.3v. When it comes to FT232RL chip, I suppose as far as its IO voltage is 3.3v there shouldn't be a problem with a serial connection.
You do not appear to have answered what I was trying to ask. :( Are you saying that you do not have an external 3.3V source and that your 3.3 V comes from the LiPo and the LP2950Z? If not, to where in the circuit do you connect the 3.3 V source and what is the source?
mettapera wrote: If I remember right, the datasheet of the LDO I'm using (LP2950) warns about having its output higher than input or something like that.
Where did you connect the 5 V? Through what path could it have backfed the LP2950Z?
mettapera wrote:When I tried whether the board works with 5v I disconnected the lipo, so LDO's input is actually floating. No problems with that so far.
When you "disconnected the LiPo", what connection did you open? If you just disconnected the LiPo from the "BAT" node, the line side of the LP2950Z is connected to the output of the MAX1555, not floating. Did you do this with the USB connected or not connected?

Also, what is the charge status of your LiPo? My thought is that if it is low enough, it may be sucking down the MAX1555 output ("BAT") far enough that the LP2950Z can't provide enough 3.3 V to run the ATMega 168.
mettapera wrote:I've experimented a lot with FT232RL's Vcc inputs using every reasonable combination of 5v and 3.3v I can think of. Still, I can't upload sketches when powering atmega - in some cases FT232 too - with 3.3v. It has a 8 MHz crystal so it should work with that voltage. I haven't programmed the FT232 in any way, it should still be in a default configuration. The atmega is running Arduino Pro's 3.3v bootloader for atmega328p.

More info:
It seems that the problem I'm having originates from atmega itself: I uploaded a blink sketch to it in 5v configuration, switched to 3.3v, connected a led to corresponding pin, nothing happens.
Did you test the blink sketch at 5V? If not, then you haven't tested whether the power configuration is the trigger for the problem.
mettapera wrote:The bootloader is default. Brown-out detector is set to 2.7v. However, I'm not sure if that's the cause. I've checked the circuit with multimeter and when running it from battery (3.3v) I've seen only 0.01v variation in voltages in Vcc line.
To which "Vcc line" are you referring, the ATMega168 or the FT232RL? Under what conditions have you monitored it?

Eric
By mettapera
#119119
You do not appear to have answered what I was trying to ask. Are you saying that you do not have an external 3.3V source and that your 3.3 V comes from the LiPo and the LP2950Z? If not, to where in the circuit do you connect the 3.3 V source and what is the source?
3.3v comes from LP2950 and LiPo.
When you "disconnected the LiPo", what connection did you open? If you just disconnected the LiPo from the "BAT" node, the line side of the LP2950Z is connected to the output of the MAX1555, not floating. Did you do this with the USB connected or not connected?
Where did you connect the 5 V? Through what path could it have backfed the LP2950Z?
I opened the switch in the battery's +line. Hmm. You're right, the LP2950 isn't floating. USB was connected. I simply connected 5v from USB and the 3.3v line with a wire (battery disconnected). Thus both input and output of the LP2950 were connected to 5v.
Also, what is the charge status of your LiPo? My thought is that if it is low enough, it may be sucking down the MAX1555 output ("BAT") far enough that the LP2950Z can't provide enough 3.3 V to run the ATMega 168.
The LiPo should be in at least nearly full charge. Per datasheet, the LP2950 has below 300mV drop-out voltage rating for the currents I expect this circuit to use(20-30 mA max).
Did you test the blink sketch at 5V? If not, then you haven't tested whether the power configuration is the trigger for the problem.
I didn't test the blink in 5v but serial connection and input reading works with 5v, but in 3.3v it don't work.
To which "Vcc line" are you referring, the ATMega168 or the FT232RL? Under what conditions have you monitored it?
Vcc of the atmega328. I've checked it USB and battery connected, USB connected and battery disconnected and finally USB disconnected and battery connected.

You're putting some serious effort in helping me, I really appreciate that.
#119153
mettapera,

You're welcome! Thanks for the invitation to your "party"!

Some quick thoughts before I focus on my "day job":

1) What do you get if you open the battery switch but do not put the 5 V jumper across the voltage regulator? (This would eliminate any load the battery is imposing, but still provide power to the ATMega only through the regulator.)

2) Have you checked the ATMega's datasheet to see if there's something you need to do to switch it from 5 V to 3.3 V operation?

3) IIRC, the FT232R has a 3.3 V output. If it can provide enough current, try feeding the battery or USB voltage to the FT232R, then feeding the FT232R's 3.3 V output to the rest of the circuit. What do you get? (If this works, you'll save yourself a voltage regulator and its support components. :) )

4) Have you monitored the voltage on the ATMega's sleep and reset pins? There is some discussion, in the datasheet, of hanging on tightly-spaced reset signals. If your reset is "bouncy", that might be a problem. I suggest disconnecting the capacitor from the reset pin to see what, if anything, that does. (You might also want to try "manual" resetting, that is, grounding the reset pin some time after power up.)

Happy Hunting,
Eric
By mettapera
#119172
A quick update before soldering:

1) With 3.3v from reg from USB: No serial response, no blink.
With 5v from USB via jumper: Serial works, as blink, too.

2) I glanced over both summary and full datasheets and searched from them with keywords "3.3" and "lower", I didn't notice anything of interest, though.

4) I don't have an oscillator (I definitely should have), but my multimeter shows slight differences between voltages in the reset and Vcc (=regulator's output) lines:
3.3v nominal: 3.31v in Vcc, 3.29v in reset (same readings with both battery connected and disconnected)
5v nominal from USB: 4.99v in Vcc and USB V+, 4.95v in reset
In both cases, when I press the reset button, the voltage in the reset line is 0v as it should be.
I'm not sure whether these voltage differences are significant or not; with 5v the board works absolutely fine. However, my multimeter is kinda slow to detect variations even for a multimeter, so there might be something going on that I can't see as well.

I'll try 3) and that reset line capacitor -options later.

Stay tuned.
By mettapera
#119179
Update to to the previous update:
3) I disconnected the Vcc of the FT232 from 3.3v and connected it back to 5v from USB where it originally was and connected 3.3vOut of the FT232 to the 3.3v line. No difference in behaviour. Serial won't work.

4) I connected both ends the 100nF capacitor in the DTR line with a wire. Serial won't work.

Hmm. That's all I can say now... :|
#119231
From looking at your schematic, I think you need to connect FT232 Vcc to USB 5V and connect VccIO to 3V3Out. This would give you 3V3 for the datalines and 5V for your battery charger and LDO. All the bus-powered examples in the datasheet uses 5V for Vcc even for 3V3 operation.

Stig
By mettapera
#119247
From looking at your schematic, I think you need to connect FT232 Vcc to USB 5V and connect VccIO to 3V3Out. This would give you 3V3 for the datalines and 5V for your battery charger and LDO. All the bus-powered examples in the datasheet uses 5V for Vcc even for 3V3 operation.
I tested the circuit with these changes but results were the same: no serial. :( The measured voltages were:
Battery switch open:
5v in USB V+, 3.31v in 3.3 line (Vcc), 3.29v in atmega's reset.
Battery switch closed:
4.90v in USB V+, 3.33v in 3.3 line (Vcc), 3.31v in atmegas' reset, battery's supply voltage: 4.17v

Is there any change that a component other than atmega or ft232 would be the cause of these problems? I have already a big mess of wires and cut traces in my pcb so isolating non-critical components by cutting traces leading to them won't make much of a difference; I'll probably end up designing a new one anyway. :wink:
#119250
In theory, your circuit should work... :-) Since you don't have an oscilloscope, it's difficult to make sure the oscillator is working. You could also try to bypass the 1k resistors on the datalines. That's the only things I can think of which could make a problem.

Stig
By mettapera
#119255
You could also try to bypass the 1k resistors on the datalines. That's the only things I can think of which could make a problem.
I think I tried that at some point but I can of course confirm that.

Hmm. An oscillosscope will be my next purchase.
#119324
Very strange...

Is LED2 or LED3 flashing when you try the serial?

One way to check if the actual microcontroller is actually running with 3V3, is to just program it with a simple flasher program under 5V (as was suggested earlier), change it back to 3V3 and connect up a LED to the pin specified in the flasher program, e.g. your led pin, and see if the led flashes. There is a very simple flasher program for the Arduino, just change the LED pin to the correct pin for your LED.

Edit: One thing you could try, is changing C10/C11 to either 15pF or 18pF, in case the oscillator doesn't start with 3V3.