16
votes
Accepted
_delay_ms() is much slower than expected (by a factor of 6) on TinyAVR 0/1 (ATTiny1604)
Your toolchain is not broken. In the ATTiny804/1604 datasheet, page 77, it shows the CPU clock is divided from the 20/16 MHz oscillator by a prescaler (the ATTiny1614 datasheet shows the same clock ...
13
votes
Accepted
Why is there a clock in my arduino?
Why is there a clock in my arduino?
Because that is how computers and microcontrollers, etc, work.
With a 16mhz clock, each line of my program will take 1/16000000 second, right?
No.
even a ...
13
votes
Accepted
Does the Arduino Uno have two crystals?
The ceramic resonator in yellow is connected to the main MCU, and the crystal in red is connected to the other MCU. USB requires tighter tolerances than is available from a resonator therefore a ...
10
votes
Why is there a clock in my arduino?
Not answered in @Majenko's post: Yes, with a 8MHz clock, each line will take the double of the time. Unless the line waits for something that is not clock driven - e.g. external input.
In addition to ...
10
votes
Accepted
Can I program a 3.3v chip on a 5v board?
The clock speed selected will affect both delay*() and millis()/micros() as well as the functions in <util/delay.h>, therefore you must use the target system's correct clock speed if you are ...
8
votes
Accepted
Arduino 16 MHz with only 3.3V?
Officially, no. Practically, often but not always.
If I follow the datasheet to the the letter, this configuration should not work. BUT... After some test, it did work.
The data sheet does not ...
7
votes
Accepted
Arduino constant clock output
This outputs 8 MHz on pin 9:
#ifdef __AVR_ATmega2560__
const byte CLOCKOUT = 11; // Mega 2560
#else
const byte CLOCKOUT = 9; // Uno, Duemilanove, etc.
#endif
void setup ()
{
// set up 8 ...
6
votes
Arduino at 20 MHz?
There's no hardware reason (as far as I'm aware) that you couldn't run a suitable Arduino at 20 MHz. You'd run into minor timing inaccuracies in software though, as the standard Arduino configuration ...
5
votes
Accepted
Flashing a ATmega328 that came from an Arduino to not use an external oscillator
Do I need an oscillator installed just so I can wake it it up and tell it to not use an oscillator?
Yes, yes you do.
Pick up a 8-16MHz crystal (not an oscillator) and two 15pF capacitors and use ...
5
votes
Arduino 16 MHz with only 3.3V?
According to the datasheet you need 3.78V to run at 16 MHz, and 3.3V isn't that far off. I would be surprised, for example, if it stopped working at 3.77V, because that would mean that the operating ...
5
votes
Programming standalone Atmega328p-PU with NE555N timer IC
No, you won't be able to build a 16 MHz clock signal using a 555 timer. That's far beyond the 555 capabilities (see N.B.).
If you could squeeze out of the 555 a mere 1 MHz (which I seriously doubt), ...
4
votes
ATmega328P and other chip sharing clock
Sharing a crystal between multiple devices is a very bad idea. The crystal is only a piece of the oscillator, the rest of it being a small bit of circuitry within the IC itself. Having multiple ICs ...
4
votes
Accepted
What is the relation between Arduino's clock and possible VGA resolution?
I doubt if that would be fast enough. See my thread about connecting to a VGA monitor.
Borrowing from that page, so as to not make a link-only answer ...
For 640x480 pixels of active video you have ...
4
votes
Arduino at 20 MHz?
You can, and I do.
It's not technically an Arduino anymore, I guess. I made my own board, replacing a resonator on a board will require some fine soldering, but it is definitely possible.
There are ...
4
votes
Confusion with ATmega328P and 3.3V/8MHz
If you are using an LED to indicate that your sketch is running, then that may be the problem.
For example, if you have a fairly average red LED, it might have a forward voltage of 2.0v @ 20ma (...
4
votes
Accepted
Confusion with ATmega328P and 3.3V/8MHz
It was a brownout fuse problem.
Changing boards.txt from:
atmega328bb.bootloader.extended_fuses=0x05
to
atmega328bb.bootloader.extended_fuses=0x02
solved it for me (*).
The chip and red LED now ...
4
votes
Arduino 16 MHz with only 3.3V?
A little test, not very scientific, but shows it runs fine on 3.3V - https://www.youtube.com/watch?v=If0eOa0Uj5I.
Again, if you would like to stay withing the specification just use a "clock divider/...
4
votes
Programming standalone Atmega328p-PU with NE555N timer IC
Yes, you could use a 555. You can also go even simpler and use an RC network. Even simpler still is to use the 1MHz RC network built in to the chip.
The main drawback of these methods, and the 555 ...
4
votes
Programming standalone Atmega328p-PU with NE555N timer IC
The default configuration of these chips, as they come from the factory,
is to use their internal 8 MHz RC oscillator downscaled at 1 MHz. So you
do not need any extra oscillator to program them.
...
4
votes
Accepted
Which of the clock sources are actually internal to the ATmega328P?
If it requires a crystal, as the ones in question clearly state, then obviously you need to connect a crystal (and load capacitors). Or use a ceramic resonator.
Only those labelled as internal are ...
3
votes
Accepted
Syncing/taking external clock for SPI on Arduino Due
For your external source to be an SPI bus master, it has to be the only one generating the clock signal. Yet, calling SPI.transfer() also generates a clock signal from the Arduino; both devices are ...
3
votes
Accepted
How can you reduce the clock frequency of an Arduino Mega?
You can set the clock prescaler for that:
void setup() {
noInterrupts();
CLKPR = _BV(CLKPCE); // enable change of the clock prescaler
CLKPR = _BV(CLKPS0); // divide frequency by 2
...
3
votes
Arduino constant clock output
You can use one of the PWM pins on Arduino to output a PWM signal.
If you want a constant clock, you need to set the duty cycle of the PWM to be 0.5, i.e. 50%.
Syntax: analogWrite(pin, value) where ...
3
votes
Arduino 16 MHz with only 3.3V?
I've built a few 3.3v home-brew-duinos with 16Mhz crystals (because I have a bag of 50 xtals!) - they run fine in the conditions I've put them in so far (on my desk). Some of them may be closer to ...
3
votes
Accepted
Change Digispark clock speed, run at low voltage?
You can set the clock prescaler at run time. For example:
#include <avr/power.h>
void setup()
{
clock_prescale_set(clock_div_8);
// etc...
}
More details in the documentation from
avr-...
3
votes
Accepted
Atmega328P 8MHz External Clock
If you reduce the main clock speed by 50% then everything else is reduced by 50% as well.
The whole chip runs at half the speed. That includes things like the UART.
For example, the bootloader is ...
3
votes
Atmega328P 8MHz External Clock
The easiest way is to use the settings:
Tools > Board > Arduino Pro or Pro Mini
Tools > Processor > ATmega328 (3.3V, 8MHz)
The problem with that is the Pro Mini bootloader is 2kB and has a bug that ...
3
votes
Programming standalone Atmega328p-PU with NE555N timer IC
It depends on how you're programming it.
If you're using a bootloader to accept programming commands via a serial connection then you will need to use the clock method specified by the fuses ...
3
votes
Does delay() pause the counting of millis()?
Delay uses millis. It just waits examining millis until a certain time has passed.
Millis is driven by an interrupt. The only thing that stops it working is another interrupt (you can only have one ...
3
votes
Can the IDE handle a 32khz main clock?
Yes, things will break. The main culpret is this:
#define clockCyclesPerMicrosecond() ( F_CPU / 1000000L )
With any value below 1000000 the result of that calculation will be 0.
That means code ...
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
oscillator-clock × 71arduino-uno × 21
atmega328 × 13
fuses × 6
arduino-mega × 5
arduino-ide × 5
frequency × 5
spi × 4
arduino-due × 4
timers × 4
attiny × 4
arduino-pro-mini × 4
atmega32u4 × 4
rtc × 3
millis × 3
timing × 3
programming × 2
interrupt × 2
pwm × 2
bootloader × 2
avr × 2
electronics × 2
time × 2
avrdude × 2
adc × 2