C code...plz need help!!!!

Discussion in 'Programmer's Corner' started by myra, Mar 10, 2009.

  1. myra

    Thread Starter New Member

    Mar 10, 2009
    Good day everyone!!!
    Im recently doing my project regarding scrolling message display comprising 7*50 arrays of LEDs. My problem is I dont have the program or code yet to display and scroll alphanumeric set of characters. My project is consist of 10 characters with Z8F082A microcontroller and zilog encore programming cable or dongle a DB9 connector for serial interface. It uses also und2981 and 74HC164 as a LED driver and shift register. The design is attached. Hope you could contribute some significant ideas. Its my great pleasure to read your ideas regarding with this project....

    I wish to program it in C...We have the code that blinks the LEDs but we cant display letters or move it left to right which is our goal. We consume so much time in changing and testing different hexa in our code just to attain our goal. Its so difficult to display even a single letter... pls help me guys!!!!!!

  2. digitalmind

    Active Member

    Mar 7, 2009
    Which microcontroller or microprocessor are you going to use to display letters and move them to the left or right?

    First you would need a compiler that can translate C into the machine language of whatever processor you're going to be using (if there is one it might be the GNU Compiler Collection, GCC), then you'd have to figure out how to download the compiled code into the RAM or ROM of the processor. Linking the C code would also be an issue.

    It might be easier/the only option to use assembler/machine code for the processor that will be displaying or moving the letters.

    Sorry, wish I could have been more useful...
  3. RiJoRI

    Well-Known Member

    Aug 15, 2007
    I would start by setting up 2 7x50 char arrays. The one will have the message pattern, the other the pattern for the display. Use an index into the message array, and copy from the index to index-1, wrapping at the end of the array. (This is basically a circular buffer that you are reading from.) Write each character to the display array. Increment the pointer, wrapping it at 50. Loop back and do it again.

    Start by just reading the message array and displaying it (no scrolling). Once you do this, you can start working on scrolling the message.

    Finally, look into improving the software -- using bytes to convey bits is not at all efficient.

  4. myra

    Thread Starter New Member

    Mar 10, 2009
    Ahmmm we are currently doing test and simulation of our project using PIC microcontroller with IAR Embedded workbench as compiler. We have our c code which is attached here. But we could not display and scroll letters which is our aimed. Yup our aim is to move letters from right to left but the LEDs in the array are just blinking but cant display messages, even a single letter. This is my first time with this project. Hope u could give me out some important ideas....help me plszzzzzz....

    // RA0,RA1 : CK, CD
    // RB0-RB6 : RO-R6

    #include <io16f877.h> // The I/O the header file which is defined
    #define CK RD0 // 74LS164 clock
    #define CD RD1 // 74LS164 data
    // "5 7 µµ Æ®" font
    const unsigned char FONT57[] = {0x00,0x27,0x25,0x25,0x19,

    const unsigned int CDD[] = {0x00,0x00,0x00,0x00,0x00,

    // Delay function
    void delay(unsigned long int i)
    // Main
    void main(void)
    unsigned char i;
    TRISB = 0x00; // B port output
    TRISA = 0x00; // A port output
    TRISD = 0x00; // D port output
    ADCON1 = 0x06;
    // font output OFF
    PORTA = 0x00;
    PORTB = 0x00;
    PORTD = 0x00;
    CD = 0; // Line initial price
    for (i=0; i < 20; i++){ // Line until 0-19 loop
    PORTB = FONT57; // font output
    CK = 1; // clock
    CK = 0;

    //CD = 1; // line= 1
    delay(1000); // Schedule time delay

    CD = 0; // Line initial price
    }while(1); // Infinite loop
  5. thatoneguy

    AAC Fanatic!

    Feb 19, 2009
    The code that blinks the LEDs, does it blink all of them on and off, one column, or <other>?

    Try scrolling with just one '164, then add more, or try to display a scrolling/blinking checkerboard to make sure the individual addressing is working as intended.
  6. nyangirojoe

    New Member

    Jun 11, 2009
    Myra I too im doing my project regarding scrolling message display comprising 7*50 arrays of LEDs.I have the program/code to display and scroll alphanumeric set of characters.
    Here is the Hex code you need to burn into your microcontroller:


    My project is consist of 256 characters with ATtiny2313 microcontroller. It uses seven BD139 and 74HC595 as a LED driver and shift register.
    I programmed it in C... the code that scrolls the LEDs is there too(above) but i cant display letters,which is my goal. Does someone know something? ill appreciate