Presentation is loading. Please wait.

Presentation is loading. Please wait.

Seven Segment Configuration Lecturer: Reza Arjmandi Autumn 2015 Lecture 5: Introduction 7Segment Configuration.

Similar presentations


Presentation on theme: "Seven Segment Configuration Lecturer: Reza Arjmandi Autumn 2015 Lecture 5: Introduction 7Segment Configuration."— Presentation transcript:

1 Seven Segment Configuration Lecturer: Reza Arjmandi Autumn 2015 Lecture 5: Introduction 7Segment Configuration

2 7Segment Structure A A B B G G F F C C E E D D DP A A B B G G E E D D

3 7Segment Structure A A B B G G F F C C E E D D DP A A B B G G F F C C E E D D VCC G F A B E D C DP G F A B E D C Common Anode Common Cathode

4 7Segment Common Cathode A A B B G G F F C C E E D D DP E D B A Common Cathode C F G کد معادل ABCDEFG عدد 0x5B11011012 PORTA=0x5B 1 1 0 1 1 0 1 A A B B G G E E D D

5 7Segment Common Cathode A A B B G G F F C C E E D D DP G F A B E D C Common Cathode عدد کد معادل 00x3F 10x06 20x5B 30x4F 40x66 50x6D 60x7D 70x07 80x7F 90x6F a0x5F b0x7C c0x39 d0x5E e0x7B Example: #include //include Header file unsigned char Seg[10]={0x3F,0x06,0x5B,0x4F,0x66,0x6D,0x7D,0x07,0x7f,0x6F}; Void main(void) { DDRA=0xFF; //config PORTA as output PORTA=Seg[2]; //7Seg show 2 number }

6 7Segment Common Anode A A B B G G F F C C E E D D DP E D B A Common Anode C F G کد معادل ABCDEFG عدد 0xA400100102 PORTA=0xA4 0 0 1 0 0 1 0 A A B B G G E E D D VCC

7 7Segment Common Anode A A B B G G F F C C E E D D DP G F A B E D C Common Anode عدد کد معادل 00xC0 10xF9 20xA4 30xB0 40x99 50x92 60x83 70xF8 80x80 90x90 a0xA0 b0x82 c0xC6 d0xA1 e0x84 Example: #include //include Header file unsigned char Seg[10]={0xC0,0xF9,0xA4,0xB0,0x99,0x92,0x83,0xF8,0x80,0x90}; Void main(void) { DDRA=0xFF; //config PORTA as output PORTA=Seg[2]; //7Seg show 2 number } VCC

8 7Segment-Refreshing Bias A A B B G G F F C C E E D D E D B A C F G A A B B G G F F C C E E D D A A B B G G F F C C E E D D A A B B G G F F C C E E D D A A B B G G F F C C E E D D A A B B G G F F C C E E D D A A B B G G F F C C E E D D A A B B G G F F C C E E D D Number of PORT’s NOT enough. How to connect 8 SevenSegment? Connect via Refreshing Bias A A B B G G F F C C E E D D E D B A C F G A A B B G G F F C C E E D D A A B B G G F F C C E E D D A A B B G G F F C C E E D D A A B B G G F F C C E E D D A A B B G G F F C C E E D D A A B B G G F F C C E E D D A A B B G G F F C C E E D D 0 1 1 1 1 1 1 1 0x06 -> 1 1 0 1 1 1 1 1 1 0x5B -> 2 1 1 0 1 1 1 1 1 0x4F -> 3 0x66 -> 4 1 1 1 0 1 1 1 1 1 1 1 1 0 1 1 1 0x6D -> 5 1 1 1 1 1 0 1 1 0x7D -> 6 0x07 -> 7 1 1 1 1 1 1 0 1 1 1 1 1 1 1 1 0 0x80 -> 8 11111110 Shift Register IC

9 7Segment-Refreshing Bias-Example #include unsigned char __flash SEG[10]={0XC0,0XF9,0XA4,0XB0, 0X99,0X92,0X82,0XF8,0X80,0X90}; int i,j; void main() { DDRC=0XFF; DDRD_Bit0=1; DDRD_Bit1=1; while(1) { for(i=0;i<=99;i++) { for(j=0;j<=9;j++) { PORTD=0X02; PORTC=SEG[i%10]; __delay_cycles(10000); PORTD=0X01; PORTC=SEG[i/10]; __delay_cycles(10000); } برنامه ای بنویسید که اعداد 0 تا 99 را شمارش کند و بر روی 7Segment نمایش دهد.( با استفاده از روش Refresh)

10 7Segment-Example #include unsigned char __flash SEG[10]={0X3F,0X06,0X5B, 0X4F,0X66,0X6D,0X7D,0X07,0X7F,0X6F}; int i; main() { DDRC=0XFF; DDRD_Bit4=0; PORTD_Bit4=1; while(1) { if(PIND_Bit4==0) { i++; if(i>9) i=0; PORTC=SEG[i]; __delay_cycles(300000); } برنامه ‌ ای بنویسید که با هر بار فشرده شدن کلید یک شماره به عدد روی 7Segment اضافه کند

11 Input/Output-Current Limit باید دقت کرد که مجموع جریان sink یا source شده از یک پورت نباید از 100 میلی آمپر تجاوز کند و جریان کل پورت ها نیز نباید بیش از 200 میلی آمپر شود.( برای PDIP Package ، جزئیات بیشتر در دیتاشیت ) Maximum current: 100mA How to amplify current or switch High voltage? Answer: -PNP Transistor(PNP,NPN,FET,MOS,…) -Drivers -Traiac -Relay -… A A B B G G F F C C E E D D

12 7Segment-Decoder IC Decoder for 7Segment A A B B G G F F C C E E D D 0x66 100 -> 4 A A B B G G F F C C E E D D 7448: for Common Anode 7Segment 7447: for Common Cathode 7Segment Example: #include int i; main() { DDRA=0xFF; PORTA=4; }

13 7Segment-Refreshing Bias IC 24 23 22 21 20 19 18 17 16 15 14 13 DOUT SEG D SEG DP SEG E SEG C V+ ISET SEG G SEG B SEG F SEG A CLK DIN DIG 0 DIG 4 GND DIG 6 DIG 2 DIG 3 DIG 7 GND DIG 5 DIG 1 LOAD(CS) MAXIM MAX7219 MAX7221 SPI Interface

14 Contact us www.e-system.ir Info@e-system.ir


Download ppt "Seven Segment Configuration Lecturer: Reza Arjmandi Autumn 2015 Lecture 5: Introduction 7Segment Configuration."

Similar presentations


Ads by Google