Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

How to use Interrupt in PIC16F877A in C..??

Status
Not open for further replies.
Aha!! You are very observant!!... Look at the shift register outputs.... Each one accesses the rows in turn.

The first output ( Q0 ) is connected to matrix row 1
The second ( Q1 ) is connected to matrix 2 row 1
The third ( Q2 ) .... third matrix row 1
Then ( Q3 ) ... forth matrix row 1

BUT THEN!!

(Q4 ) is connected to the first matrix row 2
...
.. so on....

The changes needed were in the hardware...


OK, but what the reason of doing such changes???
 
ARRGGHHH... because you wanted row scanning... not column scanning.....

yes but why are you doing like this. One matrix scanning then another ...
why not the whole display row, are you scanning
 
I think you are not getting me in right way....!!
as you said this what is the advantage of scanning in this way???
The first output ( Q0 ) is connected to matrix row 1
The second ( Q1 ) is connected to matrix 2 row 1
The third ( Q2 ) .... third matrix row 1
Then ( Q3 ) ... forth matrix row 1

BUT THEN!!

(Q4 ) is connected to the first matrix row 2
...
.. so on....
 
Because it replicates the bytes stored in an image.
I am not getting pure reason of doing scanning by this method, are you doing this for good scanning???



Code:
0x00,0x00,0x00,0x03, //                              **
0x7F,0x00,0x00,0x0A, // *******                    * *
0x43,0x00,0x00,0x0B, // *    **                    * **
0x45,0x00,0x00,0x0A, // *   * *                    * *
0x59,0x00,0x00,0x0B, // * **  *                    * **
0x61,0x00,0x00,0x0F, // **    *                    ****
0x7F,0x00,0x00,0x0F, // *******                    ****
0x3E,0x00,0x00,0xFD, //  *****                 ***** **


like this is the image.....
 
Yes! It's so you can use the picture above striaght from LCD assistant or fastLCD.... This is the format of their output...

It makes sense to scan and place pixels in the same order, don't you think....
 
It makes sense to scan and place pixels in the same order, don't you think....

OK, now i am getting your scanning tech. what are you trying to do is feeding directly port b to 4 sections of rows(now its clear) but making hardware for this will be complicated Little bit.
Anyway let us move forward to other part of code logic.....
Code:
void displaystring(void)				// this routine prints through the screen buffer
	{									// moving one pixel at a time
	signed char x=32,y=0;				// I made these signed so I could print 
	for(y = 0;y  < 96 ;y++)				// to nowhere so I could produce the scrolling effect
		{
		clr();							// Clear the display buffer
		strput("HELLO WORLD!!",x--,0);	// adjust the scrolling string
		Blit();							// pass to screen buffer
		__delay_ms(80);					// time to view
		}
	}

signed char x=32,y=0; // I made these signed so I could print
What do you mean by print here by signed???
strput("HELLO WORLD!!",x--,0);

this is also not clar what the of x-- here with 0 and again strput???
 
My strput() take three parameters.... char* string... signed char x ... signed char y

X is the column and y is the row Y is always 0 because I want to print at the top LED row... X is moved as explained.... They are signed so I can go minus....
 
Code:
void strput(const char* ch, signed char x,signed char y)
	{
	int addr;
	
	while (*ch )
		{
		charput(*ch++,x,y);			// write a string to the display buffer
		x+=7;
		}	

void charput(char ch, signed char x,signed char y)
	{
	signed char x1, y1;				
	const char* addr2;				// pointer to character
	char disp;
	ch -= 0x20;						// characters starts a 0 not 0x20
	addr2 = &fnt[0];				// start of font array
	addr2 = addr2 + ((int)ch * 8);	// start place in font array
	for( y1=0;y1<8;y1++)			// eight rows
		{
		disp = *addr2;
		for (x1 = 0; x1<8; x1++)	// eight pixels
			{			
			if(disp & pow[x1])
				pixel(x+x1,y+y1,0); // OR the pixel to the display buffer
			}
		addr2++;
		}	
	}


This part also not clear can you me brief intro of your plan of doing adding these things??
most of word you are using cond msk not getting there use ??
 
most of word you are using cond msk not getting there use ??

What???

Msk is used in the pixel routine... It is so you can write to a location WITH new data without destroying the old data...

I can place pixel (LED) by pixel resolution so you don't need to shift the data the LED's are lit one by one rather than a complete line ( row )... This is a common way to draw to a screen..
 
Hi,

Then there is no use of shift register so, decade counter can be used here...
and if we make a big display like 32x60 or even more than what changes should be done in it??
 
Hi,

Then there is no use of shift register so, decade counter can be used here...
and if we make a big display like 32x60 or even more than what changes should be done in it??

More shift registers.... But as I said before, you'll end up with LED's so dim you'll struggle to see them...
 
More shift registers.... But as I said before, you'll end up with LED's so dim you'll struggle to see them...

This is not the exact answer i think...
in this code there is no use of shift register and i will connect 74164 with uln2003a Darling ton pair, and can't we do any calculation for making length??
can't we do // processing for large size of display?
 
For more than 8 rows should we do // processing for large size of display?
and PORT B is connected directly to 4 row section???
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top