PIC driving 2x LED displays directly (16f884)

Discussion about projects that used PIC Microcontroller, Hardware Interface, Programming Algorithm and etc......

PIC driving 2x LED displays directly (16f884)

Postby takao21203 » Sat Apr 07, 2012 7:16 am

Today I built a prototype based on the 16f884, driving 2x 4 digit displays,
using no extra parts at all.

I looked carefully the datasheet, and the LED forward voltage actually is 2.2 volts (not 1.5).

So even if 5 volts are applied, only 2.8 volts are distributed accross the PIC.

8x multiplex is used. So the two displays are not even very bright. Just moderate.
And the PIC does not heat up, only a very little, it's barely noticeable.

There are really no resistors at all or drive transistors.
If I cycle through the points (like a chaser), I can notice a little
brightness variation...

Maybe people using extra parts like resistors are just taking too much care!
Why use the extra parts, when the possibility to drive one LED digit (which you can multiplex of course),
seems to be built in for some PICs?

It's really not normal thinking that the PIC would become damaged,
if you consider not the full 5 volts drop, and it barely heats up at all.
I see this sometimes on forums, that it would be bad to drive directly!
Apart of course, you get the brightness variation (just noticeable a little),
because the PIC I/O can not sink enough current.

Also this circuit happily runs from the PICKIT3 internal supply, so current can't be that high.
I have reduced voltage to 4.0 volts, and actually the PIC is cold.

led16f884.jpg
User avatar
takao21203
Discoverer
 
Posts: 111
Joined: Mon Mar 19, 2012 7:52 pm
Location: Ireland, Europe

Re: PIC driving 2x LED displays directly (16f884)

Postby ABSF » Sat Apr 07, 2012 10:05 am

Cool. Was the display used for score keeping? count down timer or RT clock?

I have 10 pieces of 16F886 arriving on Monday. May be I'd experiment with them on 7-segment LED cos the 886 (without A) are very cheap indeed....

Allen
The next war will determine NOT who is right BUT what is left.
User avatar
ABSF
Professional
 
Posts: 810
Joined: Wed Nov 10, 2010 9:32 am
Location: E Malaysia

Re: PIC driving 2x LED displays directly (16f884)

Postby takao21203 » Sat Apr 07, 2012 10:14 am

I don't use this display for anything myself, yet.
As I have these small serial display PCBs already.

It's an experiment that I wanted to run for a long while...
Eventually I will even use this design for a printed PCB.

By the way, I just found a way to compensate the brightness difference,
at least for the points (which I am cycling through for demonstration).

It's really just a simple timer manipulation.
When the point is on, the total time is "extended" by 0x30 (from 0x100).

CODE: SELECT_ALL_CODE
phase_bits=phase_tab[phase];

 PORTC=~phase_bits;
 PORTD=led_decode[led_numbers[phase]];

 if(points[phase]!=0)
 {
  PORTD|=0x04;
  while(TMR0 < 0x30);TMR0=0;
 }
 else {}

 phase++;
 if(phase==8)phase=0;


result: zero brightness difference!

This could even be done for indivdual numbers, right now, I can't observe any difference (only the 1 is just a tiny bit more).

I made a small movie, showing an extra effect caused by the brightness compensation!
http://pic.hitechworld.org/htp1/884led_display.html
User avatar
takao21203
Discoverer
 
Posts: 111
Joined: Mon Mar 19, 2012 7:52 pm
Location: Ireland, Europe

Re: PIC driving 2x LED displays directly (16f884)

Postby ABSF » Sat Apr 07, 2012 10:26 am

takao21203 WROTE:By the way, I just found a way to compensate the brightness difference,
at least for the points (which I am cycling through for demonstration).

It's really just a simple timer manipulation.
When the point is on, the total time is "extended" by 0x30 (from 0x100).


Cool! that's what I was thinking as well. Cause last time you mentioned that it was brighter when display "1" and dimmer when displaying "8".

BTW, is there any way to add a dimmer to the circuit? Either software or hardware is fine. I have a real application for it.. :)

Allen
The next war will determine NOT who is right BUT what is left.
User avatar
ABSF
Professional
 
Posts: 810
Joined: Wed Nov 10, 2010 9:32 am
Location: E Malaysia

Re: PIC driving 2x LED displays directly (16f884)

Postby takao21203 » Sat Apr 07, 2012 10:51 am

ABSF WROTE:BTW, is there any way to add a dimmer to the circuit? Either software or hardware is fine. I have a real application for it.. :)
Allen


Only software because PIC internal ports are used.
Yes it's possible, by switching off the PORT, before the next refresh interrupt (and now including each refresh cycle, some blank time). Or for 1/2 brightness, simply blank refresh phases can be inserted.

Or what do you mean with dimmer? I made a small video as well (see link).

And by the way in the video, there is grey paint on these displays.
Normally, they have much more brightness. Indoors in the darkness (night), it's disturbing high brightness.

The 8 and 1 is not a big problem, only the points really cause some 15% brightness variation.
User avatar
takao21203
Discoverer
 
Posts: 111
Joined: Mon Mar 19, 2012 7:52 pm
Location: Ireland, Europe

Re: PIC driving 2x LED displays directly (16f884)

Postby ABSF » Sat Apr 07, 2012 6:59 pm

takao21203 WROTE:Only software because PIC internal ports are used.
Yes it's possible, by switching off the PORT, before the next refresh interrupt (and now including each refresh cycle, some blank time). Or for 1/2 brightness, simply blank refresh phases can be inserted.


Ok I got the idea. But wouldnt adding blank time in each refresh cycle cause flickering? How many times do you display the complete digits in a second?

Allen
The next war will determine NOT who is right BUT what is left.
User avatar
ABSF
Professional
 
Posts: 810
Joined: Wed Nov 10, 2010 9:32 am
Location: E Malaysia

Re: PIC driving 2x LED displays directly (16f884)

Postby takao21203 » Sat Apr 07, 2012 7:50 pm

If there is any flickering, refresh frequency can be increased.

I count until 0x20, then I skip the point by one step.

Each second, all points are cycled through two or three times,

so it's 32x8x3=768 Hz I don't know exactly. It's no problem since the output is parallel,
can be done very fast. About 80Hz maybe for all digits together.
User avatar
takao21203
Discoverer
 
Posts: 111
Joined: Mon Mar 19, 2012 7:52 pm
Location: Ireland, Europe

Re: PIC driving 2x LED displays directly (16f884)

Postby ABSF » Sun Apr 08, 2012 8:05 am

I made a small movie, showing an extra effect caused by the brightness compensation!
http://pic.hitechworld.org/htp1/884led_display.html


Very nice, though there is a little flickering on the movie, it should look OK to the eyes. ;)

takao21203 WROTE:If there is any flickering, refresh frequency can be increased.

I count until 0x20, then I skip the point by one step.

Each second, all points are cycled through two or three times,

so it's 32x8x3=768 Hz I don't know exactly. It's no problem since the output is parallel,
can be done very fast. About 80Hz maybe for all digits together.


80Hz is reasonable. 50Hz is enough to fool the eyes. Are you running the PIC at 20MHz?
Can I have a peek at the source? I can understand asm language.

Allen
The next war will determine NOT who is right BUT what is left.
User avatar
ABSF
Professional
 
Posts: 810
Joined: Wed Nov 10, 2010 9:32 am
Location: E Malaysia

Re: PIC driving 2x LED displays directly (16f884)

Postby takao21203 » Sun Apr 08, 2012 8:29 pm

Allen,

the flickering is seen by the digital camera (Olympus VG-120 14 MP HD movie).
In reality there is no flickering at all.

The PIC is clocked at 5 MHz (resonator).

I have attached the source code. As I wrote, using parallel output, it becomes really a very simple source code.

8digitled.zip
(3.25 KiB) Downloaded 506 times


By the way, I left the circuit on during the night at 3 volts. No overheating, or destruction of PICKIT here, no LED burn out.
User avatar
takao21203
Discoverer
 
Posts: 111
Joined: Mon Mar 19, 2012 7:52 pm
Location: Ireland, Europe

Re: PIC driving 2x LED displays directly (16f884)

Postby ABSF » Sun Apr 08, 2012 10:38 pm

takao21203 WROTE:The PIC is clocked at 5 MHz (resonator).

I have attached the source code. As I wrote, using parallel output, it becomes really a very simple source code.

8digitled.zip
(3.25 KiB) Downloaded 1 time


I'll go through the program first. Get my 16F886 on Monday, and construct it on Saturday evening when I am free. I have 4 MHz resonators and 6MHz crystals. I'll try the 6MHz crystal.

Thanks and cheers 8-)

Allen
The next war will determine NOT who is right BUT what is left.
User avatar
ABSF
Professional
 
Posts: 810
Joined: Wed Nov 10, 2010 9:32 am
Location: E Malaysia

Next

Return to PIC Microcontroller

Who is online

Users browsing this forum: No registered users and 1 guest