MAX7219 led 8x8 Matrix, sometimes all leds constantly on

Discussion in 'Embedded Systems and Microcontrollers' started by Luka Dragicevic, Dec 16, 2016.

  1. Luka Dragicevic

    Thread Starter New Member

    Dec 16, 2016
    9
    0
    Hello,

    I've got an issue with my MAX7219 chip connected on my MCU (STM32). I'm programming in MikroC for ARM, and I've got working code for my led matrix which displays some random text when I turn on my mcu. But sometimes when I run my mcu, my led matrix just displays all 8x8 leds are constantly on, and nothing changes.

    Does anyone know why this could happen to me?
    I've attached my code if it could affect solution.

    P.S. If I can somehow notice, this happens always after some period while mcu was turned off, and after that when I switch off - on my matrix will display right screen

    For any further information, free feel to ask me.

    Thanks in advance
     
    • code.rar
      File size:
      782 bytes
      Views:
      7
  2. AlbertHall

    AAC Fanatic!

    Jun 4, 2014
    6,346
    1,467
    Schematic please.

    This code confuses me:
    Chip_Select2 = 0; // SELECT MAX
    SPI2_Write(0x00);
    SPI2_Write(0xFF); // No test
    Chip_Select2 = 1; // DESELECT MAX
    Register 0x00 is the no-op register. Register 0x0F is the display test register.
     
  3. Luka Dragicevic

    Thread Starter New Member

    Dec 16, 2016
    9
    0
  4. dannyf

    Well-Known Member

    Sep 13, 2015
    2,196
    421
    read the timing diagram in the datasheet.
     
  5. Luka Dragicevic

    Thread Starter New Member

    Dec 16, 2016
    9
    0
    I am sorry, I haven't mentioned, that I'm not familiar with this way of programming (electronics in general), I am doing first embedded project, so I would appritate if you could help me. Thanks. Which timing diagram should I look at?
     
  6. Luka Dragicevic

    Thread Starter New Member

    Dec 16, 2016
    9
    0
    Here's timing diagram:

    Capture.PNG
     
  7. dannyf

    Well-Known Member

    Sep 13, 2015
    2,196
    421
    check the datasheet for the various timing specifics and compare that to your code to see where those timing parameters may not hold true.
     
Loading...