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.

16 X 1024 LED Matrix Scanning

Status
Not open for further replies.
As per your comments, say my font size is 8x8, then if I want to update the buffer[16][256], then how can I shift the font from right to left with one shift step?
Can I get any pseudo code or sample code for this ?
I have made font matrix of 8x8 for all ascill characters in a character buffer defined as char char_buff[96][8].
Also, I am updating the P10 display row group as discussed in my previous posts.
Thanks.
 

Hi All,
I tried below code to scroll text from right to left.
I am not able able to see the scrolling effect. Can anyone suggest on this ?
I am using single P10 with 32 columns and 16 rows LED board.

Code:
unsigned char font8x8[96][8] = {...}; //contains ASCII character code. 96 characters at 8 bytes per character.

#define NUM_ROWS 16
#define NUM_COLS 4

unsigned char display_buff[NUM_ROWS][NUM_COLS];  // 16 rows and 4 sets of columns ( each set 8 columns, so total 32 columns)

int main(void)
{

InitFunctions();
InitTimerFor1ms();

	while(1)
	{ 
		display_string("WELCOME");
		
		delay(1000);
	}
}


//Timer Interrupt for 100 HZ

Timer_ISR() //1 ms intterupt
{

	// Each channel corespond to row group of P10.
	
	static unsinged char channel = 0;
	
	update_row(channel);
	
	channel++;
	
	if(channel > 3)
		channel = 0;
}

//Scrolling Text from Right to Left by 1 column
void Scroll_Text_From_Right_To_Left(unsigned char pos)
{
	for(shiftAmount=0; shiftAmount<8 ;shiftAmount++)
    {
        for(row=0;row<=NUM_ROWS;row++)
        {
            for(col=0;col<=NUM_COLS;col++)
            {
                //get the font value
				temp = font8x8[pos][row];
				
				//update the display buffer
				
				display_buff[row][col] = (display_buff[row][col] << 1)  | (temp >> (8 - shiftAmount)) ;
                          
            }           
        }
       delay(200);		  //delay to reduce speed.	     
    }
}

//Extract each character from the font table matrix
void display_string(char* strdata)
{
	msg_len=strlen(strdata);
	for(i=0;i<msg_len;i++)
	{
		Scroll_Text_From_Right_To_Left((*strdata)-32);		
		strdata++; 		
	}      
}

//push 128 bits of data in to the display_buffer

void update_row(char channel)
{	
    for (x=0; x<NUM_COL; x++)
    {
		hc595_write_byte(~display_buff[12 + channel][x]); 
        hc595_write_byte(~display_buff[8 + channel][x]);
        hc595_write_byte(~display_buff[4 + channel][x]);
        hc595_write_byte(~display_buff[0 + channel][x]);   
    }
    
    HC595_Latch();
    select_P10_rows(channel); 
    P10_EN=1;
    delay(10);
    P10_EN=0;    
}

//Select each row group of P10 module from 16 rows.
void select_P10_rows(channel)
{
	switch(channel)
	{
		case 0:
		A_LOW();
		B_LOW();
		
		case 1:
		A_HIGH();
		B_LOW();
		
		case 2:
		A_LOW();
		B_HIGH();
		
		case 3:
		A_HIGH();
		B_HIGH();
		
	}
}

Regards,
Raj S.
 

The above code as a whole seems quite consistent, so that from there it would be ideal yourself perform experiments by simulation and observe the effect resulted from each new change. There is no way to guess whether the problem lies, either in hardware, in firmware, or both, especially considering that you even posted so far no schematic circuit.
 

Thanks Andre. I started debugging.
I am trying 2 different approaches as mentioned below for 16 rows X 32 columns.

1. Declare display_buffer[16][4]. Here no. of columns I considered as "4", so that each character is of 8X8 & is part of 1 column. So, at a time, on entire P10, 4 characters should get displayed.

2. Declare display_buffer[16][32]. Here no. of columns I considered as "32".

Now, my understanding is that before updating the display, I have to push 4 rows and 32 columns data ( i.e. 128 bits = 16 bytes) in to the display_buffer by shifting the columns.
So, is my understanding is correct?
If YES,
then from approach 1 & 2, how to update the columns of display_buffer so that in next interrupt cycle, my display_buffer[][] must have 128 bits of data ?
Also, since timer interrupt is 100 HZ for each set of 4 rows, then how to make sure that display buffer is updated by total 128 bits data, before the next interrupt invokes?
I mean, so I need to disable the interrupt before updating th display_buffer[][] ?
I am just trying to understand the basic concept to create a scrolling effect. Because, my ultimate aim is for 1024 columns X 16 rows display.

Thanks for Your time.
Regards,
Raj S.
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top