Connect with us

MAX6955 (I2C, LEDs, STM32)

Discussion in 'Microcontrollers, Programming and IoT' started by JohnSugar, Nov 28, 2014.

  1. JohnSugar

    JohnSugar

    5
    0
    Jul 13, 2014
    Hello,

    I'd like to control 7 10-led-bargrah to display some visual effects. I chose to use MAX6955 to drive them, it works by the serial interface I2C. I also use the stm32 discovery board.
    I followed the datasheet of the MAX6955 to make the wiring :
    - I connected the cathodes of each bargraph together i followed the "Connection Scheme for Sixteen 7-Segment Digits" from the datasheet.
    - I took my I2C routines from another project that is working properly just made a few changes to fit to this projet. (address of slave "1100000" 2 pins AD0/AD1 both to GND)

    I tried to light up an LED but it doesnt work i receive well the ACKs in debug mod so i don't what is going on.

    Here my routine to init the IC :

    int write_max6955(char slave_address,char register ,char data);

    write_max6955(0xC0,0x01,0x00); //decode mode - no decode
    write_max6955(0xC0,0x02,0x00); //global intensity - min
    write_max6955(0xC0,0x03,0x07); //scan limit - 0->7 digits
    write_max6955(0xC0,0x04,0x00); //control register enable...
    write_max6955(0xC0,0x0C,0x00); //digit type all 7 seg
    write_max6955(0xC0,0x07,0x00); //display test normal operation
    write_max6955(0xC0,0x05,0x0F); //decode mode no decode

    then i tried to light up something write_max6955(0xC0,0x20,0xFF);

    Any help would be appreciated
     
  2. (*steve*)

    (*steve*) ¡sǝpodᴉʇuɐ ǝɥʇ ɹɐǝɥd Moderator

    25,174
    2,690
    Jan 21, 2010
    Have you tried measuring the voltage across a LED when it is supposedly turned on and turned off? It obvious basic mistake is that you have the LEDs connected backwards. Measuring the output would be the quickest answer to this and it would eliminate further troubleshooting.

    You could connect 2 LEDs in inverse parallel and place this in the position of a single LED. This can be used to confirm that the polarity is what you expect.

    The MAX6955 is clearly a non-trivial to drive. I'm not going to read the entire datasheet at this point to try to figure out if your initialization is correct, however I wonder at your choice of setting the global intensity to minimum. Is this 0? Does that mean that the brightest the LEDs will get is off? (i.e. they never get turned on?) OK, it seems that 0 is 1/16 intensity so you should see something.

    Have you tried

    write_max6955(0xC0,0x07,0x01); //display test - test mode

    which should override everything and turn on the LEDs? This will confirm the LEDs are correctly connected. If this works then you can send data to the chip and the LEDs are wired up OK, so that means the reason you're not seeing anything is probably that you're not sending the correct data.
     
  3. JohnSugar

    JohnSugar

    5
    0
    Jul 13, 2014
    Hi !
    Thank you for your answer i tried to mesure the outputs and there is no change. I tried other outputs (like GPIOs) and same issue.
    You must be right the data is not correct. If only i had an oscilloscope i could check ! Maybe i can find a small USB-logic analyser.
     
  4. (*steve*)

    (*steve*) ¡sǝpodᴉʇuɐ ǝɥʇ ɹɐǝɥd Moderator

    25,174
    2,690
    Jan 21, 2010
    Did you try test mode like I suggested? If that doesn't work it suggests your communication to the chip is at fault (or the chip is dead)
     
  5. JohnSugar

    JohnSugar

    5
    0
    Jul 13, 2014
    Hi, i tried what you suggested all the LEDs turn on. It seems the chip isn't dead. I surely miss something in my init.
     
  6. JohnSugar

    JohnSugar

    5
    0
    Jul 13, 2014
    Ok now it is working , if someone else have trouble to use the MAX9655 with discrete LEDs only here is the init :

    write_max6955(0xC0,0x01,0x00); //decode mode no decode
    write_max6955(0xC0,0x02,0x00); //global intensity min
    write_max6955(0xC0,0x03,0x07); //scan limit 0->7 digits
    write_max6955(0xC0,0x04,0x05); //config
    write_max6955(0xC0,0x0C,0x00); //digit type all 7 seg
    write_max6955(0xC0,0x07,0x00); //normal operation

    I just need to re-wire my LEDs to match the good command for example i light up the 1st LED with the command 0x40,.. the 4th with 0x08...
    It follows the partern of a 7-seg : dp, a, b , c ,d ,e ,f ,g corresponding to data command D7 D6 D5 D4 D3 D2 D1 D0. And I made a mistake to follow the pin number.
    It was a good experience thank you for your help
     
  7. (*steve*)

    (*steve*) ¡sǝpodᴉʇuɐ ǝɥʇ ɹɐǝɥd Moderator

    25,174
    2,690
    Jan 21, 2010
    Congratulations on getting it working.

    It's clearly a complex chip that relies on you getting things "just right".
     
  8. Juliette

    Juliette

    1
    0
    Jun 5, 2015
    Hello,
    I'm trying to drive RGB LEDs with the MAX6955 but I used charliplexing to make the wiring. I then tried to turn on some LEDs but nothing happens even with the good init fonction. I think I have to change the wiring. The problem is that I'm not sure how to do it, I didn't really understand how to wire my discret LEDs and which register I have to use with which data in order to turn on my LEDs how I would like.
    Thank you in advance if someone can help me!
     
Ask a Question
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.
Electronics Point Logo
Continue to site
Quote of the day

-