User selectable voltage and clock circuit

Here is my concept for a user selectable voltage and clock circuit.

CLK_NET goes to XTAL1 on the MCU.

Do any of you electrical engineer gurus see any gotchas or major flaws with this?

Which one?

  • Assumption is only one oscillator is enabled at one time ?

  • Does the output of an oscillator go High Impedance when disabled ?

  • A 3 to 1 (4 to 1) multiplexer might be considered. :thinking:

2 Likes

ATMEGA1284P

Correct

Mind the limitations of the ATmega328P:


I was looking at the ATMEGA1284P

1 Like

Numbers are the same:


From datasheet: https://ww1.microchip.com/downloads/aemDocuments/documents/MCU08/ProductDocuments/DataSheets/ATmega164A_PA-324A_PA-644A_PA-1284_P_Data-Sheet-40002070B.pdf

1 Like

If you want 20MHz or 16MHz you need to supply the MCU with 5V (normal in boards like UNO R3), but your oscillators run on 3.3V, they cannot drive the input high enough. If you supply the MCU with 3.3V the processor can't keep up with 20MHz or 16MHz.

In general two supply voltages is cause for concern.

Your set of oscillators may not be necessary: the internal oscillator can be set to any frequency you want between 4 and 14MHz. For higher speeds you do need a crystal or external oscillator, for lower speeds you can use the clock prescaler.

Yes, hence my circuit auto selects 8MHz if the voltage is 3.3V and won’t allow 16 or 20MHz

Interesting, I thought the clock voltage wouldn't matter?

I am considering moving to a AVR128DB48, then this whole circuit is moot

Your input signal need to go over a certain limit and under another limit. At 5V these are 0.7Vcc = 3.5V and 0.1Vcc = 0.5V. If the input doesn't get high enough the signal won't even be seen by the MCU. It's not: more is better, but it needs to surpass a threshold.

1 Like

And the oscillator is outputting 3.3V

Not impossible to do but what was the intention for giving the user selectable clocks and voltages?

Like many user boards, having user selectable voltages means you can run as more battery friendly (3.3V) or normal I’m-plugged-into-USB high-speed 5V.

AVR can’t run 16/20MHz at 3.3V.

But can run 8/16/20MHz on 5V.

16MHz would be 5V default, 20MHz would be for someone who wants to push a few more ops out of the board

So are you abandoning this whole idea?

Is there an Arduino core for that processor?

1 Like

Good luck with your project!

1 Like

Thanks for your advice! Sorry it was to no avail!

12 posts were split to a new topic: Designing an AVR128DB48-based board