Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

How to use 16f877A instead of 18F452 in LedMatrix

Status
Not open for further replies.

smsm3650

Member level 2
Member level 2
Joined
Apr 25, 2009
Messages
47
Helped
5
Reputation
10
Reaction score
4
Trophy points
1,288
Activity points
1,507
this is the oreginal project with 18f452

**broken link removed**

after modefing it to use 16f877A it became

**broken link removed**

but this error Appear's

**broken link removed**

Another Question .. what does the Extention PBP mean ,, what is this Language or what is it's Compiler ..

What can We Do ???
 

Attachments

  • ledmmatrix_mowing_2059.rar
    33.3 KB · Views: 608

instade

have you altered 16f877a in same design you used for 18f452.. some times exception occurs when we do so.. Create new design for this circuit .. this sometimes works....
 

    V

    Points: 2
    Helpful Answer Positive Rating
18f452 vs 16f877

this is A Very Simple program .. Any Microcontroll Can run it .. i'm sure that 877 Can be used instade of it
 

    V

    Points: 2
    Helpful Answer Positive Rating
led matrix 16f877a ccs

i think the cause is the different in ram size and it is big for pic18f452 than pic16f877A
the code using 2d array which is need more ram capacity
you must rewrite the code to proportion your pic
thanks
 
Last edited by a moderator:

18f452

If You have another Idea to this project >> Tell Us about it
 

18f452 fuses mikroc

are u using same hex file for 16F877A?
if it is . t will not work
compile another hex file
 

16f877a scrolling message display circuits

"sutun_reg" ---> 320byte... You aren't use 16F877(A). But you can change source codes.

i can send to you different a project?

are you want?

Added after 23 minutes:

**broken link removed**
**broken link removed**
Code:
#include <16F877.H>
#fuses HS,NOWDT,NOPUT,NOPROTECT,NOBROWNOUT,NOLVP
#use delay(clock=20000000)
#use rs232(baud=9600, xmit=PIN_A4, rcv=PIN_A5,RESTART_WDT, ERRORS)

#define PIN_ST_CP      PIN_C2  // RCLK ----> Pin 12 ST_CP
#define PIN_SH_CP      PIN_C3  // SRCLK ---> Pin 11 SH_CP
#define PIN_SER_IN     PIN_C5  // SER -----> Pin 14
//#define PIN_MRS       PIN_C1  // PIN 10
//#define PIN_OE        PIN_C3  // PIN 13


#use fast_io(B)
#use fast_io(C)
#use fast_io(D)

long s1_char_size=41;
char s1[79];
long i;

//***********************sutunlara bağlı hc595**********************************
#define clock      PIN_B0  // RCLK ----> Pin 12 ST_CP
#define latch      PIN_B2  // SRCLK ---> Pin 11 SH_CP
#define data       PIN_B1  // SER -----> Pin 14

void HC595_OUT_satir(unsigned char send_data)
{
   unsigned char bit_mask;

   for (bit_mask=1; bit_mask ;bit_mask <<=1)
   {
      // On an AVR you can set the bit directly and i'd use
      // "data = (send_data & bit_mask);"

      //Else use this if/else ....
      if((send_data & bit_mask))
        output_high(data);
      else
        output_low(data);

      output_high(clock);
      delay_us(1);
      output_low(clock);
   }

   output_high(latch);
   delay_us(1);
   output_low(latch);
}
//******************************************************************************
void get_line1(void)
{
  for(i=0; i<s1_char_size; i++)
  {
    if(kbhit())
    {
      s1[i]=getc();
      delay_cycles(2);
      printf("%C",s1[i]);
      delay_us(1);
    }
    else
      i -= 1;
  }
}

const char   msg_default[] = "Sofie & ilker";

const char   ascii1[32][5] = {
   {0b00000000, //   0
    0b00000000,
    0b00000000,
    0b00000000,
    0b00000000}

   {0b00000000, //   1
    0b00000000,
    0b01011111,
    0b00000000,
    0b00000000}

   {0b00000000, //   2
    0b00000111,
    0b00000000,
    0b00000111,
    0b00000000}

   {0b00010100, //   3 ("#" iºareti)
    0b01111111,
    0b00010100,
    0b01111111,
    0b00010100}

   {0b00100100, //   4 ("$" iºareti)
    0b00101010,
    0b01111111,
    0b00101010,
    0b00010010}

   {0b00100111, //   5 ("%" iºareti)
    0b00010101,
    0b01101011,
    0b01010100,
    0b01110010}

   {0b00110110, //   6
    0b01001001,
    0b01010110,
    0b00100000,
    0b01010000}

   {0b00000000, //   7
    0b00001011,
    0b00000111,
    0b00000000,
    0b00000000}

   {0b00000000, //   8 ( ")" iºareti)
    0b00011100,
    0b00100010,
    0b01000001,
    0b00000000}

   {0b00000000, //   9 ( "(" iºareti)
    0b01000001,
    0b00100010,
    0b00011100,
    0b00000000}

   {0b00101010, //   10
    0b00011100,
    0b01111111,
    0b00011100,
    0b00101010}

   {0b00001000, //   11 ( "+" iºareti)
    0b00001000,
    0b00111110,
    0b00001000,
    0b00001000}

   {0b00000000, //   12 ( "'" iºareti)
    0b01011000,
    0b00111000,
    0b00000000,
    0b00000000}

   {0b00001000, //   13 ("-" iºareti)
    0b00001000,
    0b00001000,
    0b00001000,
    0b00001000}

   {0b00000000, //   14
    0b01100000,
    0b01100000,
    0b00000000,
    0b00000000}

   {0b00100000, //   15 ("/" iºareti)
    0b00010000,
    0b00001000,
    0b00000100,
    0b00000010}

   {0b00111110, //   16 ( 0 rakamı )
    0b01010001,
    0b01001001,
    0b01000101,
    0b00111110}

   {0b00000000, //   17 ( 1 rakamı)
    0b01000010,
    0b01111111,
    0b01000000,
    0b00000000}

   {0b01110010, //   18 ( 2 rakamı)
    0b01001001,
    0b01001001,
    0b01001001,
    0b01000110}

   {0b00100010, //   19 ( 3 rakamı)
    0b01000001,
    0b01001001,
    0b01001001,
    0b00110110}

   {0b00011000, //   20 ( 4 rakamı)
    0b00010100,
    0b00010010,
    0b01111111,
    0b00010000}

   {0b00100111, //   21 ( 5 rakamı)
    0b01000101,
    0b01000101,
    0b01000101,
    0b00111001}

   {0b00111100, //   22 ( 6 rakamı)
    0b01001010,
    0b01001001,
    0b01001001,
    0b00110000}
   {1, 113, 9, 5, 3}           //   23
   {54, 73, 73, 73, 54}        //   24
   {6, 73, 73, 41, 30}         //   25
   {0, 54,54,0,0}         // {0, 54, 54,0,0,0}
   //   26
   {0, 91, 59, 0,0}         // {0, 91, 59,0,0,0}     // 27
   {8, 20, 34, 65,0}           //   28
   {20, 20, 20, 20, 20}        //   29
   {65, 34, 20, 8,0}           //   30
   {2, 1, 81, 9, 6}            //   31
   };

const char   ascii2[32][5] = {
{50, 73, 121, 65, 62}          //      0
{124, 18, 17, 18, 124}         //      1   A
{65, 127, 73, 73, 54}          //      2   B
{62, 65, 65, 65, 34}           //      3   C
{65, 127, 65, 65, 62}          //      4   D
{127, 73, 73, 65, 65 }         //      5   E
{127, 9, 9, 1, 1}              //      6
{62, 65, 73, 73, 58}           //      7
{127, 8, 8, 8, 127}            //      8
{0, 65, 127, 65, 0}       // {0, 65, 127, 65,0,0}
        //      9
{32, 64, 65, 63, 1}            //      10
{127, 8, 20, 34, 65}           //      11
{127, 64, 64, 64, 64}          //      12
{127, 2, 12, 2, 127}           //      13
{127, 2,  4, 8, 127}           //      14
{62, 65, 65, 65, 62}           //      15
{127, 9, 9, 9, 6}              //      16
{62, 65, 81, 33, 94}           //      17
{127, 9, 25, 41, 70}           //      18
{38, 73, 73, 73, 50}           //      19
{1,1,127, 1, 1}                //      20
{63, 64, 64, 64, 63}           //      21
{7, 24, 96, 24, 7}             //      22
{127, 32, 24, 32, 127}         //      23
{99, 20, 8, 20, 99}            //      24
{3, 4, 120, 4, 3}              //      25
{97, 81, 73, 69, 67}           //      26
{0, 127, 65, 65,0}          // {0, 127, 65, 65,0,0}
          //      27
{2, 4, 8, 16, 32}              //      28
{0, 65, 65, 127,0}          // {0, 65, 65, 127,0,0}
          //      29
{4, 2, 1, 2, 4}                //      30
{64, 64, 64, 64, 64}           //      31
};

const char   ascii3[32][5] = {    // 0 -- 30 == 31 elements
   {0, 0, 7, 11,0}        // {0, 7, 11,0,0,0}
  //   0
   {32, 84, 84, 84, 56}     //   1
   {127, 40, 68, 68, 56}    //   2
   {56, 68, 68, 68,0}     //   3
   {56, 68, 68, 40, 127}     //   4
   {56, 84, 84, 84, 24}     //   5
   {8, 126, 9, 9, 2}     //   6
   {8, 84, 84, 84, 60}     //   7
   {127, 8, 4, 4, 120}     //   8
   {0, 68, 125, 64,0}      // {0, 68, 125, 64,0,0}
//   9
   {32, 64, 68, 61,0}     //   10
   {127, 16, 40, 68,0}     //   11
   {0, 65, 127, 64, 0}      // {0, 65, 127, 64,0,0}
//   12
   {124, 4, 120, 4, 120}     //   13
   {124, 8, 4, 4, 120}     //   14
   {56, 68, 68, 68, 56}     //   15
   {124, 20, 20, 20, 8}     //   16
   {8, 20, 20, 20, 124}     //   17
   {124, 8, 4, 4, 8}     //   18
   {72, 84, 84, 84, 36}     //   19
   {4, 63, 68, 68,0}     //   20
   {60, 64, 64, 32, 124}     //   21
   {28, 32, 64, 32, 28}     //   22
   {60, 64, 48, 64, 60}     //   23
   {68, 40, 16, 40, 68}     //   24
   {12,80, 80, 80, 60}     //   25
   {68, 100, 84, 76, 68}     //   26
   {0, 8, 54, 65,0}           // {0, 8, 54, 65,0,0}
//   27
   {0,0,119,0,0}             // {0, 119,0,0,0,0}     // 28
   {0, 65, 54, 8,0}           // {0, 65, 54, 8,0,0}
//   29
   {2,1,2,4,2}     //   30

   {0b01111101, // ö harfi
    0b10000010,
    0b10000010,
    0b10000010,
    0b01111101,
   }
};


void main(void)
{
  int char_index;
  int col_index;
  int x = 0;
  long MSD, LSD;
  int delaycount;
  int16 startposition;

  set_tris_b(0);
  set_tris_c(0x40);
  set_tris_d(0);
  HC595_OUT_satir(0);
  output_c(0);
  startposition = 0;

  for(i=0; i<79; i++)
    s1[i] = 46;

  for(i=0; i<sizeof(msg_default); i++)
    s1[i] = msg_default[i];

  delay_ms(100);
  do
  {
    if(!input(PIN_E1)) //BUTONA BASILDI MI?
    {
      do
      {
        delay_cycles(2);
        printf("\f\r\n");
        printf("\f\r\n Kac karakter.(0--99):");
        MSD=getc();
        delay_cycles(2);
        printf("%C",MSD);
        delay_us(1);
      }while(!isamoung(MSD,"0123456789"));
      do
      {
        LSD=getc();
        delay_cycles(2);
        printf("%C",LSD);
        delay_us(1);
      }while(!isamoung(LSD,"0123456789"));

      s1_char_size = 10*(MSD-48) + (LSD-48);
      delay_cycles(2);
      printf("\r\n\n  %lu karakter girin: ",s1_char_size);
      get_line1();
    }
    delaycount=2; //-------> tarama hızı burdan ayarlanıyo..
    while (delaycount)
    {
      col_index = startposition % 6;
      char_index = startposition / 6;
      if (char_index >= sizeof(s1))
      {
        startposition = 0;
        char_index = 0;
        col_index = 0;
      }
      x = s1[char_index];

// 74HC595 ler suruluyor
      output_high(PIN_SH_CP);
      output_high(PIN_ST_CP);
      output_high(PIN_SER_IN);
      output_low(PIN_SH_CP);
      delay_us(1);
      output_high(PIN_SH_CP);
      output_low(PIN_SER_IN);

      for (i=0;i<80;i++) // 80 tane kolon kullanıyoruz
      {
        //port_b=0;
        output_low(PIN_ST_CP);
        delay_us(200);
        output_high(PIN_ST_CP);
        delay_us(1);
        output_low(PIN_SH_CP);
        delay_us(1);
        output_high(PIN_SH_CP);

        if (col_index == 5)
        {
          col_index = 0;
          char_index++;
          if (char_index >= sizeof(s1))
            char_index = 0;
          x = s1[char_index];
        }
        else
        {
          if ( x < 32)
            HC595_OUT_satir(0);
          else if( x < 64)
            HC595_OUT_satir(ascii1[x-32][col_index]);
          else if( x < 96 )
            HC595_OUT_satir(ascii2[x-64][col_index]);
          else if( x < 128)
            HC595_OUT_satir(ascii3[x-96][col_index]);

          col_index++;
        }
        delay_us(120);
        HC595_OUT_satir(0);
      }
      delaycount--;
    }
    startposition++;
  } while(true);
}
 

multimeter with 16f877

smsm3650 said:
Another Question .. what does the Extention PBP mean ,, what is this Language or what is it's Compiler ..

What can We Do ???

PBP stands for 'pic basic pro' and it means that the code was written using picbasic pro language and need to be compiled with pbpw.exe or pbp.exe

thats all i can afford to help.

good luck
 

matrix led 6432 pic18

Yeeeeeeeeeees i'm very in need to that project

i Need Led Matrix with 877a with moving massage
All what i found move the letter from firest 5X7 to second 5X7 to third 5X7 .. it look like Litter Shift from first block to another

Pleas attache your project Eng.ilker_32
 

led matrix 18f452

i'm Not Student ... i'm Communcation Eng.

But 452 more Expinsive than 877a .. When we need this project in Industerial perpuse it will be expinsive

Pleas help me using 877a to Get Moving massage

Added after 3 minutes:

Eng,ilker_32

when I use Your Code this error Appears

**broken link removed**

**broken link removed**

**broken link removed**
 

18f452

smsm3650 said:
i'm Not Student ... i'm Communcation Eng.

But 452 more Expinsive than 877a .. When we need this project in Industerial perpuse it will be expinsive

Pleas help me using 877a to Get Moving massage

The 18F4620 (an upgraded 18F452) is not much more than a 16F877A in quantity and it doesn't need an external oscillator.
Since this is not a school project you should consider hiring a consultant as the coding seems to be beyond your companies skill.
Do you really expect someone to write it for free, do they get a royalty on units sold?

PS nice "c rack" directory in your screen caps :)
 

16f887 datasheet

sorry, my english is bad. And i love a swedish girl. For this, i'm learning english new.

it is not MikroC, :D

you will use the CCS C.

OK.
 

Attachments

  • kayan_yaz__305__877_6.9_sp4_8215.rar
    22.8 KB · Views: 497

ccs 18f452

It's Really wonderful marvelous superb gorgeous project ... it's actual touchs My purpose .. But it needs Very Very Small Modification ... That it Needs to LOOP the words ,, When the written sentence Ends it display DOTs .. But it must LOOP the
sentence agine and agine

**broken link removed**



thanks_graphics_27.gif


Added after 1 hours 15 minutes:

Added after 3 hours 38 minutes:

Yasterday I Designed this Program to Enables users to Creat Custum char.

**broken link removed**

Just For You (( ilker_32 ))

I hope you enjoy it
 

Attachments

  • led_matrix_custom_char._877a_1215.rar
    7.5 KB · Views: 417
  • Like
Reactions: jito79

    jito79

    Points: 2
    Helpful Answer Positive Rating
8x8 led matrix 16f877a

thanks :D

i can make mistake the while writing. Please correct.

smsm3650, can do change the source code.

i'm not using ascii software. And for pratical,
//////////////////////////////////////////////////////////////////////////////////////////1
**broken link removed**
//////////////////////////////////////////////////////////////////////////////////////////2
**broken link removed**
//////////////////////////////////////////////////////////////////////////////////////////3
**broken link removed**
//////////////////////////////////////////////////////////////////////////////////////////4
**broken link removed**
//////////////////////////////////////////////////////////////////////////////////////////5
**broken link removed**

1=5
2=4
3=3
4=2
5=1
 

Attachments

  • binhex2_2078.rar
    2.1 MB · Views: 626
  • 5x7_karakter_kodlay__305_c__305__2056.rar
    5.5 KB · Views: 333
  • base_converter_deci.hexdes.binar._evir_2470.rar
    46.1 KB · Views: 355
  • glcd_font_creator.v1.0.1_pro_2004.rar
    1.3 MB · Views: 616
  • ascii_haz__305_rlama_4060.rar
    248.7 KB · Views: 465
18f452 multimeter

Thank'ssssssssssssssss for All ... But the Word ("Sofie & ilker") do LOOP Only after 80 characters
And display Dot's

**broken link removed**


i tried to change the code

for(i=0; i<79; i++)
s1 = 46;

to

for(i=0; i<79; i++)
s1 = msg_default;

Or

for(i=0; i<sizeof(msg_default) ; i++)
s1 = msg_default;


But it failure ... Pleas Help Me to make the code Calculate (sizeof(msg_default)) and Loop it Automaticly
 

74hc595 + 18f

sorry, i had work. I could enter to the web page today. :D

sorry man :D

Code:
#include <16F877.H>
#fuses HS,NOWDT,NOPUT,NOPROTECT,NOBROWNOUT,NOLVP
#use delay(clock=20000000)
#use rs232(baud=9600, xmit=PIN_A4, rcv=PIN_A5,RESTART_WDT, ERRORS)

#define PIN_ST_CP      PIN_C2  // RCLK ----> Pin 12 ST_CP
#define PIN_SH_CP      PIN_C3  // SRCLK ---> Pin 11 SH_CP
#define PIN_SER_IN     PIN_C5  // SER -----> Pin 14
//#define PIN_MRS       PIN_C1  // PIN 10
//#define PIN_OE        PIN_C3  // PIN 13


#use fast_io(B)
#use fast_io(C)
#use fast_io(D)

long s1_char_size=26;
char s1[26];
long i;

//***********************sutunlara bağlı hc595**********************************
#define clock      PIN_B0  // RCLK ----> Pin 12 ST_CP
#define latch      PIN_B2  // SRCLK ---> Pin 11 SH_CP
#define data       PIN_B1  // SER -----> Pin 14

void HC595_OUT_satir(unsigned char send_data)
{
   unsigned char bit_mask;

   for (bit_mask=1; bit_mask ;bit_mask <<=1)
   {
      // On an AVR you can set the bit directly and i'd use
      // "data = (send_data & bit_mask);"

      //Else use this if/else ....
      if((send_data & bit_mask))
        output_high(data);
      else
        output_low(data);

      output_high(clock);
      delay_us(1);
      output_low(clock);
   }

   output_high(latch);
   delay_us(1);
   output_low(latch);
}
//******************************************************************************
void get_line1(void)
{
  for(i=0; i<s1_char_size; i++)
  {
    if(kbhit())
    {
      s1[i]=getc();
      delay_cycles(2);
      printf("%C",s1[i]);
      delay_us(1);
    }
    else
      i -= 1;
  }
}

const char   msg_default[26] = "sofie & ilker"; // Yazdığınız cümle 80 karakterden küçük olduğu için kalan alan noktalar ile doldurulur.

/*"sofie & ilker" -> 13 karakter 26 - 13 = 13 boºluk*/

const char   ascii1[32][5] = {
   {0b00000000, //   0
    0b00000000,
    0b00000000,
    0b00000000,
    0b00000000}

   {0b00000000, //   1
    0b00000000,
    0b01011111,
    0b00000000,
    0b00000000}

   {0b00000000, //   2
    0b00000111,
    0b00000000,
    0b00000111,
    0b00000000}

   {0b00010100, //   3 ("#" iºareti)
    0b01111111,
    0b00010100,
    0b01111111,
    0b00010100}

   {0b00100100, //   4 ("$" iºareti)
    0b00101010,
    0b01111111,
    0b00101010,
    0b00010010}

   {0b00100111, //   5 ("%" iºareti)
    0b00010101,
    0b01101011,
    0b01010100,
    0b01110010}

   {0b00110110, //   6
    0b01001001,
    0b01010110,
    0b00100000,
    0b01010000}

   {0b00000000, //   7
    0b00001011,
    0b00000111,
    0b00000000,
    0b00000000}

   {0b00000000, //   8 ( ")" iºareti)
    0b00011100,
    0b00100010,
    0b01000001,
    0b00000000}

   {0b00000000, //   9 ( "(" iºareti)
    0b01000001,
    0b00100010,
    0b00011100,
    0b00000000}

   {0b00101010, //   10
    0b00011100,
    0b01111111,
    0b00011100,
    0b00101010} 

   {0b00001000, //   11 ( "+" iºareti)
    0b00001000,
    0b00111110,
    0b00001000,
    0b00001000}

   {0b00000000, //   12 ( "'" iºareti)
    0b01011000,
    0b00111000,
    0b00000000,
    0b00000000}

   {0b00001000, //   13 ("-" iºareti)
    0b00001000,
    0b00001000,
    0b00001000,
    0b00001000}

   {0b00000000, //   14
    0b01100000,
    0b01100000,
    0b00000000,
    0b00000000}

   {0b00100000, //   15 ("/" iºareti)
    0b00010000,
    0b00001000,
    0b00000100,
    0b00000010} 

   {0b00111110, //   16 ( 0 rakamı )
    0b01010001,
    0b01001001,
    0b01000101,
    0b00111110}

   {0b00000000, //   17 ( 1 rakamı)
    0b01000010,
    0b01111111,
    0b01000000,
    0b00000000}

   {0b01110010, //   18 ( 2 rakamı)
    0b01001001,
    0b01001001,
    0b01001001,
    0b01000110}

   {0b00100010, //   19 ( 3 rakamı)
    0b01000001,
    0b01001001,
    0b01001001,
    0b00110110}

   {0b00011000, //   20 ( 4 rakamı)
    0b00010100,
    0b00010010,
    0b01111111,
    0b00010000}

   {0b00100111, //   21 ( 5 rakamı)
    0b01000101,
    0b01000101,
    0b01000101,
    0b00111001}

   {0b00111100, //   22 ( 6 rakamı)
    0b01001010,
    0b01001001,
    0b01001001,
    0b00110000}
   {1, 113, 9, 5, 3}           //   23
   {54, 73, 73, 73, 54}        //   24
   {6, 73, 73, 41, 30}         //   25
   {0, 54,54,0,0}         // {0, 54, 54,0,0,0}
   //   26
   {0, 91, 59, 0,0}         // {0, 91, 59,0,0,0}     // 27
   {8, 20, 34, 65,0}           //   28
   {20, 20, 20, 20, 20}        //   29
   {65, 34, 20, 8,0}           //   30
   {2, 1, 81, 9, 6}            //   31
   };

const char   ascii2[32][5] = {
{50, 73, 121, 65, 62}          //      0
{124, 18, 17, 18, 124}         //      1   A
{65, 127, 73, 73, 54}          //      2   B
{62, 65, 65, 65, 34}           //      3   C
{65, 127, 65, 65, 62}          //      4   D
{127, 73, 73, 65, 65 }         //      5   E
{127, 9, 9, 1, 1}              //      6
{62, 65, 73, 73, 58}           //      7
{127, 8, 8, 8, 127}            //      8
{0, 65, 127, 65, 0}       // {0, 65, 127, 65,0,0}
        //      9
{32, 64, 65, 63, 1}            //      10
{127, 8, 20, 34, 65}           //      11
{127, 64, 64, 64, 64}          //      12
{127, 2, 12, 2, 127}           //      13
{127, 2,  4, 8, 127}           //      14
{62, 65, 65, 65, 62}           //      15
{127, 9, 9, 9, 6}              //      16
{62, 65, 81, 33, 94}           //      17
{127, 9, 25, 41, 70}           //      18
{38, 73, 73, 73, 50}           //      19
{1,1,127, 1, 1}                //      20
{63, 64, 64, 64, 63}           //      21
{7, 24, 96, 24, 7}             //      22
{127, 32, 24, 32, 127}         //      23
{99, 20, 8, 20, 99}            //      24
{3, 4, 120, 4, 3}              //      25
{97, 81, 73, 69, 67}           //      26
{0, 127, 65, 65,0}          // {0, 127, 65, 65,0,0}
          //      27
{2, 4, 8, 16, 32}              //      28
{0, 65, 65, 127,0}          // {0, 65, 65, 127,0,0}
          //      29
{4, 2, 1, 2, 4}                //      30
{64, 64, 64, 64, 64}           //      31
};

const char   ascii3[32][5] = {    // 0 -- 30 == 31 elements
   {0, 0, 7, 11,0}        // {0, 7, 11,0,0,0}
  //   0
   {32, 84, 84, 84, 56}     //   1
   {127, 40, 68, 68, 56}    //   2
   {56, 68, 68, 68,0}     //   3
   {56, 68, 68, 40, 127}     //   4
   {56, 84, 84, 84, 24}     //   5
   {8, 126, 9, 9, 2}     //   6
   {8, 84, 84, 84, 60}     //   7
   {127, 8, 4, 4, 120}     //   8
   {0, 68, 125, 64,0}      // {0, 68, 125, 64,0,0}
//   9
   {32, 64, 68, 61,0}     //   10
   {127, 16, 40, 68,0}     //   11
   {0, 65, 127, 64, 0}      // {0, 65, 127, 64,0,0}
//   12
   {124, 4, 120, 4, 120}     //   13
   {124, 8, 4, 4, 120}     //   14
   {56, 68, 68, 68, 56}     //   15
   {124, 20, 20, 20, 8}     //   16
   {8, 20, 20, 20, 124}     //   17
   {124, 8, 4, 4, 8}     //   18
   {72, 84, 84, 84, 36}     //   19
   {4, 63, 68, 68,0}     //   20
   {60, 64, 64, 32, 124}     //   21
   {28, 32, 64, 32, 28}     //   22
   {60, 64, 48, 64, 60}     //   23
   {68, 40, 16, 40, 68}     //   24
   {12,80, 80, 80, 60}     //   25
   {68, 100, 84, 76, 68}     //   26
   {0, 8, 54, 65,0}           // {0, 8, 54, 65,0,0}
//   27
   {0,0,119,0,0}             // {0, 119,0,0,0,0}     // 28
   {0, 65, 54, 8,0}           // {0, 65, 54, 8,0,0}
//   29
   {2,1,2,4,2}     //   30

   {0b01111101, // ö harfi
    0b10000010,
    0b10000010,
    0b10000010,
    0b01111101,
   }
};


void main(void)
{
  int char_index;
  int col_index;
  int x = 0;
  long MSD, LSD;
  int delaycount;
  int16 startposition;

  set_tris_b(0);
  set_tris_c(0x40);
  set_tris_d(0);
  HC595_OUT_satir(0);
  output_c(0);
  startposition = 0;

  //for(i=0; i<79; i++)
  //s1[i] = 46;

    for(i=0; i<sizeof(msg_default); i++)
    s1[i] = msg_default[i]; i=0;

  delay_ms(100);
  do
  {
    if(!input(PIN_E1)) //BUTONA BASILDI MI?
    {
      do
      {
        delay_cycles(2);
        printf("\f\r\n");
        printf("\f\r\n Kac karakter.(0--99):");
        MSD=getc();
        delay_cycles(2);
        printf("%C",MSD);
        delay_us(1);
      }while(!isamoung(MSD,"0123456789"));
      do
      {
        LSD=getc();
        delay_cycles(2);
        printf("%C",LSD);
        delay_us(1);
      }while(!isamoung(LSD,"0123456789"));

      s1_char_size = 10*(MSD-48) + (LSD-48);
      delay_cycles(2);
      printf("\r\n\n  %lu karakter girin: ",s1_char_size);
      get_line1();
    }
    delaycount=2; //-------> tarama hızı burdan ayarlanıyo..
    while (delaycount)
    {
      col_index = startposition % 6;
      char_index = startposition / 6;
      if (char_index >= sizeof(s1))
      {
        startposition = 0;
        char_index = 0;
        col_index = 0;
      }
      x = s1[char_index];

// 74HC595 ler suruluyor
      output_high(PIN_SH_CP);
      output_high(PIN_ST_CP);
      output_high(PIN_SER_IN);
      output_low(PIN_SH_CP);
      delay_us(1);
      output_high(PIN_SH_CP);
      output_low(PIN_SER_IN);

      for (i=0;i<80;i++) // 80 tane kolon kullanıyoruz
      {
        //port_b=0;
        output_low(PIN_ST_CP);
        delay_us(200);
        output_high(PIN_ST_CP);
        delay_us(1);
        output_low(PIN_SH_CP);
        delay_us(1);
        output_high(PIN_SH_CP);

        if (col_index == 5)
        {
          col_index = 0;
          char_index++;
          if (char_index >= sizeof(s1))
            char_index = 0;
          x = s1[char_index];
        }
        else
        {
          if ( x < 32)
            HC595_OUT_satir(0);
          else if( x < 64)
            HC595_OUT_satir(ascii1[x-32][col_index]);
          else if( x < 96 )
            HC595_OUT_satir(ascii2[x-64][col_index]);
          else if( x < 128)
            HC595_OUT_satir(ascii3[x-96][col_index]);

          col_index++;
        }
        delay_us(120);
        HC595_OUT_satir(0);
      }
      delaycount--;
    }
    startposition++;
  } while(true);
}

OK!

Added after 11 minutes:

smsm3650,

where are you from :?:

AND, TEACH ME ENGLISH!!! :D
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top