Questions on making a minimal/custom Arduino circuit @ 3.3v/8Mhz?

hey gang.. title says it all.. :slight_smile:

I have never created/designed a Arduino circuit/board that runs on 3.3v @ 8Mhz before..

I currently have a fun project/challenge that calls for one.. but I want to make sure I understand everything I have read over the months on this subject.. to ensure I havent skipped anything.. or have any unexpected surprises...etc

FACTS:
This custom design/pcb will have uSD socket on it..
Board needs to have minimal design components (space is a HUGE obstacle here), but till somewhat stable
Board will run @ 3.3v
Board will run @ 8Mhz internal clock
Battery solution I 'believe' is a very small coin cell (exact choice hasnt been finalized yet)

QUESTIONS:

1.) If the board is running @ 3.3v/8Mhz (like a pro mini or something).. do I need 'any' sort of level/logic converting for the uSD card then? (whether it be an IC or a simple resistor voltage divider..etc)??

2.) Since the battery used will be more or less a 3.3v (under 5.v for sure, since the only space is really a coin cell type of solution... grrrr)... can I get away with NOT using any sort of voltage regulator?.. and having a few polarized caps along the input/power traces?

3.) being a MINIMAL design is a focal point.. what IS the minimal (but still somewhat stable/safe) components needed?
a.) 10k resistor for reset pin
b.) cap for DTR breakout

*since running @ 3.3v/8Mhz.. I wont need a 16Mhz xstal, no 2 x 22pF caps, no vReg??
Im at a loss? any suggestions to help me plan correctly here?

4.) programming a 'blank' Atmel328 (TQFP) chip to run @ 8Mhz internal clock?
I have programmed blank chips before (both dip and smd) using my Arduino 2009 board, with Arduino as ISP..
I have since moved on to using the Optiloader sketch written my Arduino 2009 board.. and flashed the Opiloader bootloader to my custom/assembled boards..etc..
Everything I have done uses 16Mhz external crystal/caps..

but reading, it seems you need to have the crystal/caps installed/set-up (connected to chip) in order to even WRITE a new 3.3v/8Mhz bootloader? (fuses are set at factory to use external 16Mhz clock?).....

So I could also use some clarification on the easiest way to just flash a bootloader (not even sure which one? pro-mini? lilypad?) that runs @ 3.3v and internal 8Mhz clock..

I have no 'AVR' type programmers, just an Arduino and the IDE..etc..

knowing this.. any suggestions in general? (outside of the specific questions I asked)

Thanks!

If you want to see a minimalist Arduino ckt, running at 3.3V, check out the schematics
for the JeeNode. You can replace the RF module with your SD card.

http://jeelabs.com/products/jeenode

You can flash bootloaders using the ICSP header, or SCK,MISO,MOSI pins, of any Arduino
board connected to your protoboard, although both boards should probably be running
at 3.3V. Check the main Arduino website.

hmm.. I have read (several times I thought) about problem with buring bootloader for 3.3v @ 8Mhz on factory/blank chips? as they are set to run at 16Mhz external clock? so you need to have caps/crystal connected "FIRST".. then burn the 3.3v/8Mhz bootloader of choice?

is this NOT the case your saying?

(I have flashed all my chips/boards using the ISP headers and Arduino IDE..like I mentioned... but never done anything with 3.3v boards or running anything @ 8Mhz... so I wanted some clear advice..)

To clarify.. your saying that my Arduino 2009 board than I use to flash bootloaders to OTHER blank chips, needs to somehow run @ 3.3v now? in order to burn the target (3.3v/8Mhz) bootloader of choice to the blank chip?

thanks for link to jeenode.. (looking at it now)

hmm.. I have read (several times I thought) about problem with buring bootloader for 3.3v @ 8Mhz on factory/blank chips? as they are set to run at 16Mhz external clock? so you need to have caps/crystal connected "FIRST".. then burn the 3.3v/8Mhz bootloader of choice?

The default factory fuse settings are to use internal oscillator.

Select a 3.3V/8MHZ board type that is comparable to your hardware setup.
Ex:
You have 8 MHz crystal: select 3.3V/8MHz Promini.
You have no crystal, but want 8 MHZ - select Lilypad 00 or Lilypad 01 if the options exist:

LilyPad Arduino 00

The initial design of the Arduino LilyPad had a 10-pin ICSP header and used the internal clock on the ATmega168 rather than an external oscillator.
The bootloader on the initial design is the traditional NG bootloader.

LilyPad Arduino 01

In the first revision of the LilyPad Arduino the 10-pin ICSP header was changed to a 6-pin ICSP header and a four pin header w/ RX, TX, +5V, and GND was added.

Select a 3.3V/8MHZ board type that is comparable to your hardware setup.

Once selected, I should imagine you can flash the chips at 5V, using the UNO or Duemilanove
bd, and then stick into the 3.3V board to run.

2.) Since the battery used will be more or less a 3.3v (under 5.v for sure, since the only space is really a coin cell type of solution... grrrr)... can I get away with NOT using any sort of voltage regulator?.. and having a few polarized caps along the input/power traces?

Two things: there are low-drop-out regulators so for instance a 3.6V Li-ion battery could be regulated to 3.3V

Secondly you probably will have problems running an SDcard off a coin cell, they can take serious amounts of current (up to 200mA for write)
A 328 running at 3.3V and 8MHz is fairly mizerly though, so that will probably be OK.

Riva-

thanks.. sorry I thought I had read it was set to be at external 16Mhz..

Crossroads-

thanks..

so its just like burning a bootloader for a 5v/16Mhz set-up?

oops..post while I was typing---

I dont think I'll be doing any writing.. its to house the audio files only (going to use the PWM Audio lib posted here a while back to play some sounds...the pcb is an ODD shape..and extremely small form factor)

if a regulator can be 'had' great.. SMD of course..
but how many are that smallw ith enough current..

and that brings me back to the batteries you bring up.. something small/flat enough current for an Arduino, 8 x SMD leds (running at 10-15mA tops) but not all on at once.. max would be 5.... and the SD card

thanks!

  • Open IDE, (I use v.23 still..but have 1.0 installed if needed)

**TOOLS >> BOARDS >> **(I see Lilypad Arduino w/Atmega328 & Arduino Pro or Arduino Pro Mini (3.3v / 8Mhz) w/Atmega328)

(about the only thing that would match up...)
**I dont see a Lilypad 00 or 01.. just the Lilypad entry as denoted above)

TOOLS >> BURN BOOTLOADER >> w/ARDUINO AS ISP

QUESTION 1:
Does this mean I can just 'direct connect' with a SD card then? no buffer/logic shifter needed? and no resistor based voltage divider either?

QUESTION 2:
I use an FTDI cable like this one from eBay:

thanks.

when I eventually get to the part where I have a bootloader and I can upload sketches.. do I use the 5v or 3.3v volt pin for FTDI/sketch uploading?

Programming the mcu for 8MHz operation is straightforward. I run all my battery-operated projects at 8MHz to save power, and I program them via ICSP.

The 8MHz internal oscillator is not very accurate. You can calibrate it but it still varies with battery voltage. This is not a problem unless you need accurate timing. If you do, use a 3-terminal ceramic resonator (if 0.5% is accurate enough), then you don’t need the 18pF capacitors.

If you are running the mcu from a 3V coin cell, you don’t need voltage regulation for the mcu unless you need a stable analog reference.

You can leave out the reset pin pullup resistor, but it will be more sensitive to noise. So keep the wiring to the reset pin as short as possible and not too close to anything that generates noise. Typically you will only have a connection to the ICSP header, so locate the header close to the mcu and you will be OK without the pullup resistor.

If you will be programming the mcu via ICSP then you don’ need the DTR cap (or a USB-to-serial converter unless you need it for communication, or a bootloader).

If space is that tight and you don’t need so many I/O pins, consider using e.g. attiny85 (8-pin) or attiny84 (14-pin) instead of atmega328p.

xl97:
1.) If the board is running @ 3.3v/8Mhz (like a pro mini or something).. do I need 'any' sort of level/logic converting for the uSD card then? (whether it be an IC or a simple resistor voltage divider..etc)??

2.) Since the battery used will be more or less a 3.3v (under 5.v for sure, since the only space is really a coin cell type of solution... grrrr)... can I get away with NOT using any sort of voltage regulator?.. and having a few polarized caps along the input/power traces?

3.) being a MINIMAL design is a focal point.. what IS the minimal (but still somewhat stable/safe) components needed?
a.) 10k resistor for reset pin
b.) cap for DTR breakout

*since running @ 3.3v/8Mhz.. I wont need a 16Mhz xstal, no 2 x 22pF caps, no vReg??
Im at a loss? any suggestions to help me plan correctly here?

4.) programming a 'blank' Atmel328 (TQFP) chip to run @ 8Mhz internal clock?
I have programmed blank chips before (both dip and smd) using my Arduino 2009 board, with Arduino as ISP..
I have since moved on to using the Optiloader sketch written my Arduino 2009 board.. and flashed the Opiloader bootloader to my custom/assembled boards..etc..
Everything I have done uses 16Mhz external crystal/caps..

but reading, it seems you need to have the crystal/caps installed/set-up (connected to chip) in order to even WRITE a new 3.3v/8Mhz bootloader? (fuses are set at factory to use external 16Mhz clock?).....

So I could also use some clarification on the easiest way to just flash a bootloader (not even sure which one? pro-mini? lilypad?) that runs @ 3.3v and internal 8Mhz clock..

I have no 'AVR' type programmers, just an Arduino and the IDE..etc..

knowing this.. any suggestions in general? (outside of the specific questions I asked)

Thanks!

(1) SD cards run on 3.3 volts. You're golden.
(2) A lithium coin cell direct should work like a champ. No regulator needed.
(3) Use the INTERNAL oscillator option. No crystal or caps needed. You shouldn't need the 10K resistor either.
(4) Programming an AVR... you can setup pin 9 (of an Arduino UNO) as an 8 mhz output and supply the clock that way. Also, new 328P chips come programmed with the INTERNAL 8 mhz oscillator enabled, so you may not need anything. Buy a proto-shield and build yourself an AVRISP board.

Good luck!

A Large coin cell battery has these characterics:
Rated Voltage 3V
Capacity 225mAh

Not going to last very long driving an SD card.

"new 328P chips come programmed with the INTERNAL 8 mhz oscillator enabled,"
is divide by 8 also enabled by default, so it would run at 1 MHz?

Thanks guys..

couple replies to the comments..

the Atmega328p (TQFP) was chosen 'for its look' in this particular situation.. (it was part of a 'prop')

I noticed what chip they used..mentioned what it was used for.. and it spawned the idea to make a pcb for it.. and hence have the (initially only for looks) 328P be functional..and add some effects to the project in the end as well..

since the prop is already created.. and this is more or less a 'retro-fit'.. space is EXTREMELY small.. (and almost all components, but a few leds,. have to go on bottom as well!)

I am hoping to add in both serial and icsp pads for easier flashing.. but only if I can squeeze them in!..

timing (I dont think) is crucial.. (I guess Id have to check on the PWM Audio library I plan to use?). so 8Mhz without caps/crystal sounds right/perfect!...

And not having to use a regulator also helps on saving 'space/components'..

I 'do' however want a stable power source input for the chip though..

and what is this 'stale reference' for analog comment mean? can you explain a bit more please?

also wont breaking out/having both the rest pin and a dtr pad help in flashing both bootloader AND when uploading a sketch? (since there wont be any reset button to 'time' the uploading of a sketch on auto-reset?)

also Im not sure what this means? (although it was aimed at me)

"new 328P chips come programmed with the INTERNAL 8 mhz oscillator enabled,"
is divide by 8 also enabled by default, so it would run at 1 MHz?

thanks!

CrossRoads:
A Large coin cell battery has these characterics:
Rated Voltage 3V
Capacity 225mAh

Not going to last very long driving an SD card.

"new 328P chips come programmed with the INTERNAL 8 mhz oscillator enabled,"
is divide by 8 also enabled by default, so it would run at 1 MHz?

Lithium coin cells are usually 3.6 volts, not 3.0.

And a question: Does an SD card ALWAYS draw "full" current (even when chip select is not asserted)?

I would think you would select the SD card, read or write the data, then put it back to sleep.

There's no reason I can think of for any flash memory card to ALWAYS draw full current.

xl97:
and what is this 'stale reference' for analog comment mean? can you explain a bit more please?

The 328P has a built in regulated 1.1 volt reference for the A/D converter. It will be 1.1 volts regardless of VDD.

If you use a plain 3.6 volt coin cell and select the internal reference, it will work... no regulator needed (and besides, any regulator just wastes the excess power as heat... even switchers).

What other IO is needed?

minimal_twfp_uSD_layout.png

Hi Robert-

outside of some I/O pins for some basic smd leds......and some buttons input to make those leds do something..... I dont think any (but I'll have to review to be sure) :slight_smile:

your schematic looks similar to mine (I'll post when I get to work)..

but mine is missing the cap on the SD socket.. and I didnt do anything with AREF yet.. just using a cap and tying to GND is ok?
(I dont need to tie that to any voltage reference point? (ie: the 3.3v line at all?)

Lastly... (caps).. still a bit confused on these..

from the schematic,...it looks like ALL the caps used are polarized ones?? (or am I reading the symbol wrong?.. I dont see any +/- on the cap symbols anywhere?)

I thought the CAPACITOR symbol that had two STRAIGHT lines.. meant a regular old cap.. and a CAPACTOR symbol that had stiaght line and 1 rounded line.. was signifying a POLARIZED cap?

is this true? (or am I under the wrong impression?)

in this case.. then ALL caps used her should be polarized?

thanks!..

Oh and Robert.. the pcb design/layout is appreciated.. but when I show you the space and size (shape) of the PCB.. you'll probably just laugh at me! lol

thanks again!

we'll post when I get to work..and open things up again.

Despite what the symbol is, caps less than 1 uF are typically unpolarized, and >= 1 uF
are typically polarized.

what IS the minimal (but still somewhat stable/safe) components needed?

A minimum implementation would include just the chip itself.

A reasonable minimum implementation would have a decoupling cap, a crystal + two caps, or a decoupling network on the analog supply. And then more from there, based on your needs.

I have done many "chip-only" minimum implementations myself.

hi..
thanks for the reply..

this can not (should not) be a chip by itself project... IMHO..

I mean I need it to be small.. but I want it to work and be somewhat stable! lol

Since it will be running @ 3.3v & INTERNAL 8Mhz clock... I dont need the caps/crystal.......correct?

RESET pin broken out (for easier flashing/uploading)
DTR pin broken out (for easier flashing/uploading)

AREF pin (correctly set-up... I see in the schematic Crossroads posted.. he has the AREF pin connected to GND through a cap... but I do NOT need to connect to the 3.3v for a voltage refeence? Just keep it INTENRAL reference at the 1.1v or whatever?)

and of course I want to ensure that I 'correctly' set-up the battery/power input..

since there will NOT be any voltage regulator (battery supply will be within the 3-3.7v range max).. but I want it to be stable..no ripples.

follow same principles or ceramic/polarized cap on the input power lines?

@ oric_dan(333)

Despite what the symbol is, caps less than 1 uF are typically unpolarized, and >= 1 uF
are typically polarized.

thanks!.. rules like this help a noob like me.

I am still wrestling with 'decoupling'.. and 'KNOWING' when to use a certain component or not (like when to use ceramic vs polarized..etc)

hopefully I can get to a more final version tonight/tomorrow.. and I'll post for review..

appreciate all the discussion guys!

thanks! :slight_smile:

The little ceramic decoupling caps are not polarized. Example:
http://www.digikey.com/product-detail/en/C0805C104K4RACTU/399-1167-1-ND/411442

Rule of thumb/general guidance: 0.1uF cap on every Vcc/Avcc pin on every part located as nearby as possible.

Aref - needs a 0.1uF cap to Gnd if you are using the internal references
See 2.2:

AtmelAVR042 AVR Design Considerations.pdf (236 KB)