Look at your Delay1/2/3 loop, you are looping around so fast ( .6 of a second at 4mhz) you will never see the display changing, before it comes to a halt at the End.
(unless its using a very, very slow clock rate, which the HS_OSC implies its not)
Try using a software delay like below, better still see this tutorial which shows how to use those displays by multiplexing.
Code:
CALL DELAY4s
MOVLW 0x00
MOVWF PORTB ; Set port LOW
GOTO LOOP
; SUBROUTINES
DELAY4s ; 4 SECOND DELAY at 4 mhz
movlw 0x23
movwf d1
movlw 0xB9
movwf d2
movlw 0x09
movwf d3
Delay_0
decfsz d1, f
goto dly1
decfsz d2, f
dly1 goto dly2
decfsz d3, f
dly2 goto Delay_0
return
Thanks for answering will check on those tutorials ASAP.
By the way another question. I tried lighting up the segments one by one and here's a really weird thing that's happening. I light up a,b,c no problem but when I try to light up a,b,c,f,g for example no segments will light up...so basically I can only light up 3 segments at one time if I try lighting up more the display will not show anything...that I really don't understand.
You can see here, that you have to use individual resistors on each of the segments, you cannot put different currents though that single resistor and get the same brightness /voltage in the segments.
I have seen some tutorials where no resistors were added in series with the segment pins and it was working. I do not think that is the problem. But I will try to do what you said.
Maybe it is not... but what Wp100 says is worth to keep in mind. If by accident, more at this stage of your learning, I your software comes to set a driving pin permanently high, you will have a LED fed with nothing in between to limit the current. Expect some damage to occur.
I have seen some tutorials where no resistors were added in series with the segment pins and it was working. I do not think that is the problem. But I will try to do what you said.
No resistors would allow too much current to flow which, in real life, could damage your display, chip, or both. Using a single resistor, however, severely limits the current, so much so that it cannot support lighting up multiple "LEDs" (segments) at a time.
I assume that was a fully working 7 segment program, when it may be possible to go without resistors,because of the high speed multiplexing, but you are really using each segment as individual leds that stay on constantly.
While it may work in Simulation if you try it on actual components without the resistors you run the risk of burning out the i/o port of the pic and /or the led segment.
Have a look at this site which explains how to select and use the right resistors plus other handy output circuits **broken link removed**
Hi Cantafford,
When you say you simulate it do you mean on a software simulator or on physical hardware ? If it is on hardware then check the state of all the port b pins with a multimeter. I would suggest changing the program so that after writing to port B it goes into a loop doing nothing. I you are using a software simulator it may have a display of all the port pin states.
I assume that was a fully working 7 segment program, when it may be possible to go without resistors,because of the high speed multiplexing, but you are really using each segment as individual leds that stay on constantly.
While it may work in Simulation if you try it on actual components without the resistors you run the risk of burning out the i/o port of the pic and /or the led segment.
Have a look at this site which explains how to select and use the right resistors plus other handy output circuits **broken link removed**
Hi Cantafford,
When you say you simulate it do you mean on a software simulator or on physical hardware ? If it is on hardware then check the state of all the port b pins with a multimeter. I would suggest changing the program so that after writing to port B it goes into a loop doing nothing. I you are using a software simulator it may have a display of all the port pin states.
Your circuit should work if you take advice from the above helpers. Without a resistor on each segment, the display only works when displaying digit "1" as it has the least number of LED to light. digit "0" and "2" will not light as they have more than 2 segments.
I didn't modify your software. It seems OK after I add in the resistor network.
Allen
p/s I see why it works now. My 876a clock was defaulted to 1 MHz.