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.
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.
Seems like using the internal oscillator would make my life difficult in regards to serial communication, especially if I have a varying voltage source
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)...
fkeel:
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.
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.
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.
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.
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.
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. Google Code Archive - Long-term storage for Google Code Project Hosting.
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.
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.
Read the section to understand the settings needed.
115.2 looks bad on paper, I haven't lost any data using it that I am aware of tho (with 16 MHz crystal).
In contrast, 250K, 500K, 1M look great - proper wiring would start to become important.
@CrossRoads - I'll have to look into that in more detail. I was actually planning to use much slower speeds for my serial link. Thanks for the page number though - I'll check it out when I am at that point.
For now I am just finalizing my first design which I want to use to run some tests (sort of a sanity check, to make sure I actually understand what I am doing.)
I'm posting my layout/schematic, hoping somebody might point out obvious errors to me, if there are any:
Red components: 0.1uF capacitor
Purple: 10uF capacitor
Yellow: 1k Resistor:
Blue: 10k Resistor:
Green: 8Mhz Resonator
I guess I might potentially drop the top two 0.1 capacitors. I might swap the blue resistor to something higher (assumption: increase battery life). The resonator might go all together, as discussed earlier.
Looks like a pretty basic design to me.
Bring out PD3 if you can - is both a hardware interrupt pin and its a PWM output pin.
I can see how you made the choice not too, tight on space at the top of the board.
Maybe if you add a top layer ground plane, you can have some more options with placement - try turning caps 45 degrees, etc.
Draw a Polygon around the outside perimiter of the board (outside of the dimension line) and right-click, NAME it GND. Eagle can be a little fussy about the start and end point, may have to work that a little. Use Rats Nest to let if fill in.
The top pad you labelled RST is more often called DTR, as you have on the schematic, with the DTR output of the FTDI module connected to it. It should not be named the same as RST on the right hand header, as that is the Reset pin into the '328.
DO NOT DROP the 0.1uF caps, they are needed for stable operation.
10K is fine for the resistor - the pin requires very little current to pull it high - but if you go too big on the resistor the pin becomes susceptible to noise.
well, I don't really need PD3, so its fine for now. (I guess eventuelly I'll break it out as well, in order for others to re-use it, but for now I'll leave it as is.)(I already am breaking out more pins than I was going to, because I realized I need to add the ISP pins for burning the bootloader)
I am a bit constraint by the methods I use for etching - it'll turn out nicer without the ground-plane, so again, for now I'll leave it. Is there any electrical reason for using the ground plane? As in, does it somehow make things more stable? (that's my intuition, but I have know idea to be honest.)
Yep, I get what you're saying about DTR. They are connected to the same pin though, correct?