Project: PIC LED Sequencer

Discussion in 'The Completed Projects Collection' started by MMcLaren, Mar 17, 2012.

  1. tracecom

    AAC Fanatic!

    Apr 16, 2010
    3,934
    1,430
    I didn't know you said that, but it turned out that I did choose the absolute mode to compile - at least I think so. As you probably read, I am like Sargeant Shulz: "I know nothing."

    I am wondering if the number of LEDs can be expanded to 15? There seem to be 7 unused ports on the PIC.

    When the battery on my camcorder has time to charge, I am going to post a video.
     
  2. MMcLaren

    Thread Starter Distinguished Member

    Feb 14, 2010
    816
    143
    Hi tracecom,

    You could expand the total number of LEDs a bunch of different ways. You could connect LEDs to seven of the remaining eight pins (one of those is an input only pin), as you mentioned, and then modify the program. You could also multiplex the LEDs in a 2x8, 3x8, 4x8, or larger matrix, but that would reduce the duty cycle and you would want to reduce the value of the LED current limiting resistors to increase "peak" current per LED in order to maintain the same "average" current and brightness per LED.

    Another interesting 'enhancement' would be PWM brightness control which allows for some interesting effects (example youtube video). The circuit in that video uses a form of multiplexing called Charlieplexing where five pins are driving twenty LEDs with PWM brightness control for each individual LED.

    More later. Cheerful regards...
     
    Last edited: May 8, 2012
  3. DerStrom8

    Well-Known Member

    Feb 20, 2011
    2,428
    1,336
    Glad to hear of your success, tracecom :)
     
  4. tracecom

    AAC Fanatic!

    Apr 16, 2010
    3,934
    1,430
  5. zs1apb

    New Member

    Aug 23, 2008
    1
    0
    Hi.

    I'm wanting to construct this as a test bed for some LED beacons for my neighbourhood watch and have one query. The code indicates a 16F628A PIC yet the schematic has a 16F1827? I would guess that the asm source would need to be compiled for the approriate chip?

    Please advise as what I know about PIC programming could be considered dangerous ;-)

    Thanks in advance!

    Regards.
    Tony
     
  6. jpanhalt

    Expert

    Jan 18, 2008
    5,968
    1,012
    The code is definitely written for the 16F628A. There are some differences between that chip and the 16F1827. The pinouts appear to be the same. The 16F1827 is enhanced midrange and uses a different instruction for bank switching(movlb x). It is also preferred to write to port latches (e.g., LATA) rather than to ports themselves; although, writing to the port will probably work. The 16F1827 uses a different instruction to turn off analog inputs (e.g., to comparators). The configurations may also need to be changed. The defaults may be OK. I didn't look at them carefully. I am sure the TS (Mike LcLaren) will also respond.

    One example of a difference:
    16F628A switch to Bank1
    Code (ASM):
    1.  
    2. bsf STATUS,RP0 ; bank 1 |B1
    3.  
    16F1827 switch to Bank1
    Code (ASM):
    1.  
    2. movlb   1     ;bank1|B1
    3.  
    I suspect you could use the 16F628A with that code and schematic. To use the 161827, you would need to make some minor changes in the code.
     
  7. MMcLaren

    Thread Starter Distinguished Member

    Feb 14, 2010
    816
    143
    It seems I do have versions of the project for both16F628A and for 16F1827. I've attached the missing files for the 16F1827 below. My apologies, guys...
     
    jpanhalt likes this.
Loading...