Doubt regarding the LED driving capability of microcontroller
Thu Aug 23 2007, 03:52 pm
i cant see the attached schematic :S try using www.imageshack.us
get the direct link to image and post it here in [ img ] and [ /img ] tags
*remove spaces!! from the tags.
get the direct link to image and post it here in [ img ] and [ /img ] tags
*remove spaces!! from the tags.
Thu Aug 23 2007, 04:15 pm
http://img120.imageshack.us/img120/6200/schematicslo5.jpg
and my coding is
#include<REG51.H>
sbit UD = P3^2;
sbit TD = P3^3;
unsigned int count = 0x00, FMS = 0x00, units, tens;
void display(void);
void main(void)
{
unsigned int a[10]={0x7E,0x30,0x6D,0x79,0x33,0x5B,0x5F,0x70,0x7F,0x7B};
TMOD = 0x01;TF0 =0; TR0 = 0;
IE = 0x82;
count = 30;
while(count != 0){
count--;
display();
TL0 = 0xFD; TH0 = 0x4B;
TR0 = 1;
while(FMS<20);
TR0 = 0;
TF0 = 0;
FMS = 0x00;
}
}
void display(void)
{
units = count/10;
tens = count%10;
UD=1; TD=0;
P1=a[units];
UD=0; TD=1;
P1=a[tens];
}
void Timer0(void)interrupt 1{
TR0=0;
TL0= 0xFD;TH0= 0x4B;
FMS++;
TR0=1;
}
and my coding is
#include<REG51.H>
sbit UD = P3^2;
sbit TD = P3^3;
unsigned int count = 0x00, FMS = 0x00, units, tens;
void display(void);
void main(void)
{
unsigned int a[10]={0x7E,0x30,0x6D,0x79,0x33,0x5B,0x5F,0x70,0x7F,0x7B};
TMOD = 0x01;TF0 =0; TR0 = 0;
IE = 0x82;
count = 30;
while(count != 0){
count--;
display();
TL0 = 0xFD; TH0 = 0x4B;
TR0 = 1;
while(FMS<20);
TR0 = 0;
TF0 = 0;
FMS = 0x00;
}
}
void display(void)
{
units = count/10;
tens = count%10;
UD=1; TD=0;
P1=a[units];
UD=0; TD=1;
P1=a[tens];
}
void Timer0(void)interrupt 1{
TR0=0;
TL0= 0xFD;TH0= 0x4B;
FMS++;
TR0=1;
}
Thu Aug 23 2007, 04:18 pm
lookup table was missed
unsigned int a[10]={0x7E,0x30,0x6D,0x79,0x33,0x5B,0x5F,0x70,0x7F,0x7B};
unsigned int a[10]={0x7E,0x30,0x6D,0x79,0x33,0x5B,0x5F,0x70,0x7F,0x7B};
Thu Aug 23 2007, 04:20 pm
Oooh again :mad I hope this it will be visible :blush
0x7E,0x30,0x6D,0x79,0x33,0x5B,0x5F,0x70,0x7F,0x7B
0x7E,0x30,0x6D,0x79,0x33,0x5B,0x5F,0x70,0x7F,0x7B
Thu Aug 23 2007, 05:00 pm
you are trying to source the current this always cause a problem i know.. try removing Rb 10K SIP and check if the value of Ra is correct.. i mean.. is it enough to drive the transistor properly and source the current..
Thu Aug 23 2007, 05:37 pm
No,I removed the microcontroller from the IC base and I given the 5V to the port 1 pins. And 5V is also given to the P3.2 and P3.3 but one pin at a time. I'm getting the display.
And one more thing if I palce the mc the voltage across the Port 1 pins for logic high is about 0.9V.
I know this is mc current driving capability issue but I don't know how to fix it
And one more thing if I palce the mc the voltage across the Port 1 pins for logic high is about 0.9V.
I know this is mc current driving capability issue but I don't know how to fix it
Thu Aug 23 2007, 05:52 pm
you should have chosen common anode.. coz its easy for micros to sink the current rather source... try connecting pull ups at port pin that might help you..
Powered by e107 Forum System