Seven segment data display problem

Status
Not open for further replies.

hardik.patel

Member level 5
Joined
Aug 15, 2012
Messages
94
Helped
1
Reputation
2
Reaction score
1
Trophy points
1,288
Activity points
2,008
Hi all,

here i interface 4-seven segments(common cathode) with atmega8 (avr gcc compiler).
My initial task is very simple that i need to display 0-9 on each display one by one...

but i faced two problems..

1) segments are not switching...means data is displayed on each segments not as per the MCU control.

2) digit "6" and "9" are not displaying correctly..
(in case of 6 -- 'a' segment missing ) (in case of 9 -- 'd' segment missing )

Here i had attached .rar which contains code as well as proteous file for your reference.
(test_uart.c and stepper.dsn for code as well as proteous file)
 

Attachments

  • New Folder.rar
    96.4 KB · Views: 127

The schematics is important in your case so we can tell if switching between digits is ok.
The IC you use for decoding and interface decimal to 7seg probably has this drawing for 6 and 9.
 
For those of us whom do not have Proteus installed, could you post the schematics as a PDF or screen capture?


BigDog
 

Circuit is attached here

https://obrazki.elektroda.pl/3363375900_1437818913.jpg

And code is here
Code:
#include <avr/io.h>
#include <inttypes.h>
#include <util/delay.h>


void perfect1()
{
		// data for common cathode
		PORTC=0x00; _delay_ms(5000); //o
		PORTC=0x01; _delay_ms(5000); //1
		PORTC=0x02; _delay_ms(5000); //2
		PORTC=0x03; _delay_ms(5000); //3
		PORTC=0x04; _delay_ms(5000); //4
		PORTC=0x05; _delay_ms(5000); //5
		
		PORTC=0x06; _delay_ms(5000); //6
		PORTC=0x07; _delay_ms(5000); //7	
		////PORTC=0x07; _delay_ms(1000); 
		//
		//
		PORTC=0x08; _delay_ms(5000);  //8
		PORTC=0x09; _delay_ms(5000); //9
		
	
}



int main()
{
	
    DDRC=0xFF;  // For LEDS
	DDRB=0xFF; // For FAN Speed LEDs
			
while(1)
{	


	
	PORTB=0b00000001;	perfect1();  _delay_ms(150);
	PORTB=0b00000010;	perfect1();  _delay_ms(150);
	PORTB=0b00000100;	perfect1();  _delay_ms(150);
	PORTB=0b00001000;	perfect1();  _delay_ms(150);
}
}
 

What specific display decoder/driver device is U2?

My tired eyes cannot make it out from the schematics.

BigDog
 

It's CD4511

- - - Updated - - -

1) segments are not switching...means data is displayed on each segments not as per the MCU control.

2) digit "6" and "9" are not displaying correctly..
(in case of 6 -- 'a' segment missing ) (in case of 9 -- 'd' segment missing )

1) The display component ignores segment control by open collector switches. The model apparently only accepts logic levels

2) The 7 segment code is according to 4511 datasheet specification.
 

So whats its solution??
It's a typical Proteus problem. The display component models real hardware very roughly. Give it a segment control that's recognized as 0/1 logic signal.
 

@FvM :

You mean h/w & s/w is ok...problem is with Proteous.
Am i right?

- - - Updated - - -

i had solved problem of segment control..just changes in the transistor control circuits. which is as shown in below fig.
https://obrazki.elektroda.pl/9512932800_1437971541.jpg

I got my solution from below link..just tried it n solved.


Again Big thanks to FVM, BigDogguru,xenos
 

2) digit "6" and "9" are not displaying correctly..
(in case of 6 -- 'a' segment missing ) (in case of 9 -- 'd' segment missing )

I had also tried 4543 to decode BCD to 7seg but facing same problem as "6" n "9" are not displaying "exact"

So kindly suggest me simple BCD to 7seg decoder which solve above problem.
 

I had also tried 4543 to decode BCD to 7seg but facing same problem as "6" n "9" are not displaying "exact"
In Proteus? CD4543 datasheet shows the segments a and d respectively.
 

Yes i had tried it in Proteous. Even i had referred its datasheet n also read as same as u that it shows 6 n 9 perfectly, but in proteous not as per datasheet.

Though i will try by purcasing it.
 

Status
Not open for further replies.

Similar threads

Cookies are required to use this site. You must accept them to continue using the site. Learn more…