Using ws2812 led strip on Arduino giga?

I am trying to address a lws2912 light led strip that has been working fine with an arduino uno. All the libraries that i can find for addressing the led strip(60 LEDS) always has errors when compiling for the giga board but not the uno. The errors are always in the library code wherever there is a line that mentions 'ARM'. Is there a way around this issue?

Hello @zawi. Would you show (here) the errors that you are receiving?

which library are you using ?

I have tried two different major libraries. The first library i tried was FastLED and it gave me this error:

In file included from C:\Users\Zawi\Documents\Arduino\libraries\FastLED\src/FastLED.h:43:0,
                 from C:\Users\Zawi\iCloudDrive\TEST\FastLED-master\FastLED-master\examples\ColorPalette\ColorPalette.ino:1:
C:\Users\Zawi\Documents\Arduino\libraries\FastLED\src/led_sysdefs.h:55:2: error: #error "This platform isn't recognized by FastLED... yet.  See comments in FastLED/led_sysdefs.h for options."
 #error "This platform isn't recognized by FastLED... yet.  See comments in FastLED/led_sysdefs.h for options."
  ^~~~~

exit status 1

Compilation error: exit status 1

and the other major library I have tried was Adafruit neopixel and the library code would compile along with the test sketch but the LED's didn't light up (i did check that they were connected to the right data pin)

I actually suspect that the clock-rate is a bit beyond for any of the bit-bang modes.
Your best chance should be a UART method,
try PaulStoffregen/WS2812Serial
or maybe Makuna/NeoPixelBus

Arduino Giga is based on the STM32H747 micro, FastLED is not compatible.

I tried both libraries that you mentioned. The WS2812Serial gave me this error:

In file included from C:\Users\Zawi\Documents\Arduino\libraries\WS2812Serial-master/DMAChannel.h:34:0,
                 from C:\Users\Zawi\Documents\Arduino\libraries\WS2812Serial-master/WS2812Serial.h:28,
                 from C:\Users\Zawi\AppData\Local\Temp\.arduinoIDE-unsaved2023217-11284-nz915x.vrqm9\BasicTest_RGBW\BasicTest_RGBW.ino:7:
C:\Users\Zawi\Documents\Arduino\libraries\WS2812Serial-master/kinetis.h:5883:28: error: 'NVIC_NUM_INTERRUPTS' was not declared in this scope
 extern void (* _VectorsRam[NVIC_NUM_INTERRUPTS+16])(void);
                            ^~~~~~~~~~~~~~~~~~~
C:\Users\Zawi\Documents\Arduino\libraries\WS2812Serial-master/kinetis.h:5883:28: note: suggested alternative: 'NOT_AN_INTERRUPT'
 extern void (* _VectorsRam[NVIC_NUM_INTERRUPTS+16])(void);
                            ^~~~~~~~~~~~~~~~~~~
                            NOT_AN_INTERRUPT
C:\Users\Zawi\Documents\Arduino\libraries\WS2812Serial-master/kinetis.h:5884:36: error: 'NVIC_NUM_INTERRUPTS' was not declared in this scope
 extern void (* const _VectorsFlash[NVIC_NUM_INTERRUPTS+16])(void);
                                    ^~~~~~~~~~~~~~~~~~~
C:\Users\Zawi\Documents\Arduino\libraries\WS2812Serial-master/kinetis.h:5884:36: note: suggested alternative: 'NOT_AN_INTERRUPT'
 extern void (* const _VectorsFlash[NVIC_NUM_INTERRUPTS+16])(void);
                                    ^~~~~~~~~~~~~~~~~~~
                                    NOT_AN_INTERRUPT
In file included from C:\Users\Zawi\AppData\Local\Temp\.arduinoIDE-unsaved2023217-11284-nz915x.vrqm9\BasicTest_RGBW\BasicTest_RGBW.ino:7:0:
C:\Users\Zawi\Documents\Arduino\libraries\WS2812Serial-master/WS2812Serial.h:126:2: error: 'DMAChannel' does not name a type; did you mean 'DMAChannel_h_'?
  DMAChannel *dma = nullptr;
  ^~~~~~~~~~
  DMAChannel_h_
C:\Users\Zawi\AppData\Local\Temp\.arduinoIDE-unsaved2023217-11284-nz915x.vrqm9\BasicTest_RGBW\BasicTest_RGBW.ino:21:1: error: 'DMAMEM' does not name a type; did you mean 'DMAMUX1'?
 DMAMEM byte displayMemory[numled*16]; // 16 bytes per LED for RGBW
 ^~~~~~
 DMAMUX1
C:\Users\Zawi\AppData\Local\Temp\.arduinoIDE-unsaved2023217-11284-nz915x.vrqm9\BasicTest_RGBW\BasicTest_RGBW.ino:23:27: error: 'displayMemory' was not declared in this scope
 WS2812Serial leds(numled, displayMemory, drawingMemory, pin, WS2812_GRBW);
                           ^~~~~~~~~~~~~
C:\Users\Zawi\AppData\Local\Temp\.arduinoIDE-unsaved2023217-11284-nz915x.vrqm9\BasicTest_RGBW\BasicTest_RGBW.ino:23:27: note: suggested alternative: 'drawingMemory'
 WS2812Serial leds(numled, displayMemory, drawingMemory, pin, WS2812_GRBW);
                           ^~~~~~~~~~~~~
                           drawingMemory

exit status 1

Compilation error: 'DMAMEM' does not name a type; did you mean 'DMAMUX1'?

and the NeoPixelBus gave me this error

In file included from C:\Users\Zawi\Documents\Arduino\libraries\NeoPixelBus_by_Makuna\src/NeoPixelBus.h:108:0,
                 from C:\Users\Zawi\AppData\Local\Temp\.arduinoIDE-unsaved2023217-11284-dmqcy5.tn49g\NeoPixelTest\NeoPixelTest.ino:14:
C:\Users\Zawi\Documents\Arduino\libraries\NeoPixelBus_by_Makuna\src/internal/NeoArmMethod.h:716:26: error: 'VARIANT_MCK' was not declared in this scope
 #define ARM_OTHER_SCALE  VARIANT_MCK / 2UL / 1000000UL
                          ^
C:\Users\Zawi\Documents\Arduino\libraries\NeoPixelBus_by_Makuna\src/internal/NeoArmMethod.h:716:26: note: in definition of macro 'ARM_OTHER_SCALE'
 #define ARM_OTHER_SCALE  VARIANT_MCK / 2UL / 1000000UL
                          ^~~~~~~~~~~
C:\Users\Zawi\Documents\Arduino\libraries\NeoPixelBus_by_Makuna\src/internal/NeoArmMethod.h:717:33: error: 'F_CPU' was not declared in this scope
 #define ARM_OTHER_INST   (2UL * F_CPU / VARIANT_MCK)
                                 ^
C:\Users\Zawi\Documents\Arduino\libraries\NeoPixelBus_by_Makuna\src/internal/NeoArmMethod.h:717:33: note: in definition of macro 'ARM_OTHER_INST'
 #define ARM_OTHER_INST   (2UL * F_CPU / VARIANT_MCK)
                                 ^~~~~
C:\Users\Zawi\Documents\Arduino\libraries\NeoPixelBus_by_Makuna\src/internal/NeoArmMethod.h:717:33: note: suggested alternative: 'FPU'
 #define ARM_OTHER_INST   (2UL * F_CPU / VARIANT_MCK)
                                 ^
C:\Users\Zawi\Documents\Arduino\libraries\NeoPixelBus_by_Makuna\src/internal/NeoArmMethod.h:717:33: note: in definition of macro 'ARM_OTHER_INST'
 #define ARM_OTHER_INST   (2UL * F_CPU / VARIANT_MCK)
                                 ^~~~~
C:\Users\Zawi\Documents\Arduino\libraries\NeoPixelBus_by_Makuna\src/internal/NeoArmMethod.h:717:41: error: 'VARIANT_MCK' was not declared in this scope
 #define ARM_OTHER_INST   (2UL * F_CPU / VARIANT_MCK)
                                         ^
C:\Users\Zawi\Documents\Arduino\libraries\NeoPixelBus_by_Makuna\src/internal/NeoArmMethod.h:717:41: note: in definition of macro 'ARM_OTHER_INST'
 #define ARM_OTHER_INST   (2UL * F_CPU / VARIANT_MCK)
                                         ^~~~~~~~~~~
C:\Users\Zawi\Documents\Arduino\libraries\NeoPixelBus_by_Makuna\src/internal/NeoArmMethod.h:716:26: error: 'VARIANT_MCK' was not declared in this scope
 #define ARM_OTHER_SCALE  VARIANT_MCK / 2UL / 1000000UL
                          ^
C:\Users\Zawi\Documents\Arduino\libraries\NeoPixelBus_by_Makuna\src/internal/NeoArmMethod.h:716:26: note: in definition of macro 'ARM_OTHER_SCALE'
 #define ARM_OTHER_SCALE  VARIANT_MCK / 2UL / 1000000UL
                          ^~~~~~~~~~~
C:\Users\Zawi\Documents\Arduino\libraries\NeoPixelBus_by_Makuna\src/internal/NeoArmMethod.h:717:33: error: 'F_CPU' was not declared in this scope
 #define ARM_OTHER_INST   (2UL * F_CPU / VARIANT_MCK)
                                 ^
C:\Users\Zawi\Documents\Arduino\libraries\NeoPixelBus_by_Makuna\src/internal/NeoArmMethod.h:717:33: note: in definition of macro 'ARM_OTHER_INST'
 #define ARM_OTHER_INST   (2UL * F_CPU / VARIANT_MCK)
                                 ^~~~~
C:\Users\Zawi\Documents\Arduino\libraries\NeoPixelBus_by_Makuna\src/internal/NeoArmMethod.h:717:33: note: suggested alternative: 'FPU'
 #define ARM_OTHER_INST   (2UL * F_CPU / VARIANT_MCK)
                                 ^
C:\Users\Zawi\Documents\Arduino\libraries\NeoPixelBus_by_Makuna\src/internal/NeoArmMethod.h:717:33: note: in definition of macro 'ARM_OTHER_INST'
 #define ARM_OTHER_INST   (2UL * F_CPU / VARIANT_MCK)
                                 ^~~~~
C:\Users\Zawi\Documents\Arduino\libraries\NeoPixelBus_by_Makuna\src/internal/NeoArmMethod.h:717:41: error: 'VARIANT_MCK' was not declared in this scope
 #define ARM_OTHER_INST   (2UL * F_CPU / VARIANT_MCK)
                                         ^
C:\Users\Zawi\Documents\Arduino\libraries\NeoPixelBus_by_Makuna\src/internal/NeoArmMethod.h:717:41: note: in definition of macro 'ARM_OTHER_INST'
 #define ARM_OTHER_INST   (2UL * F_CPU / VARIANT_MCK)
                                         ^~~~~~~~~~~
C:\Users\Zawi\Documents\Arduino\libraries\NeoPixelBus_by_Makuna\src/internal/NeoArmMethod.h:716:26: error: 'VARIANT_MCK' was not declared in this scope
 #define ARM_OTHER_SCALE  VARIANT_MCK / 2UL / 1000000UL
                          ^
C:\Users\Zawi\Documents\Arduino\libraries\NeoPixelBus_by_Makuna\src/internal/NeoArmMethod.h:716:26: note: in definition of macro 'ARM_OTHER_SCALE'
 #define ARM_OTHER_SCALE  VARIANT_MCK / 2UL / 1000000UL
                          ^~~~~~~~~~~
C:\Users\Zawi\Documents\Arduino\libraries\NeoPixelBus_by_Makuna\src/internal/NeoArmMethod.h:717:33: error: 'F_CPU' was not declared in this scope
 #define ARM_OTHER_INST   (2UL * F_CPU / VARIANT_MCK)
                                 ^
C:\Users\Zawi\Documents\Arduino\libraries\NeoPixelBus_by_Makuna\src/internal/NeoArmMethod.h:717:33: note: in definition of macro 'ARM_OTHER_INST'
 #define ARM_OTHER_INST   (2UL * F_CPU / VARIANT_MCK)
                                 ^~~~~
C:\Users\Zawi\Documents\Arduino\libraries\NeoPixelBus_by_Makuna\src/internal/NeoArmMethod.h:717:33: note: suggested alternative: 'FPU'
 #define ARM_OTHER_INST   (2UL * F_CPU / VARIANT_MCK)
                                 ^
C:\Users\Zawi\Documents\Arduino\libraries\NeoPixelBus_by_Makuna\src/internal/NeoArmMethod.h:717:33: note: in definition of macro 'ARM_OTHER_INST'
 #define ARM_OTHER_INST   (2UL * F_CPU / VARIANT_MCK)
                                 ^~~~~
C:\Users\Zawi\Documents\Arduino\libraries\NeoPixelBus_by_Makuna\src/internal/NeoArmMethod.h:717:41: error: 'VARIANT_MCK' was not declared in this scope
 #define ARM_OTHER_INST   (2UL * F_CPU / VARIANT_MCK)
                                         ^
C:\Users\Zawi\Documents\Arduino\libraries\NeoPixelBus_by_Makuna\src/internal/NeoArmMethod.h:717:41: note: in definition of macro 'ARM_OTHER_INST'
 #define ARM_OTHER_INST   (2UL * F_CPU / VARIANT_MCK)
                                         ^~~~~~~~~~~
C:\Users\Zawi\Documents\Arduino\libraries\NeoPixelBus_by_Makuna\src/internal/NeoArmMethod.h:716:26: error: 'VARIANT_MCK' was not declared in this scope
 #define ARM_OTHER_SCALE  VARIANT_MCK / 2UL / 1000000UL
                          ^
C:\Users\Zawi\Documents\Arduino\libraries\NeoPixelBus_by_Makuna\src/internal/NeoArmMethod.h:716:26: note: in definition of macro 'ARM_OTHER_SCALE'
 #define ARM_OTHER_SCALE  VARIANT_MCK / 2UL / 1000000UL
                          ^~~~~~~~~~~
C:\Users\Zawi\Documents\Arduino\libraries\NeoPixelBus_by_Makuna\src/internal/NeoArmMethod.h:717:33: error: 'F_CPU' was not declared in this scope
 #define ARM_OTHER_INST   (2UL * F_CPU / VARIANT_MCK)
                                 ^
C:\Users\Zawi\Documents\Arduino\libraries\NeoPixelBus_by_Makuna\src/internal/NeoArmMethod.h:717:33: note: in definition of macro 'ARM_OTHER_INST'
 #define ARM_OTHER_INST   (2UL * F_CPU / VARIANT_MCK)
                                 ^~~~~
C:\Users\Zawi\Documents\Arduino\libraries\NeoPixelBus_by_Makuna\src/internal/NeoArmMethod.h:717:33: note: suggested alternative: 'FPU'
 #define ARM_OTHER_INST   (2UL * F_CPU / VARIANT_MCK)
                                 ^
C:\Users\Zawi\Documents\Arduino\libraries\NeoPixelBus_by_Makuna\src/internal/NeoArmMethod.h:717:33: note: in definition of macro 'ARM_OTHER_INST'
 #define ARM_OTHER_INST   (2UL * F_CPU / VARIANT_MCK)
                                 ^~~~~
C:\Users\Zawi\Documents\Arduino\libraries\NeoPixelBus_by_Makuna\src/internal/NeoArmMethod.h:717:41: error: 'VARIANT_MCK' was not declared in this scope
 #define ARM_OTHER_INST   (2UL * F_CPU / VARIANT_MCK)
                                         ^
C:\Users\Zawi\Documents\Arduino\libraries\NeoPixelBus_by_Makuna\src/internal/NeoArmMethod.h:717:41: note: in definition of macro 'ARM_OTHER_INST'
 #define ARM_OTHER_INST   (2UL * F_CPU / VARIANT_MCK)
                                         ^~~~~~~~~~~
C:\Users\Zawi\Documents\Arduino\libraries\NeoPixelBus_by_Makuna\src/internal/NeoArmMethod.h:716:26: error: 'VARIANT_MCK' was not declared in this scope
 #define ARM_OTHER_SCALE  VARIANT_MCK / 2UL / 1000000UL
                          ^
C:\Users\Zawi\Documents\Arduino\libraries\NeoPixelBus_by_Makuna\src/internal/NeoArmMethod.h:716:26: note: in definition of macro 'ARM_OTHER_SCALE'
 #define ARM_OTHER_SCALE  VARIANT_MCK / 2UL / 1000000UL
                          ^~~~~~~~~~~
C:\Users\Zawi\Documents\Arduino\libraries\NeoPixelBus_by_Makuna\src/internal/NeoArmMethod.h:717:33: error: 'F_CPU' was not declared in this scope
 #define ARM_OTHER_INST   (2UL * F_CPU / VARIANT_MCK)
                                 ^
C:\Users\Zawi\Documents\Arduino\libraries\NeoPixelBus_by_Makuna\src/internal/NeoArmMethod.h:717:33: note: in definition of macro 'ARM_OTHER_INST'
 #define ARM_OTHER_INST   (2UL * F_CPU / VARIANT_MCK)
                                 ^~~~~
C:\Users\Zawi\Documents\Arduino\libraries\NeoPixelBus_by_Makuna\src/internal/NeoArmMethod.h:717:33: note: suggested alternative: 'FPU'
 #define ARM_OTHER_INST   (2UL * F_CPU / VARIANT_MCK)
                                 ^
C:\Users\Zawi\Documents\Arduino\libraries\NeoPixelBus_by_Makuna\src/internal/NeoArmMethod.h:717:33: note: in definition of macro 'ARM_OTHER_INST'
 #define ARM_OTHER_INST   (2UL * F_CPU / VARIANT_MCK)
                                 ^~~~~
C:\Users\Zawi\Documents\Arduino\libraries\NeoPixelBus_by_Makuna\src/internal/NeoArmMethod.h:717:41: error: 'VARIANT_MCK' was not declared in this scope
 #define ARM_OTHER_INST   (2UL * F_CPU / VARIANT_MCK)
                                         ^
C:\Users\Zawi\Documents\Arduino\libraries\NeoPixelBus_by_Makuna\src/internal/NeoArmMethod.h:717:41: note: in definition of macro 'ARM_OTHER_INST'
 #define ARM_OTHER_INST   (2UL * F_CPU / VARIANT_MCK)
                                         ^~~~~~~~~~~
C:\Users\Zawi\Documents\Arduino\libraries\NeoPixelBus_by_Makuna\src/internal/NeoArmMethod.h:716:26: error: 'VARIANT_MCK' was not declared in this scope
 #define ARM_OTHER_SCALE  VARIANT_MCK / 2UL / 1000000UL
                          ^
C:\Users\Zawi\Documents\Arduino\libraries\NeoPixelBus_by_Makuna\src/internal/NeoArmMethod.h:716:26: note: in definition of macro 'ARM_OTHER_SCALE'
 #define ARM_OTHER_SCALE  VARIANT_MCK / 2UL / 1000000UL
                          ^~~~~~~~~~~
C:\Users\Zawi\Documents\Arduino\libraries\NeoPixelBus_by_Makuna\src/internal/NeoArmMethod.h:717:33: error: 'F_CPU' was not declared in this scope
 #define ARM_OTHER_INST   (2UL * F_CPU / VARIANT_MCK)
                                 ^
C:\Users\Zawi\Documents\Arduino\libraries\NeoPixelBus_by_Makuna\src/internal/NeoArmMethod.h:717:33: note: in definition of macro 'ARM_OTHER_INST'
 #define ARM_OTHER_INST   (2UL * F_CPU / VARIANT_MCK)
                                 ^~~~~
C:\Users\Zawi\Documents\Arduino\libraries\NeoPixelBus_by_Makuna\src/internal/NeoArmMethod.h:717:33: note: suggested alternative: 'FPU'
 #define ARM_OTHER_INST   (2UL * F_CPU / VARIANT_MCK)
                                 ^
C:\Users\Zawi\Documents\Arduino\libraries\NeoPixelBus_by_Makuna\src/internal/NeoArmMethod.h:717:33: note: in definition of macro 'ARM_OTHER_INST'
 #define ARM_OTHER_INST   (2UL * F_CPU / VARIANT_MCK)
                                 ^~~~~
C:\Users\Zawi\Documents\Arduino\libraries\NeoPixelBus_by_Makuna\src/internal/NeoArmMethod.h:717:41: error: 'VARIANT_MCK' was not declared in this scope
 #define ARM_OTHER_INST   (2UL * F_CPU / VARIANT_MCK)
                                         ^
C:\Users\Zawi\Documents\Arduino\libraries\NeoPixelBus_by_Makuna\src/internal/NeoArmMethod.h:717:41: note: in definition of macro 'ARM_OTHER_INST'
 #define ARM_OTHER_INST   (2UL * F_CPU / VARIANT_MCK)
                                         ^~~~~~~~~~~
C:\Users\Zawi\Documents\Arduino\libraries\NeoPixelBus_by_Makuna\src/internal/NeoArmMethod.h: In static member function 'static void NeoArmOtherSpeedBase<T_SPEEDPROPS>::send_pixels(uint8_t*, size_t, uint8_t)':
C:\Users\Zawi\Documents\Arduino\libraries\NeoPixelBus_by_Makuna\src/internal/NeoArmMethod.h:775:9: error: 'Pio' was not declared in this scope
         Pio* port;
         ^~~
C:\Users\Zawi\Documents\Arduino\libraries\NeoPixelBus_by_Makuna\src/internal/NeoArmMethod.h:775:14: error: 'port' was not declared in this scope
         Pio* port;
              ^~~~
C:\Users\Zawi\Documents\Arduino\libraries\NeoPixelBus_by_Makuna\src/internal/NeoArmMethod.h:775:14: note: suggested alternative: 'port_s'
         Pio* port;
              ^~~~
              port_s
C:\Users\Zawi\Documents\Arduino\libraries\NeoPixelBus_by_Makuna\src/internal/NeoArmMethod.h:776:18: error: 'WoReg' does not name a type
         volatile WoReg* portSet;
                  ^~~~~
C:\Users\Zawi\Documents\Arduino\libraries\NeoPixelBus_by_Makuna\src/internal/NeoArmMethod.h:777:18: error: 'WoReg' does not name a type
         volatile WoReg* portClear;
                  ^~~~~
C:\Users\Zawi\Documents\Arduino\libraries\NeoPixelBus_by_Makuna\src/internal/NeoArmMethod.h:778:18: error: 'WoReg' does not name a type
         volatile WoReg* timeValue;
                  ^~~~~
C:\Users\Zawi\Documents\Arduino\libraries\NeoPixelBus_by_Makuna\src/internal/NeoArmMethod.h:779:18: error: 'WoReg' does not name a type
         volatile WoReg* timeReset;
                  ^~~~~
C:\Users\Zawi\Documents\Arduino\libraries\NeoPixelBus_by_Makuna\src/internal/NeoArmMethod.h:785:9: error: there are no arguments to 'pmc_set_writeprotect' that depend on a template parameter, so a declaration of 'pmc_set_writeprotect' must be available [-fpermissive]
         pmc_set_writeprotect(false);
         ^~~~~~~~~~~~~~~~~~~~
C:\Users\Zawi\Documents\Arduino\libraries\NeoPixelBus_by_Makuna\src/internal/NeoArmMethod.h:785:9: note: (if you use '-fpermissive', G++ will accept your code, but allowing the use of an undeclared name is deprecated)
C:\Users\Zawi\Documents\Arduino\libraries\NeoPixelBus_by_Makuna\src/internal/NeoArmMethod.h:786:53: error: 'TC3_IRQn' was not declared in this scope
         pmc_enable_periph_clk(static_cast<uint32_t>(TC3_IRQn));
                                                     ^~~~~~~~
C:\Users\Zawi\Documents\Arduino\libraries\NeoPixelBus_by_Makuna\src/internal/NeoArmMethod.h:786:53: note: suggested alternative: 'ECC_IRQn'
         pmc_enable_periph_clk(static_cast<uint32_t>(TC3_IRQn));
                                                     ^~~~~~~~
                                                     ECC_IRQn
C:\Users\Zawi\Documents\Arduino\libraries\NeoPixelBus_by_Makuna\src/internal/NeoArmMethod.h:786:9: error: there are no arguments to 'pmc_enable_periph_clk' that depend on a template parameter, so a declaration of 'pmc_enable_periph_clk' must be available [-fpermissive]
         pmc_enable_periph_clk(static_cast<uint32_t>(TC3_IRQn));
         ^~~~~~~~~~~~~~~~~~~~~
C:\Users\Zawi\Documents\Arduino\libraries\NeoPixelBus_by_Makuna\src/internal/NeoArmMethod.h:788:22: error: 'TC1' was not declared in this scope
         TC_Configure(TC1, 0,
                      ^~~
C:\Users\Zawi\Documents\Arduino\libraries\NeoPixelBus_by_Makuna\src/internal/NeoArmMethod.h:789:13: error: 'TC_CMR_WAVE' was not declared in this scope
             TC_CMR_WAVE | TC_CMR_WAVSEL_UP | TC_CMR_TCCLKS_TIMER_CLOCK1);
             ^~~~~~~~~~~
C:\Users\Zawi\Documents\Arduino\libraries\NeoPixelBus_by_Makuna\src/internal/NeoArmMethod.h:789:13: note: suggested alternative: 'RTC_CR_WUTE'
             TC_CMR_WAVE | TC_CMR_WAVSEL_UP | TC_CMR_TCCLKS_TIMER_CLOCK1);
             ^~~~~~~~~~~
             RTC_CR_WUTE
C:\Users\Zawi\Documents\Arduino\libraries\NeoPixelBus_by_Makuna\src/internal/NeoArmMethod.h:789:27: error: 'TC_CMR_WAVSEL_UP' was not declared in this scope
             TC_CMR_WAVE | TC_CMR_WAVSEL_UP | TC_CMR_TCCLKS_TIMER_CLOCK1);
                           ^~~~~~~~~~~~~~~~
C:\Users\Zawi\Documents\Arduino\libraries\NeoPixelBus_by_Makuna\src/internal/NeoArmMethod.h:789:27: note: suggested alternative: 'RTC_CR_OSEL_0'
             TC_CMR_WAVE | TC_CMR_WAVSEL_UP | TC_CMR_TCCLKS_TIMER_CLOCK1);
                           ^~~~~~~~~~~~~~~~
                           RTC_CR_OSEL_0
C:\Users\Zawi\Documents\Arduino\libraries\NeoPixelBus_by_Makuna\src/internal/NeoArmMethod.h:789:46: error: 'TC_CMR_TCCLKS_TIMER_CLOCK1' was not declared in this scope
             TC_CMR_WAVE | TC_CMR_WAVSEL_UP | TC_CMR_TCCLKS_TIMER_CLOCK1);
                                              ^~~~~~~~~~~~~~~~~~~~~~~~~~
C:\Users\Zawi\Documents\Arduino\libraries\NeoPixelBus_by_Makuna\src/internal/NeoArmMethod.h:788:9: error: there are no arguments to 'TC_Configure' that depend on a template parameter, so a declaration of 'TC_Configure' must be available [-fpermissive]
         TC_Configure(TC1, 0,
         ^~~~~~~~~~~~
C:\Users\Zawi\Documents\Arduino\libraries\NeoPixelBus_by_Makuna\src/internal/NeoArmMethod.h:790:9: error: there are no arguments to 'TC_Start' that depend on a template parameter, so a declaration of 'TC_Start' must be available [-fpermissive]
         TC_Start(TC1, 0);
         ^~~~~~~~
C:\Users\Zawi\Documents\Arduino\libraries\NeoPixelBus_by_Makuna\src/internal/NeoArmMethod.h:794:9: error: 'portSet' was not declared in this scope
         portSet = &(port->PIO_SODR);            // burn a few cycles after
         ^~~~~~~
C:\Users\Zawi\Documents\Arduino\libraries\NeoPixelBus_by_Makuna\src/internal/NeoArmMethod.h:794:9: note: suggested alternative: 'port_s'
         portSet = &(port->PIO_SODR);            // burn a few cycles after
         ^~~~~~~
         port_s
C:\Users\Zawi\Documents\Arduino\libraries\NeoPixelBus_by_Makuna\src/internal/NeoArmMethod.h:795:9: error: 'portClear' was not declared in this scope
         portClear = &(port->PIO_CODR);            // starting timer to minimize
         ^~~~~~~~~
C:\Users\Zawi\Documents\Arduino\libraries\NeoPixelBus_by_Makuna\src/internal/NeoArmMethod.h:795:9: note: suggested alternative: 'bitClear'
         portClear = &(port->PIO_CODR);            // starting timer to minimize
         ^~~~~~~~~
         bitClear
C:\Users\Zawi\Documents\Arduino\libraries\NeoPixelBus_by_Makuna\src/internal/NeoArmMethod.h:796:9: error: 'timeValue' was not declared in this scope
         timeValue = &(TC1->TC_CHANNEL[0].TC_CV);  // the initial 'while'.
         ^~~~~~~~~
C:\Users\Zawi\Documents\Arduino\libraries\NeoPixelBus_by_Makuna\src/internal/NeoArmMethod.h:796:9: note: suggested alternative: 'timeval'
         timeValue = &(TC1->TC_CHANNEL[0].TC_CV);  // the initial 'while'.
         ^~~~~~~~~
         timeval
C:\Users\Zawi\Documents\Arduino\libraries\NeoPixelBus_by_Makuna\src/internal/NeoArmMethod.h:797:9: error: 'timeReset' was not declared in this scope
         timeReset = &(TC1->TC_CHANNEL[0].TC_CCR);
         ^~~~~~~~~
C:\Users\Zawi\Documents\Arduino\libraries\NeoPixelBus_by_Makuna\src/internal/NeoArmMethod.h:797:9: note: suggested alternative: 'timerisset'
         timeReset = &(TC1->TC_CHANNEL[0].TC_CCR);
         ^~~~~~~~~
         timerisset
C:\Users\Zawi\Documents\Arduino\libraries\NeoPixelBus_by_Makuna\src/internal/NeoArmMethod.h:818:26: error: 'TC_CCR_CLKEN' was not declared in this scope
             *timeReset = TC_CCR_CLKEN | TC_CCR_SWTRG;
                          ^~~~~~~~~~~~
C:\Users\Zawi\Documents\Arduino\libraries\NeoPixelBus_by_Makuna\src/internal/NeoArmMethod.h:818:26: note: suggested alternative: 'FMC_PCR_PBKEN'
             *timeReset = TC_CCR_CLKEN | TC_CCR_SWTRG;
                          ^~~~~~~~~~~~
                          FMC_PCR_PBKEN
C:\Users\Zawi\Documents\Arduino\libraries\NeoPixelBus_by_Makuna\src/internal/NeoArmMethod.h:818:41: error: 'TC_CCR_SWTRG' was not declared in this scope
             *timeReset = TC_CCR_CLKEN | TC_CCR_SWTRG;
                                         ^~~~~~~~~~~~
C:\Users\Zawi\Documents\Arduino\libraries\NeoPixelBus_by_Makuna\src/internal/NeoArmMethod.h:818:41: note: suggested alternative: 'RTC_CR_ITSE'
             *timeReset = TC_CCR_CLKEN | TC_CCR_SWTRG;
                                         ^~~~~~~~~~~~
                                         RTC_CR_ITSE
C:\Users\Zawi\Documents\Arduino\libraries\NeoPixelBus_by_Makuna\src/internal/NeoArmMethod.h:838:9: error: there are no arguments to 'TC_Stop' that depend on a template parameter, so a declaration of 'TC_Stop' must be available [-fpermissive]
         TC_Stop(TC1, 0);
         ^~~~~~~
C:\Users\Zawi\Documents\Arduino\libraries\NeoPixelBus_by_Makuna\src/internal/NeoArmMethod.h: In instantiation of 'static void NeoArmOtherSpeedBase<T_SPEEDPROPS>::send_pixels(uint8_t*, size_t, uint8_t) [with T_SPEEDPROPS = NeoArmOtherSpeedPropsWs2812x; uint8_t = unsigned char; size_t = unsigned int]':
C:\Users\Zawi\Documents\Arduino\libraries\NeoPixelBus_by_Makuna\src/internal/NeoArmMethod.h:86:29:   required from 'void NeoArmMethodBase<T_SPEED>::Update(bool) [with T_SPEED = NeoArmOtherSpeedBase<NeoArmOtherSpeedPropsWs2812x>]'
C:\Users\Zawi\Documents\Arduino\libraries\NeoPixelBus_by_Makuna\src/NeoPixelBus.h:204:9:   required from 'void NeoPixelBus<T_COLOR_FEATURE, T_METHOD>::Show(bool) [with T_COLOR_FEATURE = NeoGrbFeature; T_METHOD = NeoArmMethodBase<NeoArmOtherSpeedBase<NeoArmOtherSpeedPropsWs2812x> >]'
C:\Users\Zawi\AppData\Local\Temp\.arduinoIDE-unsaved2023217-11284-dmqcy5.tn49g\NeoPixelTest\NeoPixelTest.ino:76:16:   required from here
C:\Users\Zawi\Documents\Arduino\libraries\NeoPixelBus_by_Makuna\src/internal/NeoArmMethod.h:785:29: error: 'pmc_set_writeprotect' was not declared in this scope
         pmc_set_writeprotect(false);
         ~~~~~~~~~~~~~~~~~~~~^~~~~~~
C:\Users\Zawi\Documents\Arduino\libraries\NeoPixelBus_by_Makuna\src/internal/NeoArmMethod.h:786:62: error: 'pmc_enable_periph_clk' was not declared in this scope
         pmc_enable_periph_clk(static_cast<uint32_t>(TC3_IRQn));
                                                              ^
C:\Users\Zawi\Documents\Arduino\libraries\NeoPixelBus_by_Makuna\src/internal/NeoArmMethod.h:789:72: error: 'TC_Configure' was not declared in this scope
             TC_CMR_WAVE | TC_CMR_WAVSEL_UP | TC_CMR_TCCLKS_TIMER_CLOCK1);
                                                                        ^
C:\Users\Zawi\Documents\Arduino\libraries\NeoPixelBus_by_Makuna\src/internal/NeoArmMethod.h:789:72: note: suggested alternative: 'LL_RCC_ConfigMCO'
             TC_CMR_WAVE | TC_CMR_WAVSEL_UP | TC_CMR_TCCLKS_TIMER_CLOCK1);
                                                                        ^
                                                                        LL_RCC_ConfigMCO
C:\Users\Zawi\Documents\Arduino\libraries\NeoPixelBus_by_Makuna\src/internal/NeoArmMethod.h:790:17: error: 'TC_Start' was not declared in this scope
         TC_Start(TC1, 0);
         ~~~~~~~~^~~~~~~~
C:\Users\Zawi\Documents\Arduino\libraries\NeoPixelBus_by_Makuna\src/internal/NeoArmMethod.h:792:42: error: invalid use of incomplete type 'PinDescription {aka struct _PinDescription}'
         pinMask = g_APinDescription[pin].ulPin; // Don't 'optimize' these into
In file included from C:\Users\Zawi\AppData\Local\Temp\arduino\sketches\86849B9DC7C81C13353F1F2E6BA3EF8E\sketch\NeoPixelTest.ino.cpp:1:0:
C:\Users\Zawi\AppData\Local\Arduino15\packages\arduino\hardware\mbed_giga\4.0.2\cores\arduino/Arduino.h:80:16: note: forward declaration of 'PinDescription {aka struct _PinDescription}'
 typedef struct _PinDescription PinDescription;
                ^~~~~~~~~~~~~~~
In file included from C:\Users\Zawi\Documents\Arduino\libraries\NeoPixelBus_by_Makuna\src/NeoPixelBus.h:108:0,
                 from C:\Users\Zawi\AppData\Local\Temp\.arduinoIDE-unsaved2023217-11284-dmqcy5.tn49g\NeoPixelTest\NeoPixelTest.ino:14:
C:\Users\Zawi\Documents\Arduino\libraries\NeoPixelBus_by_Makuna\src/internal/NeoArmMethod.h:793:39: error: invalid use of incomplete type 'PinDescription {aka struct _PinDescription}'
         port = g_APinDescription[pin].pPort; // declarations above.  Want to
In file included from C:\Users\Zawi\AppData\Local\Temp\arduino\sketches\86849B9DC7C81C13353F1F2E6BA3EF8E\sketch\NeoPixelTest.ino.cpp:1:0:
C:\Users\Zawi\AppData\Local\Arduino15\packages\arduino\hardware\mbed_giga\4.0.2\cores\arduino/Arduino.h:80:16: note: forward declaration of 'PinDescription {aka struct _PinDescription}'
 typedef struct _PinDescription PinDescription;
                ^~~~~~~~~~~~~~~
In file included from C:\Users\Zawi\Documents\Arduino\libraries\NeoPixelBus_by_Makuna\src/NeoPixelBus.h:108:0,
                 from C:\Users\Zawi\AppData\Local\Temp\.arduinoIDE-unsaved2023217-11284-dmqcy5.tn49g\NeoPixelTest\NeoPixelTest.ino:14:
C:\Users\Zawi\Documents\Arduino\libraries\NeoPixelBus_by_Makuna\src/internal/NeoArmMethod.h:838:16: error: 'TC_Stop' was not declared in this scope
         TC_Stop(TC1, 0);
         ~~~~~~~^~~~~~~~

exit status 1

Compilation error: exit status 1

Is there any way to interact with the LED strip using the Arduino giga or will I have to do it through an UNO?

I think it can be done, but clearly none of the libraries are compatible.
With the 1st there is some difference with a few of the definitions i dunno, something with the interrupts vectors and something with the DMA, you may get lucky if you open an issue on github about it.
The core that you use seems to not have the same macros defined as the other ARM cores, not even F_CPU ?
Well that complicates matters.
The simplest way of doing it i guess would be to do it manually using the UART.
The UART method of neopixelbus sends 2 bits of every 24-bit RGB (or 32-bit RGBW) value as 1 6-bit byte + 1 start-bit + 1 stop-bit, at 3.2Mbps. So Serial config 6N1, those are 8 bits. every 4 bits represent 1 data bit,

1110 == 1
1100 == 0  // i think, check the ws2812 data sheet for the timing limits.

Create a buffer that is big enough (4 x dataBytes) and convert the color data into the output data.
Paul Stoffregen's library does the same thing but uses 4Mbps and 8N1 to create the signal, it shouldn't be to hard to re-create their work outside of their library, without all of the board specific definitions, which clearly are not compatible with your core. You can probably just manually send the signal rather than using a timer or an interrupt to do this. Anyway, this may be beyond the scope of the project, and there may be a simpler solution.

As the Giga is a 3V3 processor, then it only produces 3V3 signals. This means that when you get a library to compile then you will need to either:-

  1. Run your WS2812 LEDs from a 3V3 supply.
    Or
  2. Have a chip boost the 3V3 signal to 5V. I use the 74HCT14. Say if you want a schematic of how to wire it up.

Is boosting the signal only half of the problem? or is there a hat or external chip that can convert the instructions from the giga to instructions that the ws2812 LED's can understand? Or is the simplest way just having the UNO as a separate controller for just the LED strip maybe connected through the serial connectors(i am also new to connecting Arduinos together but I have been told that it can be done)

Yes, it the problem that you will face once you have got something to compile.

I very much doubt that.

It is seldom a good idea to use two Arduinos in a project when one will do.

In your case the simplest way to get the code to work is to use not WS2812 LED strip but DotStars, as Adafruit call them, or LPD8806 as they are known as. These have two inputs a data and a clock. This means you can program them without any libraries and just "bit bang" the protocol in normal code. This is possible because they are not tied to the strict timing protocol of the WS2812, but to a sequence of clock and data signals. I can also give you examples of this if you are willing to swap over your LED strips.

I have seen some dot star compatible led strips (Flexible RGB LED Strip (DotStar/APA102/SK9822 Compatible) - 144 LED/Metre | The Pi Hut) but they all still mention the FastLED library. I would like the examples and i assume that the dot starts use a different library?

OK, I looked up the Bit banging for the APA102 and found I had only written one in Python, so I set about converting it to C and ran into difficulties making it work on a Uno. I have been trying for the last couple of days but I am getting nowhere at the moment. All the waveforms look right but only one LED blinks on a strip.

However I have come across a library that might work for you on your processor:-

and

Can you see if these work with your processor and report back. Only use the latter if you have no APA102 strips at the moment.

I was under the impression you could even use hw SPI.

That is disappointing, it shouldn't be to complicated for me to understand, can you share what you've done ?

That should do the trick, Looking at the .h & .c files i can not see any objections for the compiler, Maybe the speed should be reduced a tad with a 480MHz clock frequency, but that should be easy enough.

I tried that library and dont know if it will work on my cpu because it is asking for other files that i cant find the downloads to on the internet. The three files were:

#include <util/delay.h>
#include <avr/io.h>
#include <avr/interrupt.h>

I noticed on the github that there was an ARM version of the library but it required me to add in my own parameters for the CPU. This was what it(light_ws2812/light_ws2812_ARM at master · cpldcpu/light_ws2812 · GitHub) was asking for:

  • Add "light_ws2812_cortex.c" and "light_ws2812_cortex.h" to your project.
  • Make sure optimizations are enabled in the compiler.
  • Change i/o pin settings according to the I/O pin you are using:
    • Define LIGHT_WS2812_GPIO_PIN=XXX
    • Define LIGHT_WS2812_GPIO_PORT=XXX
  • Add the correct CMSIS include for your CPU:
    • Define LIGHT_WS2812_UC_LPC8XX, LIGHT_WS2812_UC_STM32L0XX or add your CPU in "light_ws2812_cortex.h"
  • Set F_CPU to your CPU core clock.
  • Set code memory wait states to zero. Important: The library will not work if there are one or more code memory waitstate cycles. This may limit your code clock to 30 Mhz or lower on most Cortex-M0 controllers.
  • Call "ws2812_sendarray" with a pointer to your LED data and the number of bytes to transmit. Each LED receives 3 bytes in Green-Red-Blue order. Therefore the total number of bytes should be three times the number of LEDs in the chain.
  • Wait for at least 50 us before the next LED update to reset the chain.
    And this was a far as I got:
#include <light_ws2812_cortex.h>
#define LIGHT_WS2812_GPIO_PIN=4
#define LIGHT_WS2812_GPIO_PORT=4

F_CPU = 480;

I'm not sure what I need to do or have done wrong because I am not used to working close to CPU level hardware. Hope this helps

EDIT - Code updated 22nd March 2023 to correct problem with green when the value is 0x80 and over.

OK managed to get my APA102 bit banging code going here it is:-

// Bit banging a DotStar/APA102/SK9822
// By Mike Cook - in public domain March 2023
 
const int8_t numLeds = 24; // Change to how many LEDs you have
uint32_t ledArray[numLeds]; // buffer to hold LED data
int8_t dataPin = 6 ; // Change to the pin you want to use
int8_t clockPin = 5 ; // Change to the pin you want to use
uint8_t bright;  // default brightness use function to change this

void setup() {
  pinMode(dataPin, OUTPUT);
  pinMode(clockPin, OUTPUT); 
  setBright(8); // brightness for LEDs
  for(int i=0; i< numLeds; i++){ // initialise LED brightness
    ledArray[i] = (int32_t)bright << 24;  
  }
  wipe(0, 0, 0); // turn all LEDs off
}

void loop() {
  wipeColours(3);
  runRound(2, 6, 7, 0); // change the colour here  
}
//////////// Example colour effects //////////
void runRound(uint16_t n, uint8_t r, uint8_t g, uint8_t b){
   wipe(0, 0, 0); // turn all LEDs off
   for(int i=0; i<n; i++){
      for(int j=0; j< numLeds; j++) {
         setPixelColour(j, r, g, b);
         pixelsShow();
         delay(100);
      }
     delay(1000);
     wipe(0,0,0); 
   }
}

void wipeColours(uint16_t n){
  for(int i=0; i<n; i++){
  wipe(0x5, 0x5, 0x5);
  delay(200);
  wipe(0x5, 0x0, 0x0);
  delay(200);
 wipe(0x0, 0x5, 0x0);
  delay(200);
  wipe(0x0, 0x0, 0x0);
  delay(200);
  wipe(0, 0, 0);
  //pixelsShow();
  delay(800);
  }
}

//////////// LED colour manipulation functions //////
void setBright(uint8_t val){ // set brightness from 0 to 31
  if(val > 31) val = 31;
  if(val < 0 ) val = 0;
  bright = val | 0xE0;
}

void wipe(uint8_t r, uint8_t g, uint8_t b){ // set all colours the same and show
  for(int i=0; i< numLeds; i++){
    setPixelColour(i, r, g, b);
  }
  pixelsShow();
}

void setPixelColour(uint16_t num, uint8_t r, uint8_t g, uint8_t b){
  if(num < numLeds && num >= 0){
    //Serial.print("setting colours ");
    //Serial.println(num);
    ledArray[num] = (uint32_t)bright<<24 | (uint32_t)b<<16 | (uint16_t)(g<<8) | r ;
    //Serial.println(ledArray[num], HEX);
  }
}

//////////// Data transfer functions /////////
void pixelsShow(){ // send buffer to the hardware
  uint32_t data = 0;
  uint32_t mask = 0;
  sendHeader();
  // for(int i=0; i<numLeds; i++){
  for(int i=0; i<numLeds; i++){  
    data = ledArray[i];
    mask = 0x80000000;
    for(int j=0; j<32; j++){ // output the LED data
       digitalWrite(clockPin, LOW);
       if(data & mask) {
          digitalWrite(dataPin, HIGH);
     }
     else {
         digitalWrite(dataPin, LOW);
     }
     mask = mask >> 1;
     digitalWrite(clockPin, HIGH);   
   }
  }      
sendFooter();
digitalWrite(dataPin, LOW);
}

void sendHeader(){
digitalWrite(dataPin, LOW); // set data pin low
for(int i = 0; i< 32; i++){
  digitalWrite(clockPin, LOW); // pulse the clock pin
  digitalWrite(clockPin, HIGH);
   }
}
  
void sendFooter(){
  digitalWrite(dataPin, HIGH);
  for(int i = 0; i< 1 + numLeds>>1; i++){  
     digitalWrite(clockPin, LOW);
     digitalWrite(clockPin, HIGH);
  }
  digitalWrite(dataPin, LOW);
}

It only uses digital write functions so should work on any Arduino board. Nothing special needed. It will also work on any two output pins. I tested it on the Uno. By using digital write it should work on much faster processors because there are about 64 instructions in a digital write. It also worked when I changed the digital write to port manipulation instructions, so it should work on a much faster processor. The examples are the normal blocking code stuff, but if you want anything fancy you can always implement a state machine.

On a 3V3 system you might need this level shifter and external supply but try it without first.

Yes but I wanted to keep the code as processor agnostic as possible.

Thanks for the offer but as you see it is working now. My problem is described and solved in this post:-

Well the digital write slows anything down a great deal and the strips can cope with quite a high frequency.

1 Like

That was the issue ? Bitwise operations are at the top of the table, and are performed first, and the type of the value is used until cast, yes.

Yes they should be able to, when the wires to the strip get a little longer, maybe issues show up, i haven't checked the datasheet, but if it's really 64 clock-cycles i guess it should be fine. Great work !!

Yes, once this was sorted out the conversion from Python I had done worked. The thing was the brightness and the blue value were not being shifted correctly and so some of the led information in memory was missing. I had tried various different casting but never hit on the right one, so I thought it best to ask. I am more of a hardware person than software one.

Thanks.

So which is the library that i should use for the APA102 leds? The ones I was sent included AVR names and no reference to ARM and i thought that it would cause issues?