zeke 693 Posted August 21, 2011 Share Posted August 21, 2011 Now I remember where I saw that LCD module! I used to repair cell phones for a living many years ago. That LCD was in the handset for a cell phone that was made in the UK. I wished that I could remember the manufacturer name. I'll see if I can find more info on it. bluehash and nuetron 2 Quote Link to post Share on other sites
nuetron 64 Posted November 15, 2011 Author Share Posted November 15, 2011 Hey guys, I found another 7-digit module like the one above. One difference though, this one is ORANGE! And here is a simple program I used to test it: #include "MSP430G2252.h" #define NUM0 0x3F #define NUM1 0x06 #define NUM2 0x5B #define NUM3 0x4F #define NUM4 0x66 #define NUM5 0x6D #define NUM6 0x7D #define NUM7 0x07 #define NUM8 0x7F #define NUM9 0x6F int NUMBER=0; char DIGI[7] = {NUM0,NUM1,NUM2,NUM3,NUM4,NUM5,NUM6}; const char BIT[8] = {0x01,0x02,0x04,0x08,0x10,0x20,0x40,0x80}; int DIGIT=0; int c = 0; void main( void ){ // Stop watchdog timer to prevent time out reset WDTCTL = WDTPW + WDTHOLD; BCSCTL1 = CALBC1_1MHZ; DCOCTL = CALDCO_1MHZ; P1OUT = 0x7F; P1DIR = 0x7F; P2SEL = 0x00; // allow 2.6-2.7 to output P2OUT = 0x7F; P2DIR = 0x7F; P1IES = BIT7; P1IFG = 0; P1IE = BIT7; P2IES = BIT7; P2IFG = 0; P2IE = BIT7; __enable_interrupt(); for(;{ P2OUT = ~BIT[c]; P1OUT = DIGI[c]; __delay_cycles(50); P1OUT = 0x00; c++; if(c == 7) c = 0; } } #pragma vector=PORT1_VECTOR __interrupt void PORT1_ISR(void) { NUMBER++; if(NUMBER == 10) NUMBER = 0; switch (NUMBER){ case 0: DIGI[DIGIT] = NUM0; break; case 1: DIGI[DIGIT] = NUM1; break; case 2: DIGI[DIGIT] = NUM2; break; case 3: DIGI[DIGIT] = NUM3; break; case 4: DIGI[DIGIT] = NUM4; break; case 5: DIGI[DIGIT] = NUM5; break; case 6: DIGI[DIGIT] = NUM6; break; case 7: DIGI[DIGIT] = NUM7; break; case 8: DIGI[DIGIT] = NUM8; break; case 9: DIGI[DIGIT] = NUM9; break; } P1IFG &= ~BIT7; } #pragma vector=PORT2_VECTOR __interrupt void PORT2_ISR(void) { DIGIT++; if(DIGIT == 7) DIGIT = 0; P2IFG &= ~BIT7; } Quote Link to post Share on other sites
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.