ionut_h Posted June 26, 2009 Share Posted June 26, 2009 salut,am un afisor lcd , nu gasesc modelul pe net.am incercat sa aflu ce reprezinta cei 29 de pini ai lui.am aflat segmentele a 2 digiti.va rog sa-mi spuneti cum fac legatura la un PIC?care e catodul in cazul asta?multumesc. Quote Link to comment Share on other sites More sharing options...
ionut_h Posted June 26, 2009 Author Share Posted June 26, 2009 sunt 2 digiti 2 si 3 cu punct intre ei.segmentele s-au obtinut masurand pinii 2 cu 2. Quote Link to comment Share on other sites More sharing options...
ionut_h Posted June 26, 2009 Author Share Posted June 26, 2009 am 2 segmente, deci 2 drivere CD4056. imi trebuie pic cu 18 pini ( 16f84) sau 40 pini (15f877a) ?intrarile pt cd4056 vin de la LCD?ce reprezinta intrarile a,b,c a lui cd4056?se poate sa-mi arati va rog o schema cu picul 16f877a si cu driverele CD4056? multumesc. Quote Link to comment Share on other sites More sharing options...
chetross Posted June 26, 2009 Share Posted June 26, 2009 cd4056 observasem ca e pentru lcd-uri. ce sa faci cu el la 7seg ? iti dau ce am facut eu de curand, m-am jucat printre altele si cu 4digiti avand catod comun nu ai nevoie de 16pini pt 2 digiti pt ca poti face foarte usor multiplexare, si ramai cu 10 pe portul b 7:0 pui liniile de date (a,b,c,...) iar pe portul c 4:0 ai comanda fiecarui digit + general obs: - trebuie sa adaptezi la 2 digiti totul. - codul e luat copy paste selectiv de la mine, si trebuie sa te mai uiti tu .. in principiu ar trebui sa numere pana la 99 #include <pic.h>#include <stdio.h>#include <string.h>#include <math.h>#include <stdlib.h>#define t2 500#define t4 1bank2 unsigned short int time2, time4;bank2 unsigned int iter;// *********** region 7segments ************** //const char SSEG[] = { // de la drepta la stanga, ".GFEDCBA" 0b00000101, // 0, LED Segment: A,B,C,D,E,F // de la drepta la stanga, ".GFEDCBA" 0b11011101, // 1, LED Segment: B,C 0b01000110, // 2, LED Segment: A,B,D,E,G 0b01010100, // 3, LED Segment: A,B,C,D,G 0b10011100, // 4, LED Segment: B,C,F,G 0b00110100, // 5, LED Segment: A,C,D,F,G 0b00100100, // 6, LED Segment: A,C,D,E,F,G 0b01011101, // 7, LED Segment: A,B,C 0b00000100, // 8, LED Segment: A,B,C,D,E,F,G 0b00010100 // 9, LED Segment: A,B,C,D,F,G };bank2 unsigned char DispDigit[4];bank2 unsigned char DigitCount;void SSEG_display(float);// *********** endregion 7segments ************** //void main(void) { #asm("sei") #endasm TRISB = 0x00; TRISC = 0x00; // ********* region TMR0 setup ********** // // use internal CLK - !OPTION<5>, prescaler belongs to TMR0, // !WDT - !OPTION<3>, 1/64 prescaler OPTION<2,1,0> OPTION = 0b10000111; TMR0 = 236; // GIE = 1; // enable global interrupts INTCON<7> T0IF = 0; // clear interrupt flag INTCON<2> T0IE = 1; // enable Timer0 interrupt flag INTCON<5> // ****** endregion TMR0 setup ********** // // ******** region 7segments setup ********* // RC4 = 1; DigitCount = 0; DispDigit[0]=SSEG[0]; // Zero Digit DispDigit[1]=SSEG[0]; // Zero Digit DispDigit[2]=SSEG[0]; // Zero Digit DispDigit[3]=SSEG[0]; // Zero Digit // ******** endregion 7segments setup ****** // time2 = t2; time4 = t4; iter = 0; #asm("cli") #endasm while(1) { if (time4 == 0) task4(); // multiplexare 7segments }}void task2(void){ time2 = t2; SSEG_display(++iter); if(iter == 99) iter=0;}void task4(void){ time4 = t4; PORTB = DispDigit[DigitCount]; switch(DigitCount){ case 0: { RC0=0;RC1=1;RC2=1;RC3=1; break; } case 1: { RC0=1;RC1=0;RC2=1;RC3=1; break; } case 2: { RC0=1;RC1=1;RC2=0;RC3=1; break; } case 3: { RC0=1;RC1=1;RC2=1;RC3=0; break; } default: break; } DigitCount++; if (DigitCount > 3) DigitCount=0;}void SSEG_display(float power){ if(power >= 1000) return; if(power >= 100) { DispDigit[0] = SSEG[power%10]; power/=10; DispDigit[1] = SSEG[power%10]; power/=10; DispDigit[2] = SSEG[power]; DispDigit[3] = SSEG[0]; } else if(power <= 99) { DispDigit[0] = SSEG[power%10]; power/=10; DispDigit[1] = SSEG[power]; DispDigit[2] = SSEG[0]; DispDigit[3] = SSEG[0]; } else { DispDigit[0] = SSEG[power]; DispDigit[1] = SSEG[0]; DispDigit[2] = SSEG[0]; DispDigit[3] = SSEG[0]; }}void interrupt isr(void){ if (T0IE && T0IF ) { if (time4 > 0) --time4; T0IF = 0; TMR0 = 236; } }bafta Quote Link to comment Share on other sites More sharing options...
ionut_h Posted June 27, 2009 Author Share Posted June 27, 2009 problema e ca am modul LCD, deci trebuie driver.la driverul cd4056, sunt 7 pini pt cele 7 segmente.mai sunt 3 pini ,bcd input, unde trebuie legati ? Quote Link to comment Share on other sites More sharing options...
ionut_h Posted June 27, 2009 Author Share Posted June 27, 2009 deocamdata am driver-ul MMC4054, 4 segment display driver.cum il pot folosi ca sa il leg la modulul meu lcd?ce inseamna intrarile si iesirile?multumesc. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.