Help - Show ADC value on Three Seven Segment Display

Thread Starter

pauzan

Joined Mar 11, 2019
9
Hi, i'm trying to build a digital voltmeter using ATmega8535.
But i have the problem of interfacing the ADC value on seven segment.
i use ATMEL STUDIO 6 for coding and PROTEUS for the circuit.
Here i'm attaching the file.
Thank you in advance
 

Attachments

DickCappels

Joined Aug 21, 2008
10,170
You need to convert the ADC output to BCD and then convert the BCD to 7 segment.

You can use Atmel Application note AN204 for BCD conversion routines.
ttps://docplayer.net/20779161-8-bit-microcontroller-application-note-avr204-bcd-arithmetics-features-introduction-16-bit-binary-to-5-digit-bcd-conversion-bin2bcd16.html

Below is a link to a project that is a digital voltmeter based on the ATMEGA8, perhaps you can use some of it.
http://cappels.org/dproj/10_Bit_LED...ng_LED_Digital_Panel_Meter_Using_ATMEGA8.html
 

shteii01

Joined Feb 19, 2010
4,644
Notice the 7 segment display that Dick is using with ATmega8. He is using 7 lines to light up digit, and 4 lines to select which digit to light up. You do this fast enough and the eye will not notice any flickering.

This is important because your Proteus picture shows that you are using SAME 7 lines on all 3 displays, which means that all three displays will show the same digit.
 

JohnInTX

Joined Jun 26, 2012
4,787
Notice the 7 segment display that Dick is using with ATmega8. He is using 7 lines to light up digit, and 4 lines to select which digit to light up. You do this fast enough and the eye will not notice any flickering.

This is important because your Proteus picture shows that you are using SAME 7 lines on all 3 displays, which means that all three displays will show the same digit.
It looks like TS has it hooked up with the digit select transistors Q1-Q3 and Q1 is showing that its being driven by PB0. But it also looks like Proteus thinks that the digit commons are not connected to the collectors of the transistors or are specified as GND because even the unselected collectors are showing '0' as are all of the common pins on the digits.
 

shteii01

Joined Feb 19, 2010
4,644
It looks like TS has it hooked up with the digit select transistors Q1-Q3 and Q1 is showing that its being driven by PB0. But it also looks like Proteus thinks that the digit commons are not connected to the collectors of the transistors or are specified as GND because even the unselected collectors are showing '0' as are all of the common pins on the digits.
Thank you.
 

Thread Starter

pauzan

Joined Mar 11, 2019
9
You need to convert the ADC output to BCD and then convert the BCD to 7 segment.

You can use Atmel Application note AN204 for BCD conversion routines.
ttps://docplayer.net/20779161-8-bit-microcontroller-application-note-avr204-bcd-arithmetics-features-introduction-16-bit-binary-to-5-digit-bcd-conversion-bin2bcd16.html

Below is a link to a project that is a digital voltmeter based on the ATMEGA8, perhaps you can use some of it.
http://cappels.org/dproj/10_Bit_LED...ng_LED_Digital_Panel_Meter_Using_ATMEGA8.html
the atmel application note AN204 URL could not open
 
Top