Hi all, i've a question:
I want to design board with two atmega328 in parallel, one running at 3.3V 8Mhz and the other at 5V 16Mhz.
If i want to make them comunicate trough a digital serial, can i consider the 3.3 V one as 5V proof or i need a voltage divider in order to avoid damages?
Thank you all guys!
Is an atmega328 running 3.3V, 5V proof on serial pins?
No, the absolute max limits on any I/O pin are -0.5V to Vcc+0.5V
You can just use a 4k7 series resistor - the protection diodes will cope with a few 100
microamps. Or a voltage divider, or a level shifter chip.
You mean +-0.5V the operational voltage and vref?
But an arduino running at 5 V is able to recive signals from a 3.3 wich is much lower -0.5V.
Bests
You did not read it properly. He says -0,5V (no not at all related to supply voltage, only GND) and Vcc + 0,5V. If Vcc is 3,3V you have a range of 0,5V to 3,8V. Wih Vcc being 5V you have a range between 0,5V and 5,5V. So a signal of 3,3V is well withing the range of the 5V ATmega but 5V is far out of spec for the 3,3V ATmega.
Ohh, i see! Well, thank you so, is clear now
Perhaps you really should explain why you want to do this?
I'm working on a project that involve sensors on the top of a glacier, on the alps.
There are several task to perform, and the memory of a 328 is not enough, while the 1284 would be great, but i'm not sure about how all of the libraries involved would perform.
Also, two 328 are kind of cheaper or the same price of a 1284.
So, i want to have a 328 at 3.3v that take care of managing the battery and the solar panel, that will be always powered even if almost always sleeping, and will log datas on a sd card.
Then i will have a 5V part with the other 328, working with a GSM module to send me datas.
This part will be powered just one sometime, since it consume lot of energy.
This is the specific case, but i'm interested in the argument in general.
How many thousands of these are you going to make? Saving a buck on the processor at the expense of the programmer having to program two chips is really poor economics.
We are starting with 0.027 thousands units, 27, to cover a square km with a 5x5 grid plus two reference sensors in safer places.
I'm the programmer too, but i don't consider myself good enough to debugging all the problems the 1284 would may bring in the project, in the short time i have.
I don't see a particular complexity in a i2c or spi or software serial master-slave configuration, compared to porting libraries or searching and comparing different thid parties cores, but I may be wrong.
Single 1284P, $7.67
Two 328P, $3.38 x 2 = $6.76, plus extra crystal, caps, reset resistor, decoupling caps, board space, etc.
I'd go with 1284P and cd74CH4050 for 3.3V buffering to SD card.
Power down sleep mode as much as you can. Control power to GSM. Maybe an RTC with alarm to wake up one a/however long to log whatever. Libraries can be made to work if they don't already, generally not that big an issue.
secondsky:
Then i will have a 5V part with the other 328, working with a GSM module to send me datas.
I suspect you can find GSM modules with a 3.3 V interface.
This is the specific case, but i'm interested in the argument in general.
Level translation...
...a transistor and resistor for each line (two in your case).
I considered the SIM800 that is 3.5 to 4.5V and the SIM 900 that is 5V.
I ended on the second.
Anyway it really consume energy, it is possible to put it insto a sleep mode but i prefer to close totally his energy line and reset it all the time, together with his dedicated 328.
Do you think that just a voltage divider would not be enough? I also saw solution with just just a resistor in series like this.
MarkT suggested series resistors in post #1 above, and he also said you could use a voltage divider or level shifter, and Coding Badly gave you the link to a nifty level shifter. It's time to just decide, and build yourself a prototype.
secondsky:
We are starting with 0.027 thousands units, 27
Good answer.
CrossRoads:
Single 1284P, $7.67
Two 328P, $3.38 x 2 = $6.76, plus extra crystal, caps, reset resistor, decoupling caps, board space, etc.
I'd go with 1284P and cd74CH4050 for 3.3V buffering to SD card.
Power down sleep mode as much as you can. Control power to GSM. Maybe an RTC with alarm to wake up one a/however long to log whatever.
I do agree, it was my first intention. Btw the extra cost for few extra components will raise the cost like at the exact same price of the 1284.
CrossRoads:
Libraries can be made to work if they don't already, generally not that big an issue.
This is very depending by the skills.
I know I'm choosing the less elegant and minimal decision, but time*skills is a factor like any other, as well as RAM or Component prices.
The same reason because i don't go smd.