Permalink
Browse files

1 MHz SPI max speed for latest pixels

  • Loading branch information...
1 parent b768a73 commit ac7322775b07ac4a13ea45fbb96f3a51dee6f559 @PaintYourDragon PaintYourDragon committed Mar 14, 2012
Showing with 2 additions and 8 deletions.
  1. +1 −7 Arduino/LEDstream/LEDstream.pde
  2. +1 −1 Arduino/LEDtest/LEDtest.pde
@@ -100,13 +100,7 @@ void setup()
SPI.begin();
SPI.setBitOrder(MSBFIRST);
SPI.setDataMode(SPI_MODE0);
- SPI.setClockDivider(SPI_CLOCK_DIV8); // 2 MHz
- // WS2801 datasheet recommends max SPI clock of 2 MHz, and 50 Ohm
- // resistors on SPI lines for impedance matching. In practice and
- // at short distances, 2 MHz seemed to work reliably enough without
- // resistors, and 4 MHz was possible with a 220 Ohm resistor on the
- // SPI clock line only. Your mileage may vary. Experiment!
- // SPI.setClockDivider(SPI_CLOCK_DIV4); // 4 MHz
+ SPI.setClockDivider(SPI_CLOCK_DIV16); // 1 MHz max, else flicker
// Issue test pattern to LEDs on startup. This helps verify that
// wiring between the Arduino and LEDs is correct. Not knowing the
@@ -11,7 +11,7 @@ void setup() {
SPI.begin();
SPI.setBitOrder(MSBFIRST);
SPI.setDataMode(SPI_MODE0);
- SPI.setClockDivider(SPI_CLOCK_DIV8);
+ SPI.setClockDivider(SPI_CLOCK_DIV16); // 1 MHz
}
int p = 0; // Current pixel being lit

0 comments on commit ac73227

Please sign in to comment.