Arduino Mega + Jinx not working (

how to make jinx work on arduino mega?
I have a Chinese version, it does not work on it.. I saw messages where reset-en is torn, I don't have such a thing on the board, what problems can there be?
People work with 22 pins, and 0 is displayed in the sketch.
I have 390 diodes.

//##############################################################################
//##############################################################################
//                                                                             #
// Glediator to WS2812 pixel converter                                         #
// by R. Heller                                                                #
// V 1.0 - 07.01.2014                                                          #            
// wwww.SolderLab.de                                                           #
//                                                                             #
// Receives serial data in Glediator protocol format @ 1 MBit/s                #
// and distributes it to a connectect chain of WS2812 pixels                   #
//                                                                             #
// Adjust the correct DATA PIN and the correct NUMBER OF PIXELS you are using  # 
// in the definitions section below before uploading this sketch to your       #
// Arduino device.                                                             #
//                                                                             #
// Maxiumim number of supported pixeles is 512 !!!                             #
//                                                                             #
// In the Glediator software set output mode to "Glediator_Protocol",          #
// color order to "GRB" and baud rate to "1000000"                             #
//                                                                             #
//##############################################################################
//##############################################################################


//##############################################################################
//                                                                             #
// Definitions --> Make changes ONLY HERE                                      #
//                                                                             #
// To find out the correct port, ddr and pin name when you just know the       #
// Arduino's digital pin number just google for "Arduino pin mapping".         #
// In the present example digital Pin 6 is used which corresponds to "PORTD",  #
// "DDRD" and "6", respectively.                                               #
//                                                                             #
//##############################################################################

#define DATA_PORT          PORTA
#define DATA_DDR           DDRA
#define DATA_PIN           0 //This relates to PDA0 (PIN 22 on the Mega 2560)
#define NUMBER_OF_PIXELS   390


//##############################################################################
//                                                                             #
// Variables                                                                   #
//                                                                             #
//##############################################################################

unsigned char display_buffer[NUMBER_OF_PIXELS * 3];
static unsigned char *ptr;
static unsigned int pos = 0;

boolean go = 0;


//##############################################################################
//                                                                             #
// Setup                                                                       #
//                                                                             #
//##############################################################################

void setup()
{
  // Set data pin as output
  DATA_DDR |= (1<<DATA_PIN);

  
  // Initialize UART
  UCSR0A |= (1<<U2X0);                                
  UCSR0B |= (1<<RXEN0)  | (1<<TXEN0) | (1<<RXCIE0);   
  UCSR0C |= (1<<UCSZ01) | (1<<UCSZ00)             ; 
  UBRR0H = 0;
  UBRR0L = 1; //Baud Rate 1 MBit (at F_CPU = 16MHz)
  
  ptr=display_buffer;
  
  //Enable global interrupts
  sei();
}


//##############################################################################
//                                                                             #
// Main loop                                                                   #
//                                                                             #
//##############################################################################

void loop()
{   
  if (go==1) 
  {
    cli();
    ws2812_sendarray(display_buffer, NUMBER_OF_PIXELS * 3); 
    sei();
    go=0;
  }
}


//##############################################################################
//                                                                             #
// UART-Interrupt-Prozedur (called every time one byte is compeltely received) #
//                                                                             #
//##############################################################################

ISR(USART0_RX_vect) 
{
  unsigned char b;
  b=UDR0;
  
  if (b == 1)  {pos=0; ptr=display_buffer; return;}    
  if (pos == (NUMBER_OF_PIXELS*3)) {} else {*ptr=b; ptr++; pos++;}  
  if (pos == ((NUMBER_OF_PIXELS*3)-1)) {go=1;}
}


//##############################################################################
//                                                                             #
// WS2812 output routine                                                       #
// Extracted from a ligh weight WS2812 lib by Tim (cpldcpu@gmail.com)          #
// Found on wwww.microcontroller.net                                           #
// Requires F_CPU = 16MHz                                                      #
//                                                                             #
//##############################################################################

void ws2812_sendarray(uint8_t *data,uint16_t datlen)
{
  uint8_t curbyte,ctr,masklo;
  uint8_t maskhi = _BV(DATA_PIN);
  masklo =~ maskhi & DATA_PORT;
  maskhi |= DATA_PORT;

  while (datlen--) 
  {
    curbyte = *data++;

    asm volatile
    (
      " ldi %0,8 \n\t" // 0
      "loop%=:out %2, %3 \n\t" // 1
      "lsl %1 \n\t" // 2
      "dec %0 \n\t" // 3
      " rjmp .+0 \n\t" // 5
      " brcs .+2 \n\t" // 6l / 7h
      " out %2,%4 \n\t" // 7l / -
      " rjmp .+0 \n\t" // 9
      " nop \n\t" // 10
      " out %2,%4 \n\t" // 11
      " breq end%= \n\t" // 12      nt. 13 taken
      " rjmp .+0 \n\t" // 14
      " rjmp .+0 \n\t" // 16
      " rjmp .+0 \n\t" // 18
      " rjmp loop%= \n\t" // 20
      "end%=: \n\t" 
      : "=&d" (ctr)
      : "r" (curbyte), "I" (_SFR_IO_ADDR(DATA_PORT)), "r" (maskhi), "r" (masklo)
    );
  }

}


//##############################################################################
//                                                                             #
// End of program                                                              #
//                                                                             #
//##############################################################################

?

Please read and follow this link: How to get the best out of this forum - Using Arduino / Project Guidance - Arduino Forum

or keep on waiting.

A link to that "jinx" may help.

A description of what "does not work" exactly means would help too. Have you tried the LED section without the reception over the serial interface?

390 LEDs is quite a lot. How do you power that? You must have several injection points or fat copper wires.

schematic, power supply configuration ?

One obvious thing is go should be declared with the volatile keyword.

I have a garland for 3 windows that stand side by side, each window has 130 10x13 diodes, as a result, the entire matrix is 30x13.
All sections of diodes work perfectly with other projects on the same arduino.
Every 5 meters of tape are powered in parallel by a thick wire. The tape power supply is 5 volts 10 amps, arduino is powered by a USB computer.

it`s other project as example:

it's hard for me to figure it out yet :thinking:

Two points.

Your LEDs must share 0V ground with the Arduino, and the high-current to the supply should be injected at multiple points along the strip (say every 50 pixels) to spread the current across the LED tracks.

yes, It’s correct to inject the LED data in at only one end of the strip.

Sorry, I made a mistake in the picture when I drew, of course I have 0 arduino connected to the tape as well. Otherwise, other projects would not work. And for every 50 diodes, the power is duplicated

390 LED at full brightness draw almost 25A.

I have a power supply on the 40A, I connected it, that's not the point. All other sketch programs work perfectly for 10 amperes with a margin and the power supply is cold since they do not burn constantly and not all at once, but there is practically no white!
Here it is about the sketch itself or in Arduino

Why do you use some assembler code? Do you know FastLED?

I have a FastLED library connected

But you're not using it. Why?

I use a ready-made sketch that works on arduino uno, nano, but doesn't work on mega, sketch worker, I wanted to figure out why it doesn't work on mega, I'm not good at libraries (

The UNO and the Nano use an ATmega328p but the Mega2560 uses an ATmega2560. There are many ways an assembler code for the ATmega328 may fail on an ATmega2560 even though the use the same instruction set.
I don't debug assembler code if there is a working alternative library.

can you help with the code for mega? or how to use the library to work and transfer videos from glediator or jinx to the matrix?

If the code of post #1 implements this, it's quite easy. And if you use the SPI hardware you're probably even faster than the code you used.