Go Down

Topic: max7219 at high voltage issue (Read 1 time) previous topic - next topic

yo8tww

Hi..I had just finished a pcb for a bicolor chronometer that use 18v on the high side, using the schematic which involves on the high side the UDN2981(A2982), on the low side the inverter (74HC540) and a ULN2803. Made a quick sketch to test it, works as intended but with a major flaw..The segments that are supposed to be off, are slightly on, as a phantom digit..So, if I have Digit0 lighted up with any value, it's image appears also on Digit1, slightly lighted, but visible...Do you know any cure to this ?Thank you....

Grumpy_Mike

Quote
Do you know any cure to this ?
Start off by reading this:-
How to use this forum

Having read this you will find out you need to post your schematic and code.

yo8tww

#2
Aug 16, 2015, 11:29 am Last Edit: Aug 16, 2015, 11:33 am by Costin
Yep, my fault....I was just tired of trying all day long to make this board to work properly.Here are the schematic and the code...Not too much, just for testing purposes..


Code: [Select]
/*Chrono test


*/
#include "LedControl.h"
#include <TimerOne.h>
//#include <SPI.h>
//#include <mcp_can.h>

volatile int count=0;
volatile bool red= false;
volatile bool green=false;
volatile bool high=false;
int ones=0;
int tens=0;
int v=0;
volatile int redTime=11;
volatile int greenTime=22;




LedControl lc=LedControl(12,11,10,1);



void setup(){
 Serial.begin(115200);
   /*
   The MAX72XX is in power-saving mode on startup,
   we have to do a wakeup call
   */
  lc.shutdown(0,false);
  /* Set the brightness to a medium values */
  lc.setIntensity(0,8);
  /* and clear the display */
  lc.clearDisplay(0);
 Timer1.initialize(1000000);//1 sec
 Timer1.attachInterrupt(blinkLED);

 
 count =redTime;
 v= count;
 red=true;
 high=true;
 Timer1.start();
}
void loop(){
    if(high){
     
      if(red){
        lc.setChar(0,2,' ',false);
        lc.setChar(0,3,' ',false);
        v=count;
        ones=v%10;
        v=v/10;
        tens=v%10;
       
      if(tens <=0){
        lc.setChar(0,1,' ',false);
          }
          else{
            lc.setDigit(0,1,(byte)tens,false);
          }
        lc.setDigit(0,0,(byte)ones,false);
       
        Serial.println(count);
        }
        if(green)
        {
          lc.setChar(0,0,' ',false);
          lc.setChar(0,1,' ',false);
        v=count;
        ones=v%10;
        v=v/10;
        tens=v%10;
        if(tens <=0){
        lc.setChar(0,3,' ',false);
          }
          else{
            lc.setDigit(0,3,(byte)tens,false);
          }
        lc.setDigit(0,2,(byte)ones,false);

        Serial.println(count);
        }
        high=false;
    }
 
 
 
 
}
void blinkLED()
{
  count -- ;
  if (count == 0 && red){
      red=false;
      green=true;
      count=greenTime;
    }
    if(count==0 &&green){
      green=false;
      red=true;
      count=redTime;
    }
     high=true;
  }
   

Paul__B

Can't quite see the problem, but it looks as if the loop code runs and writes to the MAX7219 pretty continuously even where there is nothing to do.

yo8tww

#4
Aug 16, 2015, 04:27 pm Last Edit: Aug 16, 2015, 04:28 pm by Costin
Well, the loop just update the Max7219 once a second, switching from red digits to green digits. It runs ok, but with those "ghost"digits. I've tryied until now to pull-down the ULN2803 inputs,pull-up the HC540's inputs,even direct drive from MAX's dig outputs..It doesn't solve the problem.

Grumpy_Mike

Quote
Well, the loop just update the Max7219 once a second,
It is much better to only update the chip when something has changed not all the time. This is true of most things with electronics not just this chip.

I can't see anything wrong either, although I have used that chip I have never tried to do that with it, sorry.

yo8tww

#6
Aug 17, 2015, 08:03 am Last Edit: Aug 17, 2015, 08:05 am by Costin
It seems to be something related to the interdigit blanking time generated by Max and propagation delays induced by both by the sinker and the source drives. Googlin' a lot, it seems that some boards using the same schematic works fine, some not...The chip is not overwhelmed at all, geting necessary infos just when the counter change it's value, that means one shot per second....I used those chips a lot before, but at 5v, and I had never any issue....

CrossRoads

May have to do with the logic inversion - the MAX7219 common anodes are now pulling the common cathodes of the display low, while the individual segments lines are now driving high.
Try adding 1K pullups to the ULN2803 outputs to make sure they are turning off fully when not driven. The pulldowns would only make the ghosting worse I would think, making all the digits slightly on when none are supposed to be on.
Designing & building electrical circuits for over 25 years.  Screw Shield for Mega/Due/Uno,  Bobuino with ATMega1284P, & other '328P & '1284P creations & offerings at  my website.

Paul__B

Methinks he said he was trying pulldowns on the ULN2803 inputs which is optimistic seeing pulldowns are built into the chip.

Go Up