interfacing 7 segment display with HCS12E128 microcontroller

i am connecting 8 pieces of 7 segment displays with a microcontroller, the text "CALEDONI" is displayed but its stand still.. i need to know how to make it flash? the source code which is compiled by the CodeWarrior software is written below..


thank u ^.^




#pragma LINK_INFO DERIVATIVE "SampleS12"

void initPort(void);
void initPort(void) {
DDRA=0xFF;
DDRB=0xFF;
}
void delay(unsigned int);
void delay(unsigned int x) {
int y;
while(x>0){
for(y=0;y<200;y++) {;}
x--;
}
}

void main(void) {
char alpha[]={0x08,0x03,0x46,0x21,0x06,0x0E,0x10,0x09,0x79,0x71,0x7F,
0x47,0x7F,0x2B,0x40,0x0C,0x7F,0x0F,0x12,0x07,0x41,0x7F,0x7F,0x7F,0x11,0x7F};
char segment[]={
0xFE,0xFD,0xFB,0xF7,0xEF,0xDF,0xBF,0x7F
};
char size;
unsigned char x;
unsigned int disp;
char name[]="CALEDONI";
initPort();


EnableInterrupts;
for(;😉 {
for(size=0;name[size+7]!='\0';size++){
for(disp=0;disp<75;disp++){
for(x=0;x<8;x++){
PORTA = alpha[name[size+x]-65];
PORTB = segment[x];
delay(5);
PORTB = 0xFF;
delay(0);
}
}
}


}
}

Replies

  • Harshad Italiya
    Harshad Italiya
    You want to Blink Text on Display or Want to Flash letter one by one?

    If you want to blink whole word then simply Turn off once you send all the character data to segment. You are using any shift register IC to Display or you have connected all 64 Pins with segment?
  • suga_babe
    suga_babe
    yeah i want the whole text to blink.. they are connected directly
    any idea where i can get a C program for this?
  • Harshad Italiya
    Harshad Italiya
    First tell me one thing. The code you posted is working or not? I mean by this code you are able to get steady Text on Segment or not?
  • suga_babe
    suga_babe
    yes it is working.. up to here the text is only stand still
  • Harshad Italiya
    Harshad Italiya
    or(;😉 {
    for(size=0;name[size+7]!='\0';size++){
    for(disp=0;disp<75;disp++){
    for(x=0;x<8;x++){
    PORTA = alpha[name[size+x]-65];
    PORTB = segment[x];
    delay(5);
    PORTB = 0xFF;
    delay(0);
    }
    Now after delay(0) Send 0x00 or 0xFF to all your segments depending on your segment display Common Anode or Common Cathode. then keep same data for little time say one second after that send the data again from your array consisting your texts.

    get the point or not?
  • suga_babe
    suga_babe
    umm.. i didnt really get the idea :s
    i tried different ways but still i didnt get the result.. i should probably mention i am not an expert when comes to C
    thanking you all for any help provided
  • Harshad Italiya
    Harshad Italiya
    suga_babe
    umm.. i didnt really get the idea :s
    i tried different ways but still i didnt get the result.. i should probably mention i am not an expert when comes to C
    thanking you all for any help provided
    Let me know if you still want to give it a try we can work on this. Don't give up.
  • suga_babe
    suga_babe
    i am not giving up at all.. i am looking forward to getting more suggestions
  • Harshad Italiya
    Harshad Italiya
    suga_babe
    i am not giving up at all.. i am looking forward to getting more suggestions
    Is it possible to post the circuit diagram So i can simulate it here at my side.

You are reading an archived discussion.

Related Posts

If a number is wxyz, where w,x,y,z are digits,and are multiplied by 4, then the digits are reversed and hence the new number will be zyxw. Then what is the...
McAfee Paper conducted in BANGALORE : 1. Written 2. Technical Interview 3. HR Here was one puzzle like there are 6 members in a family n they are teacher, student,...
GATE 2012 online application deadline is approaching fast. The official website says that the online application forms won't be accepted after 23:00 on October 17. However, the whole application procedure...
Geometric Question Paper and Answers: I Test : General Intelligence II Test : Technical test III Test : C-language I Test Some of the questions what I have Iam sending....
ROUND-1: - Written Test 30 quantitative aptitude questions ONLY (refer R.S aggarwal). Time limit of 45mins Section 1: 4 flow charts.. each flow chart consisted of 5 questions.. so totally...