I am trying to build a signal generator from an Arduino with a R2R ladder. I have two devices:
1. Arduino UNO with proper crystal;
2. Arduino Bare Bones Board with 16MHz Resonator.
For now, I'm just trying to determine the limits of the system, so I am basically just switching a pin ON and OFF (pin 3 in this case) as fast as I can with the following code:
Code: Select all
void loop() {
cli();
while (1) {
PORTD |= 0x8;
NOP;
NOP;
PORTD &= ~0x8;
}
}
Arduino UNO w/ crystal

Arduino BBB with resonator

I would rather use the BBB version, but clearly the signal quality sucks. I am wondering if this is only due to the crystal. Does anyone have a clue? If I build a BBB with a proper crystal instead of a resonator, will the signals be similar?
For what it's worth, here were the test differences:
1. Both were powered through USB, so I don't think voltage regulation could be the cause here.
2. The Uno was on its board, while the BBB was plugged in to a breadboard.
3. The BBB as the Optiboot bootloader while the Uno is factory default.
Anybody have a clue where I could investigate next (other than buying a new BBB and fitting it with a crystal)?
Thanks.
P.S. I've tried this with basic digitalWrite calls, and I I get a 20x speed drop
