Page 1 of 1

led matrix

Posted: Wed Aug 06, 2008 9:17 pm
by Teo
Hi.is posible to conect anod led to pin1(porta) and cathod led to pin2 (porta) ?
I need led matrix component,please help!
Tnx,Best Regards,Teo

Re: led matrix

Posted: Thu Aug 07, 2008 9:31 am
by Benj
Hello

Yes that is possible, maybe use a small 220 Ohm Resistor in series with the LED too to limit the current consumed.

However if you are not doing this for a special function then you may as well simply connect the cathode of the LED to ground and then toggle the LED by switching the I/O pin on and off.

Re: led matrix

Posted: Thu Aug 07, 2008 12:59 pm
by Mark
The PIC Kit 1 is a good example of an LED array of 16 LED's from just 4 port pins. However, when transposing the wiring to a stand alone application it soon became clear that the elegant solution was just too complicated and some LED's 'leaked' enough current to give dim lighting on LED's that should not have been lit. It was easier to use a bigger chip in the end.

If you still want to do it then a look up table (Flowcode 4 On Case command is promised) will be what I think you need.

Regards,

Mark

Re: led matrix

Posted: Thu Aug 07, 2008 2:36 pm
by Teo
HI, sorry for my bad english.I need to simulate 5x7 led matrix using flowcode.The diode(x) from the led matrix is conected for example between porta1 and portb1.Using 12 pins (porta1,2,3,4,5, and portb1,2,3,4,5,6,7) is posible to display all alphanumerical characters.Please help me!
Best regards,
Teo

Re: led matrix

Posted: Fri Aug 08, 2008 9:53 am
by Benj
Hello Teo

First I would try to do a single character and then take it from there. To do this you will need to create an array of 5 bytes. At the start of your program initialise these bytes with the binary to display your character. Then send byte 0 in the array to portb and switch on all of porta except RA0. This will allow for column 0 of the LEDs to light up. Wait approx 4-5ms and then repeat this time for byte 1 of the array on portb and porta all on except for RA1. do this for the remaining 3 bytes in the array and then repeat the loop of 5 to maintain the flicker free display. Changing the values in the array will allow you to update your display with a new character. You could even set up a timer interrupt to step through each of the array bytes and output the values to the ports so you can update the display values in your program and they will automatically refresh on the display.