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.
How many LEDs are you trying to illuminate.... What is the Hfe of your BJT... Is it the Red LEDs or the others that give the problem...


OK, i have solved this problem the cathode was left open due to which they were lighting very dimming i have added pull ups now its fine....

I want to add different effect in it like your tut 13...
 
Hi again,

i was using debugger to understand the code i find that, when this is called the the execution of program goes to isr why?? i don't find any command calling isr...
Code:
for(x=0;x<33;x++)
				{
				buffer[x] = buffer[x+1];	// shift all the columns <--
				__delay_ms(1.5);				// so you can see it
				}
 
Ok!!!!! A quick lesson in Interrupts..


You have normal program flow ie..

Job1..... Job2.... Job3.... Job4..... ( then back to Job1 )

Then!!!! OUT OF THE BLUE.... TMR2 overflows... It could be in Job1... It could be in Job2... Or Job3.... Maybe Job4

The point is the timer has overflowed AND!!! I have requested that when this event takes place I want to update the column driver.... Not in a couple of seconds.. NOW The program is halted (Wherever it was) and the ISR is executed.... The columns are updated as we want.... THEN the program is restarted where it left off....

In other words the program was INTERRUPTED by the isr routine.....
 
I have made bi color LED connected the common to RD5 and 6 via BJT base...i want to change the LED after completing one display routine i have tested but i was not able to do as i want...
and i have seen some video where the scrolling comes and stop in between then scroll how to do this in code....
 
The code has essentially two loops.... The buffer shift loop... Then the character loop.... if you create a variable.. Lets say "index" then for every so many characters in the string put in a delay then when so many characters have been processed it code will stop for a bit...

If we say 4 characters..


Code:
///at the beginning of the display routine
char index = 0;

// then in the loop after the scrolling..

if(++index == 4)
   {
   __delay_ms(1000); // 1 second
   index = 0;
   }
 
The code has essentially two loops.... The buffer shift loop... Then the character loop.... if you create a variable.. Lets say "index" then for every so many characters in the string put in a delay then when so many characters have been processed it code will stop for a bit...

If we say 4 characters..

I am not getting you ..
i was asking that i will use the PORTC BIT 5 AND 6 connected to base of BJT that will supply to Red and green led so, after completing one string the next time the colour will change automatically...
 
Oh! Have you an updated schematic?...

Not all, only I have connected RD5 6 bits to base of BJT the collector is connected to emitter of rows...i think you are getting me now...
 
I think I need to see what you are doing..

If you doubled your shift register to 60 columns then if the red LED's were on every even clock... and the yellows were on every odd clock, would that do it?
 
If you doubled your shift register to 60 columns then if the red LED's were on every even clock... and the yellows were on every odd clock, would that do it?

OK....

I want your suggestion for designing PCB, for large display starting with ~16x32 LED so, should i control upper 8X32 with separate shift register and bottom one with separate??
or just connect all column with same shift register?? which would be best...
as i want to dispaly some graphic on it with the help of irfanview and LCD ass. software...
 
Ok!!! lets assume a 16x32 with bi-colour LED's If you use 8 of these...

You could do some great graphics.... I would have thought you could invert the columns to show 1 colour and normal would show the other.

OR!!!! You could just leap in and go the full hog https://www.adafruit.com/products/420 ...
 
You could do some great graphics.... I would have thought you could invert the columns to show 1 color and normal would show the other.

Hi,

this will be nice idea...
and pls suggest me for 16 or 32x32 led display circuit with shift register how to connect shift register for large display....
and there are two types of led planar glass(transparent one) and colored glass ...which should be preferred??
 
there are two types of led planar glass(transparent one) and colored glass ...which should be preferred??

Your preference....

As to the circuit!!! I may not be the best at this sort of thing.... If I were doing this I would ( eventually ) come up with a circuit that works... But!!! I not doing this... You are!!
So I'll have to leave that part up to you... We are leaving the realms of simple simulation, and I'm not prepared to build a circuit to see if it's plausible..

If I design you a circuit and it doesn't work... Well, I won't be able to help...
 
Hi
i was talking to 3vo he said to combine two display and control with superior uC via spi..like that
 
Yes... It is a way to go... However!!!!! Your "C skills" require polishing before we attempt this...

I personally would use a pic micro for each 8x8 matrix then have a master pic writing the values to them... All advanced stuff... Getting a pic into SPI slave mode requires a bit higher skill than normal.
I do like helping you, but I have a full time job and it does take up a lot of my time....

This is the one reason why I stayed out of the Co-op build.... The RGB display from adafruit has all the support chips built in to the device.... You can run it from a single PIC.
 
There isn't really an advantage... Other than freeing up a timer... As you are not using the timer for anything else... Its not really a benefit..

I was in the throws of making a cricket score board.... 12" high character LED.... I was going to put a small pic16f690 on each digit... Then I can control them by SPI...

This way each pic can keep the LED's lit at a certain scam rate, displaying the number that arrives on the SPI bus...
 
Hi again,

I was making bitmap file to hex using paint..
I notice that the pixel like ~16x40 is still less for clip art like image pls help me to have graphics on display can't we get a ready made led board..??a
 
Status
Not open for further replies.

Latest threads

Back
Top