#include char data[27][7]={ {0X00,0X00,0Xff,0X09,0X09,0Xff,0x00}, //a {0x00,0xff,0x89,0x89,0x89,0xfe,0x00}, //b {0x00,0x00,0x7e,0x81,0x81,0x01,0x00}, //c {0x00,0x00,0xff,0x81,0x81,0x7e,0x00}, //d {0x00,0x09,0x89,0x89,0xff,0x00,0x00}, //e {0x00,0x09,0x09,0x09,0xff,0x00,0x00}, //f {0x00,0xf9,0x89,0x89,0x81,0xff,0x00}, //g {0x00,0xff,0x08,0x08,0x08,0xff,0x00}, //h {0x00,0x01,0x81,0xff,0x81,0x01,0x00}, //i {0x00,0x01,0x7f,0x81,0x81,0x41,0x00}, //j {0x00,0xc1,0x22,0x14,0x08,0xff,0x00}, //k {0x00,0x80,0x80,0x80,0x80,0x80,0xff}, //l {0x7f,0x02,0x04,0x08,0x04,0x02,0x7f}, //m {0x7f,0x20,0x10,0x08,0x04,0x02,0x7f}, //n {0x00,0x3e,0x41,0x41,0x41,0x3e,0x00}, //o {0x00,0x0e,0x11,0x11,0x11,0x7e,0x00}, //p {0x80,0x3e,0x61,0x41,0x41,0x3e,0x00}, //q {0x00,0x46,0x29,0x19,0x09,0x7f,0x00}, //r {0x00,0x39,0x49,0x49,0x49,0x4f,0x00}, //s {0x01,0x01,0x01,0x3f,0x01,0x01,0x01}, //t {0x3f,0x40,0x40,0x40,0x40,0x3f,0x00}, //u {0x0f,0x10,0x20,0x20,0x10,0x0f,0x00}, //v {0x3f,0x40,0x20,0x20,0x40,0x20,0x1f}, //w {0x41,0x22,0x14,0x08,0x14,0x22,0x41}, //x {0x01,0x02,0x04,0xf8,0x04,0x02,0x01}, //y {0x00,0x43,0x45,0x49,0x51,0x61,0x00}, //z {0x00,0x00,0x00,0x00,0x00,0x80,0x00} //. }; char arr[91]; short rounds=0,i=0; void setString(char *); void reverse_array(); void main(void) { WDTCTL = WDTPW | WDTHOLD; // Stop watchdog timer BCSCTL1 = CALBC1_8MHZ; //changing the DCO's oscillations to 16MHz DCOCTL = CALDCO_8MHZ; setString(" samarth "); //13 characters are necessary P1DIR = 0xff; P1OUT = 0x00; P2REN |= BIT0; // P2 Enable Pullup/Pulldown P2OUT = 0; // P2 pullup P2IE |= BIT0; // P2 interrupt enabled P2IES &= ~BIT0; // P2 Hi/lo falling edge P2IFG &= ~(BIT0); // P2IFG cleared just in case _EINT(); _BIS_SR(GIE); // Enter interrupt while(1) { } } void setString(char *str) { int a,b,c=0; //loop vairables, counter registers //a = scanning the string //b = scanning the character [6 frames] //c = points to the output, i.e. arr[] for(a=0;a<13;a++) //scan the whole string once { if(str[a]>='a' && str[a]<='z') //if the character is an alphabet { for(b=6;b>=0;b--) //then pick 7 frames from the database [data] { arr[c]=data[str[a]-'a'][b]; //and put into the video ram = arr c++; //increament the output counter } } else if(str[a]=='.') //if the character is a '.' { for(b=0;b<7;b++) //pick 7 corresponding frames from the data[] { arr[c]=data[26][b]; //and place them into the arr[] c++; //increament the output counter } } else { for(b=0;b<7;b++) //for other characters, display a blank { arr[c]=0x00; c++; } } } reverse_array(); //reverse the arr[], because the will have to displayed as a mirror } void reverse_array() { int a=0,b=90; //reversing the arr[] char temp; for(;a 1 sec, 30720 -> 1 min TA0CTL = TASSEL_2 + ID_3 + MC_1; // set the first timer to get the time of revolution, ACLK, /1, upmode rounds++; } else if(rounds==1) { TA0CTL = TASSEL_2 + ID_3 + MC_0; //set the first timer TA1CCR0 = TA0R/91; // divide the time by 91 TA1R=0; TA1CTL = TASSEL_2 + ID_3 + MC_1; // set the second timer, ACLK, /1, upmode TA1CCTL0 = CCIE; // CCR0 interrupt enabled rounds=0; i=0; //show the data from the first frame TA0R=0; } P2IFG=0; } #pragma vector=TIMER1_A0_VECTOR __interrupt void TIMER1_A0_ISR_HOOK(void) { P1OUT=arr[i]; //when the timer expires, it displays the value of the next frame i++; //stored in the arr if(i>=91) i=0; //when i = 91, i.e. the last frame, display from the first frame }