ATMEGA328p without crystal oscillator

Hello people,

I'm currently making a project using the ATMega328p to read i2c signals from a sensor, and also to use the analog output to communicate with another microncontroller.

It's going to be soldered to a pcb which is going to be developed by me, and it should be as small as possible, so i thought about using the internal 8MHz clock instead of using the very commom 16Mhz Crystal Oscillator.

Is it possible to have reliable i2c and analog output communication without the crystal? Is that recommended?

Thank you!!

Sure you can. But your "analog communication" is something I've never seen done, so that is questionable. What analog output are you referring to? The basic Arduino has no real analog outputs, just PWM.

I'm planning to use the PWM just as you told, sorry if i was not very specific. Will the PWM communication also be reliable and precise without the crystal then?

I've never used I2C but it looks like the timing is not critical.

Will the PWM communication also be reliable and precise without the crystal then?

It depends on how you intend to read/use the PWM. It's not that "precise" to begin with so it probably wont be that much worse.

Smug:
Will the PWM communication also be reliable and precise without the crystal then?

What PWM communication do you mean? You talk as if it's something common but it isn't. So you have to explain what you are doing, in a lot more detail... you do know that PWM can not be read directly with an analog input (ADC), right?

I2C is not at all frequency critical, certainly not slowing it down; it is self-clocked. That is why you can emulate it in software perfectly.

Similarly, PWM as such is not frequency critical. If you are using it as a form of pulse width communication, as long as the recipient is timing both the HIGH and the LOW parts and using the ratio, there will be no problem.

Anything besides steady DC from an output pin, whether it's servo signals, mark / space from a uart or a square wave pulse train is called "PWM" by noobs. How do you you plan to transmit intelligence with PWM?
OOPS: Forgot Morse code. :slight_smile:

Thank you guys! It looks like the atmega328 will use the internal 8Mhz clock then.

I was planning to pass the PWM through a D/A converter because of specifications of my project

Smug:
I was planning to pass the PWM through a D/A converter because of specifications of my project

Well, that does not make any sense at all. :roll_eyes:

In any case, if you care to explain just what it is you want to do, we can probably advise accordingly. :grinning: