Interfacing LED's with 18F4520

Discussion in 'Embedded Systems and Microcontrollers' started by paddy611, Nov 23, 2012.

  1. paddy611

    Thread Starter New Member

    Oct 9, 2012
    25
    0
    Today, 10:03 AM #1
    Hello,

    I have to interface around 120 LED's to PIC18F4520.

    I am planning to do it with Latch IC 74HCT574. But it increases number of latch IC's.

    As per the datasheet the maximum current sourced and sunk by all ports of micro controller is 200mA. Is it enough to drive all the LED's?

    I am collecting the data from PLC over modbus.

    From modbus the data of coil for 120 addresses is collected and according to received data, the status of LED should change.

    Please suggest.

    thanks
    paddy
     
  2. atferrari

    AAC Fanatic!

    Jan 6, 2004
    2,648
    762
    I never did that myself but first thing I would consider is how many LEDs would be ON at the same time.
     
  3. takao21203

    Distinguished Member

    Apr 28, 2012
    3,577
    463
    The number of LEDs which you can drive directly with a PIC is about 50.
    You can stretch it a bit, or alternatively use lower brightness.
    But that is about the limit.

    For 120 LEDs I would recommend shifting register + digital MOSFETs,
    or a dedicated LED driving IC (ICs). These are offered for instance by Maxim.

    Unless you want to use hardware brightness regulation, shifting registers perform very well for LED driving.

    Normally 4 phases are used (4x multiplex). You can extend it for upto 8 phases, or more with reduced brightness.

    So one serial shifter can drive upto 64 LEDs.
    For more LEDs, you extend the bits, or you use more bit lines in parallel.

    I have built numerous such circuits over the years.

    Some LEDs will show brightness variation if you drive many of them directly using a PIC. Other LEDs show much less brightness variation. You can also use bit line (column) resistors, especially with high brightness LEDs.

    Some 18F PICs do NOT have full drive capabilities on all IO bits.
     
  4. paddy611

    Thread Starter New Member

    Oct 9, 2012
    25
    0
    Thanks for the suggestion.

    Is it okay if i use Latch IC's and ULN2004 IC for driving the LED's?
     
  5. takao21203

    Distinguished Member

    Apr 28, 2012
    3,577
    463
    Yes certainly latch ICs are suitable for this.

    You'd connect their data inputs on a parallel bus, and the latching inputs on extra IO lines.

    You don't have to use multiplex.

    Multiplexing, and serial registers are mainly used to reduce connection complexity.
     
  6. paddy611

    Thread Starter New Member

    Oct 9, 2012
    25
    0
    The on/off status of LED's is depends on the data received from modbus.
    It is possible that all LED's may on.
     
  7. paddy611

    Thread Starter New Member

    Oct 9, 2012
    25
    0
    thanks for the help!!!!

    I will check with it and let you know.

    thank you very much.
     
  8. takao21203

    Distinguished Member

    Apr 28, 2012
    3,577
    463
    If you don't use mutiplex and all LEDs are on, it is adviseable to use a driving IC such as the one you mentioned.
     
    paddy611 likes this.
Loading...