Skip to content

Arduino DUE and APA102 #655

Closed
Closed

Description

@OscarBZ

Hello!
I'm using apa102 led strip, 60 leds.
I can't get hardware spi to work correctly on arduino due!
The goal is to get fastest refresh rate as possible.
I have already tested code on arduino mega hardware spi, and it works fine, also when i force software spi on due again everything works fine on scl and mosi (75,76)pins. But when i try to use hardware spi, the strip shows garbage(blinking or static green leds).. even when i set fastLED spi mhz to 1.
I have even tried to modify some library data, and
when I edit fastspi_arm_sam.h file (~23 line) and change "bits" value to 16, then dues hardware spi starts to work, but slower than using software spi...
Can someone help me with this situation! Thank you :) !

test code:
#define FASTLED_FORCE_SOFTWARE_SPI
#include <FastLED.h>
#define NUM_LEDS 60
CRGB leds[NUM_LEDS];
void setup() {
//FastLED.addLeds<APA102, SPI_DATA, SPI_CLOCK, RGB, DATA_RATE_MHZ(24)>(leds, NUM_LEDS);
FastLED.addLeds<APA102, SPI_DATA, SPI_CLOCK, RGB>(leds, NUM_LEDS);
FastLED.setBrightness(15);
}
void loop() {
for (int i = 0; i < 60; i++) {
leds[i] = CRGB(255, 0, 0);
FastLED.show(); }
for (int i = 0; i < 60; i++) {
leds[i] = CRGB(0, 255, 0);
FastLED.show(); }
for (int i = 0; i < 60; i++) {
leds[i] = CRGB(0, 0, 255);
FastLED.show();}
for (int i = 0; i < 60; i++) {
leds[i] = CRGB(0, 0, 0);
FastLED.show(); }}

Arduino IDE 1.8.7
FastLED 3.2.0

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions