Drive 7seg and additional LEDs

Go To Last Post
46 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

i used atmega32 and max7219. this is my code i want to display number on  7segment display which is connected on dig0, dig1, dig2 and simultaneously i want to make individual led ON which is connected on dig4 as per diagram which is shown below. i am totally confused how to do, plz help me to do this.

/*

* Created: 08-01-2019 10:34:53

* Author : Rakeshkumar





// 16MHz clock

#define F_CPU 16000000UL



// Outputs, pin definitions

#define PIN_SCK PORTB7

#define PIN_MOSI PORTB5

#define PIN_SS PORTB4



#define ON 1

#define OFF 0



#define MAX7219_LOAD1 PORTB |= (1<<PIN_SS)

#define MAX7219_LOAD0 PORTB &= ~(1<<PIN_SS)



#define MAX7219_MODE_DECODE 0x09

#define MAX7219_MODE_INTENSITY 0x0A

#define MAX7219_MODE_SCAN_LIMIT 0x0B

#define MAX7219_MODE_POWER 0x0C

#define MAX7219_MODE_TEST 0x0F

#define MAX7219_MODE_NOOP 0x00



// I only have 3 digits, no point having the

// rest. You could use more though.

#define MAX7219_DIGIT0_UNIT 0x01

#define MAX7219_DIGIT1_TEN 0x02

#define MAX7219_DIGIT2_HUN 0x03

#define MAX7219_DIGIT3_THOU 0x04

#define MAX7219_DIGIT4_CNT1 0x05

#define MAX7219_DIGIT5_CNT2 0x06



#define MAX7219_CHAR_BLANK 0xF

#define MAX7219_CHAR_NEGATIVE 0xA



#include <avr/io.h>

#include <util/delay.h>




char digitsInUse = 5;



void spiSendByte (char databyte)

{



SPDR = databyte;



while (!(SPSR & (1 << SPIF)));

}



void MAX7219_writeData(char data_register, char data)

{

MAX7219_LOAD0;



spiSendByte(data_register);



spiSendByte(data);

MAX7219_LOAD1;

}





int main(void)

{



DDRB |= (1 << PIN_SCK) | (1 << PIN_MOSI) | (1 << PIN_SS);





SPCR |= (1 << SPE) | (1 << MSTR)| (1<<SPR1);





MAX7219_writeData(MAX7219_MODE_DECODE, 0xFF);





MAX7219_writeData(MAX7219_MODE_SCAN_LIMIT, digitsInUse-1 );

MAX7219_writeData(MAX7219_MODE_INTENSITY, 8);

MAX7219_writeData(MAX7219_MODE_POWER, ON);

    MAX7219_writeData(MAX7219_DIGIT2_HUN,0X05); 

    MAX7219_writeData(MAX7219_DIGIT1_TEN,0X04);
    MAX7219_writeData(MAX7219_DIGIT0_UNIT, 0X03);
    MAX7219_writeData(MAX7219_DIGIT3_THOU, 0b00001111);
    
}

 

This topic has a solution.
Last Edited: Sun. Mar 10, 2019 - 06:03 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Change the value of the MAX7219 decode register from 0xff to 0x07.  This will allow the three 7-segment digits (D0, D1, D2 on the MAX7219)  to be controlled by BCD code-B and the 7 separate LEDs ( on D3 of the MAX7219) to be toggled individually.

Last Edited: Sun. Feb 24, 2019 - 03:32 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Yeah, I made that change. But it didn't work.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Do you have the 9.5K [10K ohm] resistor on pin 18 of the MAX7219?

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

No but why it is required.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

i made that change but not getting result.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

uc_coder wrote:
No but why it is required.

 

Because the datasheet says so.

#1 This forum helps those that help themselves

#2 All grounds are not created equal

#3 How have you proved that your chip is running at xxMHz?

#4 "If you think you need floating point to solve the problem then you don't understand the problem. If you really do need floating point then you have a problem you do not understand." - Heater's ex-boss

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

This resistor limits the current that lights the LEDs.  If it is not there then there is no current going into the LEDs, and they will never be turned ON regardless of the values sent to the IC.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Why do you need the max chip at all?  If the current is fairly low, the mega32 can easily do the job.

When in the dark remember-the future looks brighter than ever.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

avrcandies wrote:

Why do you need the max chip at all?  If the current is fairly low, the mega32 can easily do the job.


Sir I Making a project it consists 17 led for indication and 3 seven segment display so it is not possible to drive all these thing by atmega controller itself because limited gpio. So used max7219 for these thing. I succeeded to transfer value on seven segment display but when I m using led together to indicate it is not working properly. I am new and totally confused how to do it. I made changes which is told in above rpl but still not getting proper output. What is wrong , led connection aur program plz help me .

Last Edited: Mon. Feb 25, 2019 - 02:42 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

uc_coder wrote:
Sir I Making a project it consists 17 led for indication
I assume you mean 8, not 17.  That's what your schematic has.

 

uc_coder wrote:
it is not possible to drive all these thing by atmega controller itself because limited gpio.
You can still multiplex without the use of a 7219.  Eight I/O for the segment drive, four I/O for the digit select.  Three are for the 7-seg digits, the fourth is for the 8 indicators.  That's only 12 I/O.  Granted, it's more than the 5 needed by the 7219, but the m32 has a total of 32 I/O pins.

 

The 7219 does provide more sink and source current, though.  100 mA source per segment, 500 mA sink per digit.  Also, the 7219 lets you set segment current for all segments on all digits with a single resistor.  With 'bare' I/O multiplexing, you need to limit current yourself with a resistor on each segment I/O pin.

 

You should limit yourself to 20 mA if driving directly from an I/O pin on the m32.  For that reason, you'd want the digit select to be done via a BJT or similar.  Unless you really need more than 20 mA per segment/indicator, I'd say you don't >>need<< the 7219 at all.

 

For me the choice would boil down to cost and time.  Which is faster to deploy and/or has cheapest BOM?  A 7219 and one resistor?  Or 12 resistors and 4 BJT?  What PCBA cost?

 

 

 

 

"Experience is what enables you to recognise a mistake the second time you make it."

"Good judgement comes from experience.  Experience comes from bad judgement."

"Wisdom is always wont to arrive late, and to be a little approximate on first possession."

"When you hear hoofbeats, think horses, not unicorns."

"Fast.  Cheap.  Good.  Pick two."

"We see a lot of arses on handlebars around here." - [J Ekdahl]

 

Last Edited: Mon. Feb 25, 2019 - 04:22 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0
char digitsInUse = 5;

Not the problem, but that should be 4.

 

uc_coder wrote:
succeeded to transfer value on seven segment display but when I m using led together to indicate it is not working properly.
Your LEDs are backwards.  The segment drive pins source current (VCC), while the digit select pins sink current (GND).

"Experience is what enables you to recognise a mistake the second time you make it."

"Good judgement comes from experience.  Experience comes from bad judgement."

"Wisdom is always wont to arrive late, and to be a little approximate on first possession."

"When you hear hoofbeats, think horses, not unicorns."

"Fast.  Cheap.  Good.  Pick two."

"We see a lot of arses on handlebars around here." - [J Ekdahl]

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

joeymorin wrote:

uc_coder wrote:
Sir I Making a project it consists 17 led for indication
I assume you mean 8, not 17.  That's what your schematic has.

 

uc_coder wrote:
You can still multiplex without the use of a 7219.  Eight I/O for the segment drive, four I/O for the digit select.  Three are for the 7-seg digits, the fourth is for the 8 indicators.  That's only 12 I/O.  Granted, it's more than the 5 needed by the 7219, but the m32 has a total of 32 I/O pins..

Sir in my project i am going to use 17 leds in present schematic i used only 8 because i just want to see this works properly or not and in my I have 7 switches & 6 relays One DAC. thats why i used max7219 which only consumes 4 pins MOSI, MISO, SCK, SS.  

 

 

 

 

 

Last Edited: Mon. Feb 25, 2019 - 06:34 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

joeymorin wrote:

uc_coder wrote:
Sir I Making a project it consists 17 led for indication
I assume you mean 8, not 17.  That's what your schematic has.

 

uc_coder wrote:

The 7219 does provide more sink and source current, though.  100 mA source per segment, 500 mA sink per digit.  Also, the 7219 lets you set segment current for all segments on all digits with a single resistor.  With 'bare' I/O multiplexing, you need to limit current yourself with a resistor on each segment I/O pin.

.

  i changed the direction of leds but it didnt work. i dont know where i am going wrong in software or in led connection or something else. plz hep me sir i tried lot of thing not getting output. 

 

 

 

 

 

 

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 2

You need the current setting resistor for the MAX7219. And obviously capacitors for each chip.
The schematic is fine with those corrections.
.
The 7219 can drive up to 8 displays. Your 8 LEDs are only like a 7-seg display with decimal point.
The only practical concern is matching brightness between the LED "digit" and the three 7-seg digits.
.
I have not looked at your software code. You can send any binary value to a specific digit. You simply look up the 7-seg pattern from your own table.
.
David.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

uc_coder wrote:

Sir in my project i am going to use 17 leds in present schematic i used only 8 because i just want to see this works properly or not and in my I have 7 switches & 6 relays One DAC. thats why i used max7219 which only consumes 4 pins MOSI, MISO, SCK, SS.  

You can still do that with only 5 digits, and one extra pin for the 17th LED.  That's still only 14 I/O pins.  The m32 has 32 I/O, leaving you with 18.  7 switches and 6 relays is another 13 pins, leaving you with 5.  What does your DAC need?  if it's SPI, then only 3.  If I2C, then only 2.

 

I'm not saying don't use the 7219.  I'm saying you don't >>need<< to.  There are usually several ways of accomplishing a task.

 

david.prentice wrote:

You need the current setting resistor for the MAX7219. And obviously capacitors for each chip.

But the OP said:

i made that change but not getting result.

 

It's time the OP post the updated schematic and software.  DO NOT EDIT YOUR ORIGINAL POST.  Leave that is it is, and show us the updates in a new post.

 

"Experience is what enables you to recognise a mistake the second time you make it."

"Good judgement comes from experience.  Experience comes from bad judgement."

"Wisdom is always wont to arrive late, and to be a little approximate on first possession."

"When you hear hoofbeats, think horses, not unicorns."

"Fast.  Cheap.  Good.  Pick two."

"We see a lot of arses on handlebars around here." - [J Ekdahl]

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 2

I only looked at the original post.   I would stick with MAX7219.    Clearly 17 LEDs would be three "LED digits" to be controlled with the three "7-seg digits" by MAX7219.      It comes down to matching the brightness.

Yes,   you could do all the multiplexing with the AVR.   You would still need external components for the digit select pins.    They take all the segment currents.

 

Please post an accurate schematic.

 

Driving all the 7-segs and LEDs takes quite a lot of current.   Wise to let the MAX7219 do the hard work.   It may need some heatsinking.

Likewise,  driving 6 relays takes current.   Reading 7 switches is trivial.

 

You must calculate worst case currents.   

 

It is easy enough to control the MAX7219 in software.   But you need to get the hardware designed first.
 

David.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

david.prentice wrote:

Please post an accurate schematic.

David.

updated code for 3 seven segment display and 17 leds and schematic.



#define F_CPU 16000000UL


#define PIN_SCK							PORTB7
#define PIN_MOSI						PORTB5
#define PIN_SS							PORTB4

#define ON								1
#define OFF								0

#define MAX7219_LOAD1					PORTB |= (1<<PIN_SS)
#define MAX7219_LOAD0					PORTB &= ~(1<<PIN_SS)

#define MAX7219_MODE_DECODE				0x09
#define MAX7219_MODE_INTENSITY			0x0A
#define MAX7219_MODE_SCAN_LIMIT			0x0B
#define MAX7219_MODE_POWER				0x0C
#define MAX7219_MODE_TEST				0x0F
#define MAX7219_MODE_NOOP				0x00

#define MAX7219_DIGIT0_UNIT             0x01
#define MAX7219_DIGIT1_TEN              0x02
#define MAX7219_DIGIT2_HUN              0x03
#define MAX7219_DIGIT3					0x04
#define MAX7219_DIGIT4		            0x05
#define MAX7219_DIGIT5		            0x06

#define MAX7219_CHAR_BLANK				0xF 
#define MAX7219_CHAR_NEGATIVE			0xA 

#include <avr/io.h>
#include <util/delay.h>

char digitsInUse = 5;

void spiSendByte (char databyte)
{
	SPDR = databyte;
    while (!(SPSR & (1 << SPIF)));
}

void MAX7219_writeData(char data_register, char data)
{
    MAX7219_LOAD0;
    spiSendByte(data_register);
    spiSendByte(data);
    MAX7219_LOAD1;
}




int main(void)
{
	DDRB |= (1 << PIN_SCK) | (1 << PIN_MOSI) | (1 << PIN_SS);
	SPCR |= (1 << SPE) | (1 << MSTR)| (1<<SPR1);

	MAX7219_writeData(MAX7219_MODE_DECODE, 0x07);
	MAX7219_writeData(MAX7219_MODE_SCAN_LIMIT, digitsInUse);   // Scan limit runs from 0.
    MAX7219_writeData(MAX7219_MODE_INTENSITY, 8);
    MAX7219_writeData(MAX7219_MODE_POWER, ON);
	
	MAX7219_writeData(MAX7219_DIGIT0_UNIT,3);			//to drive 7 segment
	MAX7219_writeData(MAX7219_DIGIT1_TEN,4);			//to drive 7 segment
	MAX7219_writeData(MAX7219_DIGIT2_HUN,5);			//to drive 7 segment
	MAX7219_writeData(MAX7219_DIGIT3, 0b00000011);		// to drive led 
	MAX7219_writeData(MAX7219_DIGIT4, 0b11000011);		// to drive led 
	MAX7219_writeData(MAX7219_DIGIT5, 0b00000001);		// to drive led 
}

not displaying anything on 7 seven segment display.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Your schematic does not need the 1k0 resistors.   The MAX7219 is designed to drive LED directly with the average current set by the RSET resistor.

Look at the Typical Application Circuit on page #1 of the MAX7219 datasheet.  The 7-segs must be common-cathode.

 

Your software looks fine to me.    I had not realised that I could decode individual channels.   I have always used all-decode or no-decode.

 

Your schematic looks like Proteus.   I would assume that Proteus can Simulate the MAX7219.

 

What did you expect?  What did you get?

 

I would put a while(1); at the end of main()

But your code will simply drop off the bottom, disable interrupts (and into a while loop from the startup code)

 

David.

Last Edited: Mon. Feb 25, 2019 - 06:32 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

SIR SEE THE DIFFENCE BETWEEN IMAGE 1 AND 2.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Since this is a "simulated AVR" and it seems to work in one configuration, and not the other...

You need to contact LabCenter support to find your problem, after all you have paid for this support!

 

Jim

 

Click Link: Get Free Stock: Retire early! PM for strategy

share.robinhood.com/jamesc3274

 

 

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

The red and blue dots don't make sense on the econd schematic.
.
The first image looks fine to me. Your LEDs are connected as common cathode. It should look like a regular 7-segment for the MAX7219.
.
David.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

ki0bk wrote:

Since this is a "simulated AVR" and it seems to work in one configuration, and not the other...

You need to contact LabCenter support to find your problem, after all you have paid for this support!

 

Jim

 

if you look there are changes in above LEDs are connected so there is no fault of proteus.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

david.prentice wrote:
The red and blue dots don't make sense on the econd schematic.
.
The first image looks fine to me. Your LEDs are connected as common cathode. It should look like a regular 7-segment for the MAX7219.
.
David.

Sir it blinks in image it is not visible. But this blink is clearly visible. And not blinks in sequence it blinks randomly.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

uc_coder wrote:
so there is no fault of proteus.

And yet it does not work, again, you paid for the support, you should seek expert advise!

 

I don't see anything wrong in either schematic, does it work using real h/w?

 

Jim

 

Click Link: Get Free Stock: Retire early! PM for strategy

share.robinhood.com/jamesc3274

 

 

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

ki0bk wrote:

uc_coder wrote:
so there is no fault of proteus.

And yet it does not work, again, you paid for the support, you should seek expert advise!

 

I don't see anything wrong in either schematic, does it work using real h/w?

 

Jim

 


No currently I don't have hardware because first I want to make basic thing like interfacing.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Check out this Arduino article on using the max7219 to drive an LED matrix, similar to your setup and see if anything stands out!

https://playground.arduino.cc/Ma...

One thing that is different is the use of two caps on the supply leads.

 

Jim

 

Click Link: Get Free Stock: Retire early! PM for strategy

share.robinhood.com/jamesc3274

 

 

 

Last Edited: Mon. Feb 25, 2019 - 07:26 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

plz someone help me to do. 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 1

uc_coder wrote:
plz someone help me to do.

Well I don't see anything wrong in schematic (latest) or the software.

Proteus is a simulator, so single step your way through the code and see where it does not do what you expect it to do.

Come back here when you find something odd, and explain what you find.

 

If all else fails, call LabCenter support!

 

Jim

 

Click Link: Get Free Stock: Retire early! PM for strategy

share.robinhood.com/jamesc3274

 

 

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

can somebody help me???????

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

If you single step the code (proteus is, after all a simulator with the idea that you use it's debugging facilities to develop) then in the code:

	MAX7219_writeData(MAX7219_DIGIT0_UNIT,3);			//to drive 7 segment
	MAX7219_writeData(MAX7219_DIGIT1_TEN,4);			//to drive 7 segment
	MAX7219_writeData(MAX7219_DIGIT2_HUN,5);			//to drive 7 segment
	MAX7219_writeData(MAX7219_DIGIT3, 0b00000011);		// to drive led 
	MAX7219_writeData(MAX7219_DIGIT4, 0b11000011);		// to drive led 
	MAX7219_writeData(MAX7219_DIGIT5, 0b00000001);		// to drive led 

What happens if you step this one line at a time. If you just let it execute the first line does that one line show '3'? In fact if you just run the lines for 3,4,5 do they all light up? Does it then go off after you run the lines for DIGIT3 (4 and 5) ?

 

Or is it the case that not even the first line displays? In that case it must be a difference between:

MAX7219_writeData(MAX7219_MODE_DECODE, 0xFF);

MAX7219_writeData(MAX7219_MODE_SCAN_LIMIT, digitsInUse-1 );

MAX7219_writeData(MAX7219_MODE_INTENSITY, 8);

MAX7219_writeData(MAX7219_MODE_POWER, ON);

and

	MAX7219_writeData(MAX7219_MODE_DECODE, 0x07);
	MAX7219_writeData(MAX7219_MODE_SCAN_LIMIT, digitsInUse);   // Scan limit runs from 0.
    MAX7219_writeData(MAX7219_MODE_INTENSITY, 8);
    MAX7219_writeData(MAX7219_MODE_POWER, ON);

So I would then be exploring what actually happens between using MODE_DECODE=0x07 and MOD_DECODE=0xFF. Also the effect of changing "digitsInUse"

 

If all that fails twice now you have been told:

ki0bk wrote:
You need to contact LabCenter support to find your problem, after all you have paid for this support!
ki0bk wrote:
If all else fails, call LabCenter support!
This is sound advice. The whole reason you pay €400 for Proteus (or whatever the cost is) is in order to guarantee a good level of support. So you should ask them for guidance in case there is a fault in their simulation of the 7219. Don't assume that just because it's a simulator it might not have bugs. It's just software and all software has bugs.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I would be 99.5% confident that Proteus simulates a MAX7219 correctly.   Ok,  it might not do the brightness levels.

 

Both schematics in #20 look correct to me.    It is the OP's job to compare with the MAX7219 datasheet.

The software looks correct to me.

 

So it comes down to the OP giving an accurate description of what is happening.

Either in English or posting a video.

 

Does schematic #1 simulates correctly.

What happens with schematic #2 ?

 

If the OP provides accurate information,   readers might run it on real hardware.    I would simply use the 7-segs on an 8-digit display.    I have no intention of wiring up 17 individual LEDs.

 

David.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

david.prentice wrote:
Does schematic #1 simulates correctly.
he showed:

 

The implication seems to be that once  DIG4..DIG6 are connected to the extra LEDs that not only don't they work but also DIG0..3 stop working.

 

Either this is because something in the wiring of the extra LEDs (but they are just commons/segments at the end of the day??) or, as seems more likely, it's the difference between:

MAX7219_writeData(MAX7219_MODE_DECODE, 0xFF);

MAX7219_writeData(MAX7219_MODE_SCAN_LIMIT, digitsInUse-1 );

MAX7219_writeData(MAX7219_MODE_INTENSITY, 8);

MAX7219_writeData(MAX7219_MODE_POWER, ON);

and 

	MAX7219_writeData(MAX7219_MODE_DECODE, 0x07);
	MAX7219_writeData(MAX7219_MODE_SCAN_LIMIT, digitsInUse);   // Scan limit runs from 0.
    MAX7219_writeData(MAX7219_MODE_INTENSITY, 8);
    MAX7219_writeData(MAX7219_MODE_POWER, ON);

Or it is a fault in the simulator block in that connecting to and enabling DIG4..6 somehow has an effect on DIG0..3 ?

 

I'm a software engineer so I always naturally assume a fault in the software and that would include the simulator software itself.

 

The most suspicious thing in the code differences look like being "digiInUse-1" versus "digInUse" (why??) or the setting of "MODE" between 0x07 and 0xFF. However the 7219 datasheet explains that the bits in the DECODE_MODE register simply are boolean to say whether it does "BCD" on each digit in turn so while this might affect the segments that are lit I doubt it would be an overall "ON"/"OFF" for the entire display plus additional LEDs

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Yes,   I assumed that the L543 was simulated correctly.    And that the software could just simulate 17 LEDs on 3 left hand 7-seg.   With the 543 being simulated on the 3 right hand 7-seg.

 

That is exactly how I would test it on real MAX7219 hardware.    i.e. using six 7-segs from an eight digit display.

 

The LEDs in #2 should be no different to the segments in a common-cathode display.

There are no series resistors.    Just plain LEDs where each segment is.

 

The MAX7219 controls the multiplexing and current setting in hardware.

Much simpler than home-wired current limited segment drivers with high current digit drivers.

Especially when your home-grown multiplexing software fails.    And the driven digit burns out.

 

If the OP gives a step by step description of the #1 and #2 simulation,   I would run it on hardware.

Without this detailed description,   I am reluctant to bother.    

 

David.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

david.prentice wrote:
The LEDs in #2 should be no different to the segments in a common-cathode display.
The one thing I guess you might get wrong is connecting the LED backwards ;-)

 

(but I wouldn't have thought that would have any influence on the L345 display though ?)

 

EDIT: I guess one possible approach would be to start with the working L345 display then add just ONE extra LED between one extra common and one segment line and see how catastrophically that affects things?

Last Edited: Thu. Feb 28, 2019 - 03:50 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I connected an 8-digit MAX7219 display to a mega128.   And ran a MPLABX project with my new SNAP.    (v5.10 because v5.15 seems to have broken JTAG)

 

It worked just fine.  i.e. binary patterns on left digits.  543 on right digits.

 

The OP could add another 4-digit display.  I am sure that Proteus would simulate ok.    And match my result.

 

Yes,   of course you should add one LED at a time.   Just as Cliff has suggested.

 

I am not familiar with Proteus.    Are you sure that some of your crossing wires are not "shorting"?

The convention is to have kinks for jump-over wires and blobs for connected wires.

 

David. 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I'm kind of tempted to buy a copy of Proteus to see what all the fuss is about but I sort of assume that:

 

 

is simply lines going over one another while:

 

 

are lines that actually connect ?

 

From other Proteus threads I've seen a run time "error log" where it actually tells you thinks it sees to be wrong like "HD44780 E signal asserted too early" or that kind of thing. I can't help wondering if it might say things like "MAX7219 DIG3 appears to be shortcircuit to Output F" if that were the case?

 

(then again who ever bothers to read warnings/errors? ;-)

 

I seem to remember someone (Brian?) saying there was a free (no save?) version of it for evaluation. Might be worth a shot I guess.

 

EDIT: OK so perhaps not??

 

 

Haven't downloaded it yet but I guess that's saying there are some "canned" simulation examples to play with but while you can create new circuit designs (no save) you can't actually simulate them. Oh well.

Last Edited: Thu. Feb 28, 2019 - 04:41 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I have often wondered about buying a Proteus licence.

And thought better of it.

 

You can buy many Arduinos,  Evaluation boards,   debuggers, ...,  displays,   LEDs, ...,  Ebay modules for less than the cost of a licence.

 

In the days of multi-$1000 hardware emulators the economics were different.

 

Mind you,   I look at student Proteus designs with multiple shift registers, resistors, ...

Proteus might simulate nicely but I would not want to hand-wire a prototype.    Especially when there are breakout boards and Ebay modules.

 

David.

This reply has been marked as the solution. 
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

clawson wrote:
The implication seems to be that once  DIG4..DIG6 are connected to the extra LEDs that not only don't they work but also DIG0..3 stop working

True, I did similar test without MAX7219
İssue is related to multiplexing frequency > 100Hz
There is no fault or bug, it is because of LED settings in proteus:
.
LED>Properties>ModelType="Analog"
Causes the issue
.
LED>Properties>ModelType="Digital"
Works fine
.
uc_coder wrote:
can somebody help me???????

Right click on LEDs and change model type to "Digital"

Majid

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

clawson wrote:
The one thing I guess you might get wrong is connecting the LED backwards ;-)

joeymorin wrote:
Your LEDs are backwards. The segment drive pins source current (VCC), while the digit select pins sink current (GND).

uc_coder wrote:
i changed the direction of leds but it didnt work.

 

Post #1:

 

Post #18:

 

 

m.majid wrote:
Right click on LEDs and change model type to "Digital"
Who knew? ;-)

"Experience is what enables you to recognise a mistake the second time you make it."

"Good judgement comes from experience.  Experience comes from bad judgement."

"Wisdom is always wont to arrive late, and to be a little approximate on first possession."

"When you hear hoofbeats, think horses, not unicorns."

"Fast.  Cheap.  Good.  Pick two."

"We see a lot of arses on handlebars around here." - [J Ekdahl]

 

Last Edited: Thu. Feb 28, 2019 - 06:34 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

joeymorin wrote:
Who knew? ;-)

LabCenter support!  How a 5min phone call could have saved days worth of forum posts!

Well now we know too.

 

Jim

 

Click Link: Get Free Stock: Retire early! PM for strategy

share.robinhood.com/jamesc3274

 

 

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

can i post a video on this forum so u will get clear idea what is happening when i connect led with display.  

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

You can attach it as a file to a post.  Max size is 10MB.

"Experience is what enables you to recognise a mistake the second time you make it."

"Good judgement comes from experience.  Experience comes from bad judgement."

"Wisdom is always wont to arrive late, and to be a little approximate on first possession."

"When you hear hoofbeats, think horses, not unicorns."

"Fast.  Cheap.  Good.  Pick two."

"We see a lot of arses on handlebars around here." - [J Ekdahl]

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Most folks would simply upload video to their YouTube account then give a link to it.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

clawson wrote:
Most folks would simply upload video to their YouTube account then give a link to it.
Most folks have a YouTube account.  Some folks don't.

 

In general, if a resource can be easily uploaded to this site (i.e. not too big), I prefer that to placing it on some third party site/service.  That way the resource stays with the thread forever (or until the next botched forum software upgrade).  YT isn't likely to go away, granted ;-)

"Experience is what enables you to recognise a mistake the second time you make it."

"Good judgement comes from experience.  Experience comes from bad judgement."

"Wisdom is always wont to arrive late, and to be a little approximate on first possession."

"When you hear hoofbeats, think horses, not unicorns."

"Fast.  Cheap.  Good.  Pick two."

"We see a lot of arses on handlebars around here." - [J Ekdahl]

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

got solution. Just changed led setting from analog to digital in proteus. Thank you all...