Microcontroller Programming

Submitted by Biall on Tue, 02/25/2020 - 20:22

I have tried my best to scroll message on led matrix using 8by8 ,,,,attached is the code and proteus file please help me as soon as possible 

your prompt response is highly appreciated

    

#include<xc.h>
#include<pic16f877a.h>
#include "Configuration_Bits.h"
#include "letter_select.h"
#define _XTAL_FREQ 12000000

#include<pic16f877a.h>

//rows  (-))   19 RDO   20  RD1   21 RD2
#define clkr    PORTDbits.RD0      //  11  clk
#define latchr  PORTDbits.RD1     //   12 latch
#define dsr     PORTDbits.RD2    //    14  ds

//Columns  (+))   23 RCO   24  RD1   25 RD2
#define clk    PORTCbits.RC4      //  11  clk
#define latch  PORTCbits.RC5     //   12 latch
#define ds     PORTCbits.RC6    //    14  ds

unsigned char flag=0;
unsigned int Col_Register[8]={1,2,4,8,16,32,64,128};
//unsigned char Col_bits[8]={1,2,4,8,16,2,64,128};

unsigned char shift_bits[8]={0b10000000,0b01000000,0b00100000,0b00010000,
                             0b00001000,0b00000100,0b00000010,0b00000001};
unsigned char empty_arr[8]={0b00000000,0b00000000,0b00000000,0b00000000,
                            0b00000000,0b00000000,0b00000000,0b00000000};
unsigned int numCol=1;
char txt[]={"A"};
void  col_off()
{
    unsigned char j,k1;
    for(k1=0;k1<8;k1++)
    {
        ds=0;
        clk=0;
        clk=1;
    }
        //__delay_ms(1);
        latch=0;  latch=1;
     

void col_data(unsigned char j1)

    unsigned char k,sf;
    
        for(k=0;k<=7;k++)
                          {
                        sf=(shift_bits[7-j1]<<k)&0x80;
                        if(sf==0)
                        ds=0;
                        else
                        ds=1;
                        clk=0;  clk=1;
                        }
                       latch=0;   latch=1;
                      __delay_ms(1);
                     col_off();
                
            
}

void display_letter( )
{
    unsigned char i,j,dat,g,col,x,m;
    unsigned char speed;
     for(i=0;i<2;i++)
       {
        for(j=0;j<8;j++)
           { 
            for(speed=0;speed<10;speed++)
            {
                for(m=0;m<1;m++)
                 {
                    //x=m+j;
                    for(g=0;g<8;g++)
                    {x=m+j;
                     dat=(char_byte[i][x]<<g)&0x80;
                     if(dat!=0)
                     dsr=1;
                   else
                   dsr=0;
                   clkr=0;// __delay_us(200);
                   clkr=1;  
                   }//i
                latchr=0;       latchr=1; 
                __delay_ms(1);
                col_data(j);
                
                col_off();
                __delay_ms(2);
               }//m
            }//speed
                
        }//j
        
    }//i
}

void main()
{
    TRISDbits.TRISD0=0;
    TRISDbits.TRISD1=0;
    TRISDbits.TRISD2=0;
    TRISCbits.TRISC4=0;
    TRISCbits.TRISC5=0;
    TRISCbits.TRISC6=0;
    TRISB=0x00;
    TRISC=0x00;
    unsigned char z1,z;
    unsigned char i,j,font;
    unsigned char refresh=1;
    col_off();
    while(1)
    {
        do
        {
         letter=txt[z1]; 
         select_letter();
         for(z=0;z<=refresh;z++)
         {
            display_letter();
         }
          __delay_ms(10);
          z1++;
        }while(txt[z1]!='\0');
        z1=0;

    }//while
}

    

please provide any code (NOT ARDUINO BASED) i have to used PIC MICROCONTROLLER pic16f877a (mplab x ide ,with xc8 compiler)

 

for scrolling text on 8by8 led matrix using two 74hc595

 

please 

help me as soon as possible

  Joined February 25, 2020      1
Tuesday at 08:16 PM

Microcontrollers are typically programmed in higher-level languages such as C++ or Java. One of the essential tools needed to program a microcontroller is an integrated development environment. This software is usually developed by the creators of the microcontroller, and contains useful tools to help you program your microcontroller. Common tools found in IDE’s include, code editors, compilers, and debuggers. Depending on the application of the microcontrollers, additional features may be added as well.

  Joined February 27, 2020      55
Thursday at 11:08 AM