Interfacing LED's with 18F4520

Thread Starter

paddy611

Joined Oct 9, 2012
25
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
 

takao21203

Joined Apr 28, 2012
3,695
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.
 

takao21203

Joined Apr 28, 2012
3,695
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.
 

Thread Starter

paddy611

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