Go Down

Topic: Standalone 3.3v Atmega 328p - [working] (Read 13374 times) previous topic - next topic

fkeel

Jan 21, 2014, 03:35 am Last Edit: Feb 03, 2014, 06:48 pm by fkeel Reason: 1
EDIT: I plan on eventually sharing these schematics/layouts, but I want to do it in an orderly fashion after testing/optimizing. If you want the schematics now, send me an e-mail (paul dot strohmeier at gmail dot com).
- - - - - -

Hi Everyone

I'm designing my own minimal Arduino board in order to be able to quickly deploy it in larger projects. I am basing my design around the 3.3v Pro Mini and intend to strip away everything I don't need (i.e. no debug LED's, voltage regulator, only pins I use broken out etc). The upside will be that it will be tiny, ideally use less electricity and fit on a single sided PCB.

Couple of questions:
a)
I am wondering - why exactly do I need an external resonator? If it is running at 8Mhz, could I just use the internal one instead? Is there any specific reason the Pro Mini uses an external resonator?

b)
Could I run the Atmega directly of a LiPo battery (without a regulator)? the voltage will range between ~4v and ~3.2v but that is all well within specs. What would the effects be? I assume the output would vary with that voltage as well, which I would be fine with. I also assume that my analogue sensors would still work, as the ratio between Vout and Vin stays the same (i.e. when using a PhotoDiode to measure light). Am I missing something?

c) I am removing all LEDs. Do any of the LEDs on the Arduino Pro Mini have 'logic' reasons for being there? (I'm assuming they serve as visual indicator for debugging, but I'm wondering if they also have any protective functions.

I'd be interested to hear your thoughts. Also, if you have any links to similar projects I'd love to see them

Thanks in advance

P.


EDIT: I will be using these as little wireless sensor logging platforms. They will connected to a bluetooth module (set up as a serial bridge). Except for the serial connection I do not care about timing. They will be in a stable temperature environment.

EDIT_2: I attached the current version of my layout. This is completely untested and very provisional. But just so you can get an idea where I am trying to take this.
http://embodimentlabs.tumblr.com/
http://paulstrohmeier.info/

CrossRoads

Yes, '328P running from internal 8MHz can  run from 3.7-4.2V Lipo.
I would add 10k reset resistor, couple of 100nF caps on VCC/AVCC to help keep things stable.

Internal oscillator is supposedly not the best for serial comm's, doesn't sound like you are doing.
Promini has power-on LED, and activity indicator LED on SCK. Both can be left off.

Analog, think you may be correct there.
Designing & building electrical circuits for over 25 years.  Screw Shield for Mega/Due/Uno,  Bobuino with ATMega1284P, & other '328P & '1284P creations & offerings at  my website.

fkeel

#2
Jan 21, 2014, 03:46 am Last Edit: Jan 21, 2014, 04:05 am by fkeel Reason: 1
Thanks CrossRoads :-)

EDIT: I just came across this while reading similar questions http://www.avrfreaks.net/modules/FreaksArticles/files/21/Why%20you%20need%20a%20Clock%20Source.pdf

Seems like using the internal oscillator would make my life difficult in regards to serial communication, especially if I have a varying voltage source :-(
http://embodimentlabs.tumblr.com/
http://paulstrohmeier.info/

Coding Badly

#3
Jan 21, 2014, 07:29 am Last Edit: Jan 21, 2014, 07:33 am by Coding Badly Reason: 1

A risk with LiPo batteries is draining them too death.  You will need a cutoff.  Depending on what else is in the circuit you may be able to put the processor into Power Down sleep mode (after turning everything off) when the battery voltage reaches the floor.

This article has details about draining (and charging)...
http://batteryuniversity.com/learn/article/charging_lithium_ion_batteries

Coding Badly

Seems like using the internal oscillator would make my life difficult in regards to serial communication, especially if I have a varying voltage source :-(


I remember doing the calculations over the voltage / temperature range.  I believe the conclusion was that, after the oscillator is tuned, serial communications should be reliable when "clock friendly" baud rates are used.  Let me know if you want details.

ralphd


Thanks CrossRoads :-)

EDIT: I just came across this while reading similar questions http://www.avrfreaks.net/modules/FreaksArticles/files/21/Why%20you%20need%20a%20Clock%20Source.pdf

Seems like using the internal oscillator would make my life difficult in regards to serial communication, especially if I have a varying voltage source :-(

That's not my experience with the ATtiny85; I had 460.8kbps working fine on the internal oscillator at 16Mhz.
Even with a range of voltages for a LiPo discharge (which is rather flat compared to alkaline batteries) you should be fine up to 57.6kbps.  You can also use the ADC to measure the vref against vcc, and thereby measure your input voltage.  You could then in turn use OSCCAL to keep your frequency within 1% of 8Mhz.

ralphd


fkeel

@ralphd

I use Eagle

(Thanks to Crossroads, who has taught me a lot :-)

I'll be posting my finished designs, once I am there. Potentially considering using a tiny instead of a mega.  Will order parts today and hopefully get around to doing some tests by the weekend.


@CodingBadly

Thanks for the pointer about the LiPo. I am aware of this, but didn't think it completely through. I guess I need to use the internal reference voltage for the ADC then (in order to measure the battery voltage and automatically shut off after a threshold). As the reference of 1.1v is really low, do I use a voltage divider (connected to two HIGH-Z pins, one of which is used as a ground and the other is an analog input) to keep my readings from the battery between 0 and 1.1v or is there some smarter way of doing it?

Will the 1.1v stay stable over a varying voltage?

*

As to the Crystal/no Crystal question. I will build a first version with the crystal and once I have it all up and running I will see if I can drop it.
http://embodimentlabs.tumblr.com/
http://paulstrohmeier.info/

CrossRoads

Can add a battery charge control chip.  Maybe MAX1811.
Put it on the back of the card. Not single sided anymore, but it's a little 8-pin part.
http://www.maximintegrated.com/datasheet/index.mvp/id/2536
Designing & building electrical circuits for over 25 years.  Screw Shield for Mega/Due/Uno,  Bobuino with ATMega1284P, & other '328P & '1284P creations & offerings at  my website.

john1993

lipos (and lithium ion) are available with built in protection circuit and dont cost much more than those w/o.

as far as serial goes coding badly is right. contrary to popular belief a tuned internal oscillator is consderably more reliable than an 8mhz crystal in this case. it turns out divisors do not work out for 115kbaud with 8mhz xtl but internal rc osc can be tuned exactly. software uarts are also superior to hardware uarts here for the same reason. also note that rc osc is more than stable enough over that voltage range.

i recall being the only guy who understood this here and on other forums. even threatened with expulsion by those in power but lacking experience. now things have changed and some (small minority) know the truth. similar situation with 16mhz operation at 3.3v. however for life critical applications not recommended. not for technical reasons but legal and liability issues. certainly ok for hobby.

ralphd


as far as serial goes coding badly is right. contrary to popular belief a tuned internal oscillator is consderably more reliable than an 8mhz crystal in this case.

i recall being the only guy who understood this here and on other forums. even threatened with expulsion by those in power but lacking experience.


It seems you're the one lacking experience.
The RC oscillator is more than accurate enough for reliable serial communications.
And a software UART can operate reliably at much higher rates than the hardware USART.  My software UART runs reliably at 460,800bps with a ATtiny85 running off the internal oscillator at 16Mhz.
https://code.google.com/p/picoboot/source/browse/trunk/BBUart.S
I did multiple test with multiple MCUs, and checked the timing with a logic analyzer.

I challenge you to show me hardware serial communication on an AVR running off a 16Mzh external crystal.

fkeel

@ralphd
I believe you and John1993 are saying the same thing...
http://embodimentlabs.tumblr.com/
http://paulstrohmeier.info/

john1993



as far as serial goes coding badly is right. contrary to popular belief a tuned internal oscillator is consderably more reliable than an 8mhz crystal in this case.

i recall being the only guy who understood this here and on other forums. even threatened with expulsion by those in power but lacking experience.


It seems you're the one lacking experience.

The RC oscillator is more than accurate enough for reliable serial communications.
And a software UART can operate reliably at much higher rates than the hardware USART.  My software UART runs reliably at 460,800bps with a ATtiny85 running off the internal oscillator at 16Mhz.
https://code.google.com/p/picoboot/source/browse/trunk/BBUart.S
I did multiple test with multiple MCUs, and checked the timing with a logic analyzer.

I challenge you to show me hardware serial communication on an AVR running off a 16Mzh external crystal.



yes, it seems ralphys lacking experience in reading posts.

i have always believed software uarts are generally superior than hardware in "most" applications and also a great fan of internal clk. you are flat wrong about 115k@16mhz though. generally the divisor problem rears its ugly head at 8mhz.

fkeel


Could I replace the electrolytic 10uF capacitor with a ceramic 10uF capacitor?
http://embodimentlabs.tumblr.com/
http://paulstrohmeier.info/

john1993

yes. ceramic are even better than electrolytic in most cases due to lower leakage, lower esr, and lower cost. specially chip type which are much smaller too.

Go Up