SI5351 Nano @ 1mhz
Moderators: adafruit_support_bill, adafruit
Please be positive and constructive with your questions and comments.
- L10N37
- Posts: 5
- Joined: Tue Feb 14, 2023 6:37 am
SI5351 Nano @ 1mhz
Just wondering how I can still have the MCU function with the SI5351 clock board when running without external 16MHz oscillator and using internal - MCU should be running at 1mhz.
- adafruit_support_mike
- Posts: 67454
- Joined: Thu Feb 11, 2010 2:51 pm
Re: SI5351 Nano @ 1mhz
Do you want the Si5351 to generate the microcontroller's 1MHz CPU clock, or do you want the microcontroller to use its internal oscillator scaled down to 1MHz, with the Si5351 also running at 1MHz as an external device?
- L10N37
- Posts: 5
- Joined: Tue Feb 14, 2023 6:37 am
Re: SI5351 Nano @ 1mhz
Hi there,
Usually i use these SI5351 boards of yours with a 16mhz MCU (generally clone atmega 328P or 168P).
I have a project where I am not using the external 16mhz oscillator for the atmega MCU, it is't required, no point in the extra component / cost.
Only issue is that stops it working with the SI5351 as i believe it affects the i2c, so wondering on what changes i need to make to your code to have the communication between SI5351 and the MCU to still happen.
My app switches frequencies on the fly using a sense pin, but it uses your software to do so. All I had to do was the maths.
Usually i use these SI5351 boards of yours with a 16mhz MCU (generally clone atmega 328P or 168P).
I have a project where I am not using the external 16mhz oscillator for the atmega MCU, it is't required, no point in the extra component / cost.
Only issue is that stops it working with the SI5351 as i believe it affects the i2c, so wondering on what changes i need to make to your code to have the communication between SI5351 and the MCU to still happen.
My app switches frequencies on the fly using a sense pin, but it uses your software to do so. All I had to do was the maths.
- adafruit_support_mike
- Posts: 67454
- Joined: Thu Feb 11, 2010 2:51 pm
Re: SI5351 Nano @ 1mhz
So is the ATmega microcontroller running from its internal RC clock?
- L10N37
- Posts: 5
- Joined: Tue Feb 14, 2023 6:37 am
Re: SI5351 Nano @ 1mhz
That's right :) the fuse settings are set accordingly
- adafruit_support_mike
- Posts: 67454
- Joined: Thu Feb 11, 2010 2:51 pm
Re: SI5351 Nano @ 1mhz
Check your config settings to see if the clock frequency you're using is changing the I2C clock speed. You may need to add some #defines to get the I2C bus back up to 100kHz.
- L10N37
- Posts: 5
- Joined: Tue Feb 14, 2023 6:37 am
Re: SI5351 Nano @ 1mhz
I think I have it
#include <Wire.h>
TWBR = ((1 MHz / 100 kHz) - 16) / 2 = 12
This should fix it to 100khz when using 1mhz internal RC (no external clock source provided).
I will test it this weekend.
#include <Wire.h>
TWBR = ((1 MHz / 100 kHz) - 16) / 2 = 12
This should fix it to 100khz when using 1mhz internal RC (no external clock source provided).
I will test it this weekend.
Please be positive and constructive with your questions and comments.