|
|
View previous topic :: View next topic |
Author |
Message |
WHUNG.JOHN Guest
|
CA-A 7-segment LED display QUESTION |
Posted: Sun Mar 04, 2007 6:22 am |
|
|
HI,EVERYONE
i written a sample for 7-segment led display porgram.
but i connected to chip(sn74ls47n) ,
starting ,the display right and display number 1 .
and display second number is error.the number look link "c".
i readed datasheet for sn74ls47n.
datasheets describes pin(LT) connected to "Hi" ,the 7-segment
led display all led must light. but my 7-segment not all light.
i dont understand that hardware have error or software have error .
thk u very much.
#include <16F877.h>
#FUSES NOWDT, HS, NOPUT, NOPROTECT, NOBROWNOUT, NOLVP, NOCPD, NOWRT, NODEBUG
#use delay(clock=10000000)
#define A pin_c6
#define B pin_c5
#define C pin_c4
#define D pin_d3
#define LT pin_c0
#define BI_RBO pin_c1
#define RBI pin_c2
void main()
{
while(1)
{
output_high(LT);
OUTPUT_HIGH(BI_RBO);
OUTPUT_HIGH(RBI);
DELAY_MS(1000);
output_HIGH(A); //shell be display number 1
output_LOW(B);
output_low(C);
output_low(D);
delay_ms(2000);
output_LOW(A); //shell be display number 2
output_HIGH(B);
output_low(C);
output_low(D);
delay_ms(2000);
// TODO: USER CODE!!
}
} |
|
|
Humberto
Joined: 08 Sep 2003 Posts: 1215 Location: Buenos Aires, La Reina del Plata
|
|
Posted: Sun Mar 04, 2007 8:42 am |
|
|
Quote: | datasheets describes pin(LT) connected to "Hi" ,the 7-segment
led display all led must light. but my 7-segment not all light.
|
Nop.Datasheet indicate that when LT is LOW, all the outputs must be LOW.
The active output condition in this decoder is LOW or Common Anode type displays.
See the TRUE TABLE in page 2:
http://euclid.math.temple.edu/~cmartoff/teaching/ph22106/DVM/74LS47.pdf
We doesn�t know your hardware, according to you description you have more than
one display but in your code there is not any code for display multiplexing.
Humberto |
|
|
WHUNG.JOHN Guest
|
RECHECK DATASHEETS NEW FIND |
Posted: Sun Mar 04, 2007 9:31 am |
|
|
Humberto wrote: | Quote: | datasheets describes pin(LT) connected to "Hi" ,the 7-segment
led display all led must light. but my 7-segment not all light.
|
Nop.Datasheet indicate that when LT is LOW, all the outputs must be LOW.
The active output condition in this decoder is LOW or Common Anode type displays.
We doesn�t know your hardware, according to you description you have more than
one display but in your code there is not any code for display multiplexing.
Humberto |
THANKS U FOR Humberto:
i goto u report datasheet area. and recheck truth table.
ready u describe LT must to "low".
i make a error to here. and my modified code follow as .
but still have a display question.
the code starts test led all display.and display number 1 (right).
but second number dont display right.
i readed truth table number 2 must D C B A ->LLHL
please virw my code follow as. where error ?
please teach me.
#include <16F877.h>
#FUSES NOWDT, HS, NOPUT, NOPROTECT, NOBROWNOUT, NOLVP, NOCPD, NOWRT, NODEBUG
#use delay(clock=10000000)
#define A pin_c6
#define B pin_c5
#define C pin_c4
#define D pin_d3
#define LT pin_c0
#define BI_RBO pin_c1
#define RBI pin_c2
void main()
{
while(1)
{
output_LOW(LT);//TEST 7 SEGMENT DISPLAY
DELAY_MS(1000);
output_HIGH(LT);
OUTPUT_HIGH(RBI);
DELAY_MS(1000);
output_HIGH(A); //shell be display number 1
output_LOW(B);
output_low(C);
output_low(D);
delay_ms(2000);
output_LOW(A); //shell be display number 2
output_HIGH(B);
output_low(C);
output_low(D);
delay_ms(2000);
// TODO: USER CODE!!
}
} |
|
|
Humberto
Joined: 08 Sep 2003 Posts: 1215 Location: Buenos Aires, La Reina del Plata
|
|
Posted: Sun Mar 04, 2007 10:31 am |
|
|
Code to drive this decoder is very straightforward.
I guess you have something wrong in your hardware with the wiring of the display segments.
1)Re-check the 74LS47-to-display connections.
2)Send us a short description regarding your hardware.
3)Pls explain more clearly what exactly is doing the display.
4)When posting code pls use the "Code" button.
5)When writting code pls try to use the same type of letters, do not mix CAPS LETTERS.
6)If you use 4 consecutive outputs of the same port it will be easy to code and debug.
Code: |
#define A PIN_B0
#define B PIN_B1
#define C PIN_B2
#define D PIN_B3
for(n=0; n<10; n++)
{
output_b(n);
delay_ms(1000);
}
|
Humberto |
|
|
whung.john Guest
|
question solve. |
Posted: Mon Mar 05, 2007 9:59 am |
|
|
thk u very much .
my friends.i read step solve question.
i recheck hardware.my pcboard have connected error.
my modified it solve question.
|
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|