Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

[SOLVED] Can this 7 segment be made to work?

Status
Not open for further replies.
Advanced Member level 6
Joined
Dec 4, 2012
Messages
4,280
Helped
822
Reputation
1,654
Reaction score
791
Trophy points
1,393
Location
Bangalore, India
Visit site
Activity points
0
Can this 7 segment be made to work?




The problem is when The left most digit is ON and the other two has to be OFF. But can't turn OFF the other 2 digits as one is CC type and another CA type.
 

The diagram shows different part numbers for the 7-segment displays. Normally I would think they need to be identical.

However by mixing CC and CA, the IC apparently makes one activation wire serve two digits (thus reducing clutter).
Simultaneously the IC pulls the 7 segment wires high or low, accordingly.

Apparently this action is built-in, and you absolutely must put a CC digit in one position, and a CA digit in the other position...

Or else the IC is extremely intelligent, and can detect whether each digit is CC or CA, so that it can send the correct activation signal to each digit at the right time.
 
I modified the circuit to use 3 CC SSD but the code I have written is not working properly. Can you please find the mistake. I am not getting right ADC value. Maybe it is also a problem with ADC. I am simulating in Proteus and also hardware. I am getting same result in both. I am attaching my mikroC Project files. I need to display integer values.
 

Attachments

  • 16F877A.rar
    51.2 KB · Views: 81
can u proved it code in asm formet & hex with pic16f676 lcd & 3 digit 7 segment display.
 

No, I don't write code in asm. I use mikroC Compiler. Do you want 3 CC type display code or 2 CC type + 1 CA type display code?

PIC16F877A hex file attached + proteus file. It's not working in Proteus. This is for 2 CC type and 1 CA type displays. Test it in hardware with 4 MHz and reply.
 

Attachments

  • 16F877A.rar
    22 KB · Views: 86
Updated Circuit and hex file with 2 CC type and one CA type display.

@srenjis

Wait for a day. I will post the hex for 3 CC type display but it will be for PIC16F877A.
 

Attachments

  • 16F877A b.rar
    21.1 KB · Views: 83
jayanth.devarayanadurga thanks four your quick replay, can u post the source code 4 the same
 

Here is the PIC16F877A version with 3 CC type displays. You don't need current limiting resistors on PORTC or transistors on PORTD. You have to supply 2.7V for the SSDs.
 

Attachments

  • 16F877A3CC.rar
    20.7 KB · Views: 79

please go through this code

Code:
#include <16F676.h>
#device adc=10 
#fuses INTRC_IO,NOWDT,PUT,NOPROTECT,BROWNOUT,NOMCLR
#use delay (clock=4000000) // 4MHz clock

#rom  0x3ff={0x3444}

#byte PORTA = 0x05
#byte PORTC = 0x07
#byte TRISA = 0x85
#byte TRISC = 0x87

#define SPORTA PORTA
#define SPORTC PORTC

#define  TICKS_BETWEEN_INTERRUPTS      5000 //5000
#define  INTERRUPT_OVERHEAD            35
#define  TMR1RESET (0xFFFF-(TICKS_BETWEEN_INTERRUPTS-INTERRUPT_OVERHEAD))

const char SegCode[11] = {0x40,0x57,0x22,0x06,0x15,0x0C,0x08,0x56,0x00,0x04,0xFF};
	//                       0    1    2    3    4    5    6    7    8    9
const char Column[3]   = {0x02,0x01,0x04};
static char Segment[3] = {0x7f,0x7f,0x7f};	
static unsigned char ColCount=0x00;

void CPU_SETUP(void);
void Display(void);
void HTO7S(unsigned int32 Num);

byte i;
unsigned int32 result;

#INT_TIMER1
void Timer1(void)
{	
	set_timer1(TMR1RESET);
	Display();	
}	

void main()
{		
	unsigned char i;
	
	CPU_SETUP();
	
	while(true)
	{			
		result=0;
		for (i=0;i<20;i++)
		{
			set_adc_channel(3); 
			delay_ms(1); 
			result=result+read_adc();
		}
			//result = 0x3fe;									
	 	HTO7S(result/20);	
		delay_ms(200);		    
	}
	
}

void CPU_SETUP()
{
 	
   setup_comparator(NC_NC_NC_NC);	// not use comparator module
   setup_adc_ports( sAN3 | VSS_VDD); 
   setup_adc(ADC_CLOCK_DIV_64);
   TRISA=0b00011000;
   PORTA=0x27;
   TRISC=0b00000000;
   PORTC=0x37;
   
   
   setup_timer_1(T1_INTERNAL|T1_DIV_BY_1);
   set_timer1(TMR1RESET);
   enable_interrupts(GLOBAL);
   enable_interrupts(INT_TIMER1);   
}

//-------------------------------------
// Display routine
//-------------------------------------
void Display()
{
	PORTA = 0b00100111;	  // off all digits column and Segment G
	PORTC = 0b00111111;   // off segment a-f	
	delay_cycles(2);
	

	if (ColCount>=3) 
	ColCount=0;
    	
	SPORTC = Segment[ColCount];
	SPORTA = ((Segment[ColCount] & 0b01000000)>>1) | (Column[ColCount]^0x07);
	ColCount++;				
}	

//--------------------------------------
// Convet HEX 2 byte to 7-Segment code
//--------------------------------------
void HTO7S(unsigned int32 Num)
{

	unsigned int32 res;

	
	Segment[0]=SegCode[30*Num/10230];
	if (Segment[0]==0x40) 
	Segment[0]=0xFF;
	
	res = 30*Num%10230;
	Segment[1]=SegCode[10*res/10230];
	res=10*res%10230;
	Segment[2]=SegCode[10*res/10230];
}
this is from https://www.coolcircuit.com/project/meter/

this circuit uses three transistors for 7 segment display and it can only measure voltage up to 30.Is it possible to avoid the transistors,and then make it to measure 0 to 500v

please post the source code for the PIC16F877A version with 3 CC type displays. You don't need current limiting resistors on PORTC or transistors on PORTD. You have to supply 2.7V for the SSDs. 30 volts Panel Volt Meter Using Pic mcu.jpg
 
Last edited by a moderator:

Here is the version which measures 0 to 30V. The connections should be as shown in the image.

100273d1388100812-3cc1.png


500V version attached.
 

Attachments

  • 16F877A3CC b.rar
    22 KB · Views: 84
  • 3CC1.png
    3CC1.png
    30.7 KB · Views: 151
  • 16F877A3CC 500V.rar
    22 KB · Views: 85
Last edited:

Please consider signal conditioning and display refresh rate to have stable voltage measurement.
 

while measuring ac voltage the display is not stable ,can you post your mikroC Project files.is it possible to do the same project in pic 16f 676?
 

please make sure to check your adc input voltage first, the key is smooth input signal into adc, you won't be able to make stable measurement if too much ripple or high slew rate in the input voltage.
 

You have to make the adc input stable. Check the adc with constant DC voltage. If it works then the problem is with ripple of DC input voltage. You have to use good filtering with adc input circuit.

Code for 3 CC type display.

Maybe it can be ported to 16F676 but I don't have time to do that. You use both ROM and RAM to store the arrays and try yourself.
 

Attachments

  • 16F877A3CC.rar
    93 KB · Views: 88
Last edited:
If you have 10 adc in your PIC then all the adc channels value can be displayed.

yes sir
i want display 3 adc disply like
Code:
	 __ __
	|     |
	|     |
	 __ __	 
	|     |
	|     |


	 __ __	 
	|     |
	|     |
	 __ __


value of AN0

delay 2 sec

	 __ __
	|     |
	|     |
	 __ __	 
	|     |
	|     |

	 
	|     
	|     
	 	 
	|     
	| 


value of AN1

delay 2 sec


	 __ __
	|     |
	|     |
	 __ __	 
	|     |
	|     |


	|     |
	|     |
	 	 
	|     |
	|     |

value of AN2

delay 2 sec
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top