New P2, 1/32 Scan, 64*64, Led panel with different IC chip controller

Dear Pinsball,

Thank you very much for your response. I am using STM32F103VET6 running at 72MHz, and I indeed added some NOPS() both between Clock high/low, and Latch high/low. Below is my piece of code, sorry I didn’t use macro definitions so it is kind of messy.

int main (void) {
  
  Bsp_Init();
  
  LL_APBx_EnableClock(GPIOD);
  LL_APBx_EnableClock(GPIOE);
  
  LL_GPIO_SetPinMode(GPIOC, LL_GPIO_PIN_6, LL_GPIO_MODE_OUTPUT);
  LL_GPIO_SetPinSpeed(GPIOC, LL_GPIO_PIN_6, LL_GPIO_SPEED_FREQ_HIGH);
  
  LL_GPIO_SetPinMode(GPIOD, LL_GPIO_PIN_0, LL_GPIO_MODE_OUTPUT);
  LL_GPIO_SetPinMode(GPIOD, LL_GPIO_PIN_1, LL_GPIO_MODE_OUTPUT);
  LL_GPIO_SetPinMode(GPIOD, LL_GPIO_PIN_2, LL_GPIO_MODE_OUTPUT);
  LL_GPIO_SetPinMode(GPIOD, LL_GPIO_PIN_3, LL_GPIO_MODE_OUTPUT);
  LL_GPIO_SetPinMode(GPIOD, LL_GPIO_PIN_4, LL_GPIO_MODE_OUTPUT);
  LL_GPIO_SetPinMode(GPIOD, LL_GPIO_PIN_5, LL_GPIO_MODE_OUTPUT);
  LL_GPIO_SetPinMode(GPIOD, LL_GPIO_PIN_6, LL_GPIO_MODE_OUTPUT);
  
  LL_GPIO_SetPinSpeed(GPIOD, LL_GPIO_PIN_0, LL_GPIO_SPEED_FREQ_HIGH);
  LL_GPIO_SetPinSpeed(GPIOD, LL_GPIO_PIN_1, LL_GPIO_SPEED_FREQ_HIGH);
  LL_GPIO_SetPinSpeed(GPIOD, LL_GPIO_PIN_2, LL_GPIO_SPEED_FREQ_HIGH);
  LL_GPIO_SetPinSpeed(GPIOD, LL_GPIO_PIN_3, LL_GPIO_SPEED_FREQ_HIGH);
  LL_GPIO_SetPinSpeed(GPIOD, LL_GPIO_PIN_4, LL_GPIO_SPEED_FREQ_HIGH);
  LL_GPIO_SetPinSpeed(GPIOD, LL_GPIO_PIN_5, LL_GPIO_SPEED_FREQ_HIGH);
  LL_GPIO_SetPinSpeed(GPIOD, LL_GPIO_PIN_6, LL_GPIO_SPEED_FREQ_HIGH);
  
  /*---------------------------*/
  
  LL_GPIO_SetPinMode(GPIOE, LL_GPIO_PIN_0, LL_GPIO_MODE_OUTPUT);
  LL_GPIO_SetPinMode(GPIOE, LL_GPIO_PIN_1, LL_GPIO_MODE_OUTPUT);
  LL_GPIO_SetPinMode(GPIOE, LL_GPIO_PIN_2, LL_GPIO_MODE_OUTPUT);
  LL_GPIO_SetPinMode(GPIOE, LL_GPIO_PIN_3, LL_GPIO_MODE_OUTPUT);
  LL_GPIO_SetPinMode(GPIOE, LL_GPIO_PIN_4, LL_GPIO_MODE_OUTPUT);
  LL_GPIO_SetPinMode(GPIOE, LL_GPIO_PIN_5, LL_GPIO_MODE_OUTPUT);
  
  LL_GPIO_SetPinSpeed(GPIOE, LL_GPIO_PIN_0, LL_GPIO_SPEED_FREQ_HIGH);
  LL_GPIO_SetPinSpeed(GPIOE, LL_GPIO_PIN_1, LL_GPIO_SPEED_FREQ_HIGH);
  LL_GPIO_SetPinSpeed(GPIOE, LL_GPIO_PIN_2, LL_GPIO_SPEED_FREQ_HIGH);
  LL_GPIO_SetPinSpeed(GPIOE, LL_GPIO_PIN_3, LL_GPIO_SPEED_FREQ_HIGH);
  LL_GPIO_SetPinSpeed(GPIOE, LL_GPIO_PIN_4, LL_GPIO_SPEED_FREQ_HIGH);
  LL_GPIO_SetPinSpeed(GPIOE, LL_GPIO_PIN_5, LL_GPIO_SPEED_FREQ_HIGH);
  
  GPIOC->BSRR |= (1 << 6);       /* OE-PIN Idle (High) */
  GPIOE->BRR  |= (1 << 5);       /* Latch Data (Low) */
  GPIOD->BRR  |= (1 << 6);       /* CK PIN (LOW) */
  
  __NOP();__NOP();__NOP();__NOP();__NOP();__NOP();__NOP();
  __NOP();__NOP();__NOP();__NOP();__NOP();__NOP();__NOP();
  __NOP();__NOP();__NOP();__NOP();__NOP();__NOP();__NOP();
  
  Bsp_LED_Off(BSP_LED0);
  
  SysTick->LOAD = 71999U;
  
  SysTick->CTRL |= SysTick_CTRL_TICKINT_Msk |
                   SysTick_CTRL_CLKSOURCE_Msk |
                   SysTick_CTRL_ENABLE_Msk;
                   
  GPIOC->BSRR = (1 << 6);        /* OE-High Disable Output */
	
  GPIOE->ODR &= (~(0x1F));       /* Select ROW 0 and ROW 15 */
  GPIOE->ODR |=  ((0x08));
  
	//Shift_Data64_Out(0xFF);
  //Shift_Data64_Out(0xFFFFFFFFFFFFFFFF);    /* Shift Data Out */
  //Shift_Data64_Out(0x5555555555555555);      /* Shift Data Out */
  Shift_Data64_Out(0x1111111111111111);      /* Shift Data Out */
  //Shift_Data64_Out(0x3F3F3F3F3F3F3F3F);      /* Shift Data Out */
  
	GPIOE->ODR  |= (1 << 5);        /* Latch Data - High Pulse */
  __NOP();__NOP();__NOP();__NOP();__NOP();__NOP();__NOP();
  __NOP();__NOP();__NOP();__NOP();__NOP();__NOP();__NOP();
		
  GPIOE->ODR  &= ~(1 << 5);
  __NOP();__NOP();__NOP();__NOP();__NOP();__NOP();__NOP();
  __NOP();__NOP();__NOP();__NOP();__NOP();__NOP();__NOP();
  
  GPIOC->BRR = (1 << 6);        /* Enable Output */

  
  
  while (1) {
    GPIOD->BRR = (1 << 6);
    __NOP();__NOP();__NOP();__NOP();__NOP();__NOP();
     
    GPIOD->BSRR = (1 << 6);
    __NOP();__NOP();__NOP();__NOP();__NOP();__NOP();
  }

}

Sorry, forgot to post the code of ‘Shift_Data64_Out’ function.

void Shift_Data64_Out(uint64_t data) {
  
  uint8_t i;
 
  for (i = 0; i < 64; i++) {
    
    if (data & (uint64_t)((uint64_t)(1) << (63 - i))) {
      GPIOD->BSRR = (1 << 0);   // R0      
      GPIOD->BSRR = (1 << 4);   // G1
      GPIOD->BSRR = (1 << 5);   // B1
    }

    else {
      GPIOD->BRR = (1 << 0);    // R0
      GPIOD->BRR = (1 << 4);    // G1
      GPIOD->BRR = (1 << 5);    // B1
    }    
    
    GPIOD->BRR = (1 << 6);    /* Clock Low */    
    __NOP();__NOP();__NOP();__NOP();__NOP();__NOP();__NOP();
    __NOP();__NOP();__NOP();__NOP();__NOP();__NOP();__NOP();
    
    GPIOD->BSRR = (1 << 6);   /* Clock High */   
    __NOP();__NOP();__NOP();__NOP();__NOP();__NOP();__NOP();
    __NOP();__NOP();__NOP();__NOP();__NOP();__NOP();__NOP();
  }
  
  
  return;
}

I’ve tried to contact the manufacture about FM6124 driving timing scheme without any luck. Instead, I got a detailed version of FM6126A programming manual. LOLLL…

The only difference between FM6124 and FM6126, is that FM6126 need three clock pulses for each Latch.

Here the timing scheme of the FM6124, its the typical shift register.

1 Like

I know, but I cannot get stable output with the code I wrote above which is definitely weird. Something must be wrong, either my code or the hardware itself.

Verify the signals with a logic analyzer and increase the delays to verify if the problems are resolved.

All these problems appear to be due to a problem of signal times, too fast for panel shift registers, or signals that do not remain in the proper state long enough (Latch, Output Enable).

1 Like

Already reviewed the waveform, and adjust the number of __NOPS() between pulses of either LATCH signal and OE singal without any luck.

Trying to contact DFRobot sales department, hope can get response. I just don’t understand why such a simple logic cannot get stable output. Is FM6124 a “special” shift register? …

I asked some LED controller manufactures, and they told me that FM6124 is not a simple SHIFT LATCH chip, in other words, you cannot get stable output unless you feed it with continuous data and clock.

I use my own source code with a Kinetis MK66 microcontroller, and it works perfectly with panels based on FM6124 and ICN2038.