:: I'm building a 3 digit LCD display trying to use a Microchip's :: AY0438 :::: controller. Even though you have yet to acknowledge the code I sent twice directly to you, here is some outline code that directly 'talks' to glass LCD's without the need for a controller. I haven't looked up the uChip part, but doesn't its' datasheet have any code examples in it? The com pin goes to the centre of two resistors in series. The ends of the resistors connecting one each to Vcc and Ground. IOW a voltage divider. I couldn't be bothered with comments in this version! C code for 2 common glass LCD 3.5 digits /************************************************************************ ** Program for 3.5, 4.5 digit controllerless LCD's ** ** ** ** v0.1b ** **copyright C.D. Barnard 7 February 2004 ** ** ** ************************************************************************/ /* PortB = LSD ** PortC = Dig ** PortD = MSD ** PortE = DP,LoBat, + ** PortA = COM ** ** Each set of segments are on the bottom 6 bits of the port, this leaves ** portC bit 7 (Rx) free. ** **/ #define COM bRA0 #include //#include #include void display(); void format(unsigned int n); void setup(); /*uint*/ // WORD power_10(WORD digit); void Interrupt(); BYTE phase=0; struct flags { bit dummy; bit dummy; bit dummy; bit dummy; bit dummy; bit dummy; bit dummy; bit tmr0F; } flag; BYTE x,temp; WORD z,no; const char segments[12]={0x3F,0x06,0x5B,0x4F,0x66,0x6D,0x7D,0x07,0x7F,0x67,0x6E,0x79}; This depends on glass column layout. // 0 1 2 3 4 5 6 7 8 9 Y E BYTE digits[4]; void main() // Function to { //unsigned int no; setup(); digits[3]=0; no=0; format(no); while(1) { display(); Wait(100); format(no); } /* digits[2]=segments[10]; digits[1]=segments[11]; digits[0]=segments[5]; */ } void setup() { TMR0=0; ADCON1=0x07; PORTA=0x01; PORTB=0; PORTC=0; PORTD=0; PORTE=0; TRISB=0; TRISA=0; TRISC=0; TRISD=0; TRISE=0; OPTION_REG=(1<= 1000) { x++; n-=1000; } digits[3]=segments[x]; x=0; while(n >=100) { x++; n -= 100; } digits[2]=segments[x]; x=0; while (n >= 10) { n-=10; x++; } digits[1]=segments[x]; digits[0]=segments[n]; } -- cdb, colin@btech-online.co.uk on 6/11/2008 Web presence: www.btech-online.co.uk Hosted by: www.1and1.co.uk/?k_id=7988359 -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist