Problem with Glediator

Hi all! This is my first post on the forum, so, hurrah, I guess..?
Anyway, I've connected an LED matrix up with my Arduino and set it up so it works with Glediator.
The problem being, any time I click "Serial Open," the Arduino disconnects.
Would this be a problem with the code I'm using? (Here's the code being used, using directly from Glediator download website)

#define DATA_PORT          PORTD
#define DATA_DDR           DDRD						
#define DATA_PIN           6							
#define NUMBER_OF_PIXELS   256

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

volatile unsigned char go = 0;

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();
}


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

ISR(USART_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;}
}

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)
    );
  }

}

Hi,
What is Glediator?

Can you explain what it does and post a link to specs/data etc.

Opening the serial monitor will cause the Arduino to reset.
This has to do with the same serial port being used for programming the Arduino.

The only other way is to use a Software Serial and use pins other than the hardware TX and RX pins for your serial monitor.
What model Arduino Are you using?
Some have more than one UART port.

Thanks.. Tom. :slight_smile:

Hi Tom, thanks for the response!
Glediator stands for Graphical LED Installation AnimaTOR and is a small piece of software to control led matrix and led stripe installations. You can see more about it here.

I do believe I'm using some version of the Arduino Uno, but I'm not entirely sure if it's the original, rev2, or rev3. (I found it sitting in my room somewhere from an old project I did. It just says "Uno" and doesn't seem to have the Arduino logo on it.)

Thanks,
Al.

What is Glediator?

A piece of crap that dosn't actually work fully. It has a lot of options and most are not implemented. If you choose one of the options that hasn't been implemented you don't see any error message or anything, it just dosn't work.