1. 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.
    Dismiss Notice

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

Discussion in 'Microcontrollers' started by koolguy, Jan 14, 2013.

  1. koolguy

    koolguy Active Member

    Joined:
    Aug 24, 2010
    Messages:
    2,196
    Likes:
    9
  2. Ian Rogers

    Ian Rogers Super Moderator Most Helpful Member

    Joined:
    Mar 28, 2011
    Messages:
    9,159
    Likes:
    907
    Location:
    Rochdale UK
    ONLINE
    Too many LED's to update... You need to get higher than 15 fps... You need to drive them differently to get a smooth output.
     
  3. koolguy

    koolguy Active Member

    Joined:
    Aug 24, 2010
    Messages:
    2,196
    Likes:
    9

    it is 8x32 only i have connected the 2 led together in row...
     
  4. dave

    Dave New Member

    Joined:
    Jan 12, 1997
    Messages:
    -
    Likes:
    0


     
  5. Ian Rogers

    Ian Rogers Super Moderator Most Helpful Member

    Joined:
    Mar 28, 2011
    Messages:
    9,159
    Likes:
    907
    Location:
    Rochdale UK
    ONLINE

    I know how you did it....

    There are 32 writes to the display.. each LED is on for @4mS

    4m * 32 = 128... 128mS frame rate... Less than 8fps.

    To make the flicker go away, you need to speed it up... BUT!!! as I said AGES ago... The LED's will get dimmer.

    You need to get the frame rate up past 15fps

    If you change your timer so the interrupt happens every 2ms, then you double the fps to 16.. ( but at a cost!! )
     
    • Like Like x 1
  6. koolguy

    koolguy Active Member

    Joined:
    Aug 24, 2010
    Messages:
    2,196
    Likes:
    9
    Ok, how to get frame rate more, than losing brightness of LEds??
     
  7. Ian Rogers

    Ian Rogers Super Moderator Most Helpful Member

    Joined:
    Mar 28, 2011
    Messages:
    9,159
    Likes:
    907
    Location:
    Rochdale UK
    ONLINE
    Trial and error of course... Just adjust the timer pre-load and try it..
     
  8. be80be

    be80be Well-Known Member

    Joined:
    Aug 23, 2008
    Messages:
    4,798
    Likes:
    134
    Location:
    morristown,tn
    Lol your leds may even look brighter if you speed the frame rate up. And with faster rate you can feed more mA to the leds.
     
    • Like Like x 1
  9. koolguy

    koolguy Active Member

    Joined:
    Aug 24, 2010
    Messages:
    2,196
    Likes:
    9
    Its ok...

    can we use more ports to speed it up ? or parallel processing?
     
  10. Ian Rogers

    Ian Rogers Super Moderator Most Helpful Member

    Joined:
    Mar 28, 2011
    Messages:
    9,159
    Likes:
    907
    Location:
    Rochdale UK
    ONLINE
    Yes!!! You can. If you use an 8x32 matrix at the top driven by port B and an 8x16 at the bottom driven by port D. It will be much better.
     
  11. Ian Rogers

    Ian Rogers Super Moderator Most Helpful Member

    Joined:
    Mar 28, 2011
    Messages:
    9,159
    Likes:
    907
    Location:
    Rochdale UK
    ONLINE
    I would also like to point out something to those of you that use MPLAB..

    I have noticed an error whilst it compiles.... When you swap out C file Ie.. if you create a C file called font.c... THEN edit the file and rename to font1.c then swap the files out.. The compiler sometimes doesn't pick this up.

    This can cause undue stress when debugging, as the old "font.c" may still be referenced in the debugging file...

    I have just pulled my hair out on this one...
     
  12. koolguy

    koolguy Active Member

    Joined:
    Aug 24, 2010
    Messages:
    2,196
    Likes:
    9
    Then what to do, i do rename many times...
     
  13. Ian Rogers

    Ian Rogers Super Moderator Most Helpful Member

    Joined:
    Mar 28, 2011
    Messages:
    9,159
    Likes:
    907
    Location:
    Rochdale UK
    ONLINE
    If I'm having problems... I create a new project then copy the code over... Then delete the old project...
     
  14. Pommie

    Pommie Well-Known Member Most Helpful Member

    Joined:
    Mar 18, 2005
    Messages:
    10,015
    Likes:
    317
    Location:
    Brisbane Australia
    Is it just me that thinks that this is 28 pages of thread without any progress?

    Mike.
     
  15. Ian Rogers

    Ian Rogers Super Moderator Most Helpful Member

    Joined:
    Mar 28, 2011
    Messages:
    9,159
    Likes:
    907
    Location:
    Rochdale UK
    ONLINE
    No! Its me aswell I am not getting through.... I'm starting to get tired.
     

Share This Page