Plz help its urgent!!!!
Discussion in "8051 Discussion Forum" started by snake Feb 9, 2008.
Sat Feb 09 2008, 12:57 am
hiii
i'm using a mcu in my crcuit.The port i'm making low through program is giving a high voltage when checked through multimeter while the port that i have make 1 is ggiving a low votage.Why is it so?Plz help.Its urgent
i'm using a mcu in my crcuit.The port i'm making low through program is giving a high voltage when checked through multimeter while the port that i have make 1 is ggiving a low votage.Why is it so?Plz help.Its urgent
Sat Feb 09 2008, 03:14 am
Hiii
Program is a very short one:
void main()
{
P1=0x0;
while(1)
{
P0=0xff;
delay();
P0=0x0;
delay()
}
}
void delay()
{
int i,j;
for(i=0;i<100;i++)
for(j=0;j<1275;j++);
}
I have used a power supply of 5V.At P1 its giving around 4.8V while for P0 it shows around .2V
I have already tried increasing delay.
I think there is some problem with circuit.Its my first time to use a microcontroller.
I'm using P89V51RD2 and a oscillator of 12MHz.
Program is a very short one:
void main()
{
P1=0x0;
while(1)
{
P0=0xff;
delay();
P0=0x0;
delay()
}
}
void delay()
{
int i,j;
for(i=0;i<100;i++)
for(j=0;j<1275;j++);
}
I have used a power supply of 5V.At P1 its giving around 4.8V while for P0 it shows around .2V
I have already tried increasing delay.
I think there is some problem with circuit.Its my first time to use a microcontroller.
I'm using P89V51RD2 and a oscillator of 12MHz.
Sat Feb 09 2008, 07:28 am
Is P0 toggling at all or are you getting 0.2V always.If it's not toggling,the microcontroller isn't working and since P0 isn't internally pulled up you are getting 0.2v whereas P1 is internally pulled up so you're always getting high voltage.
So doublecheck your connections,the crystal,reset ckt etc.
So doublecheck your connections,the crystal,reset ckt etc.
Sat Feb 09 2008, 09:18 am
void main()
{
P1=0x0;
=> P1 configureed as output port...
similarly add a line below it .. P0=0x00;
and then start your programme...
plz.. let us know if this programme works....
{
P1=0x0;
=> P1 configureed as output port...
similarly add a line below it .. P0=0x00;
and then start your programme...
plz.. let us know if this programme works....
void main() { P1=0x0; P0=0x00; while(1) { P1=0x00; P0=0xff; delay(); P0=0x0; delay() } } void delay() { int i,j; for(i=0;i<100;i++) for(j=0;j<1275;j++); }
Sat Feb 09 2008, 01:01 pm
it seems that your controller is not working...
there is no problem with the code.check that you are burning code into your controller correctly.
there is no problem with the code.check that you are burning code into your controller correctly.
Sun Feb 10 2008, 01:23 am
I'm using IAP in my program .
In the datasheet its given to move the address of byte to be programmed in DPTR register.What is the range of address that in can program ?
In the datasheet its given to move the address of byte to be programmed in DPTR register.What is the range of address that in can program ?
Sun Feb 10 2008, 01:26 am
I'm having a microcontroller kit for ISP.Whenever i use my mcu in the kit it shows correct voltages however when i put it in my circuit it give wrong outputs as i have told before.
I have thus some ques about the circuit:
1.I'm using osc of freq 12Mhz.Will it work?
2.What should be the values of capacitors to be used when connecting my oscillator to mcu?
Thanks
I have thus some ques about the circuit:
1.I'm using osc of freq 12Mhz.Will it work?
2.What should be the values of capacitors to be used when connecting my oscillator to mcu?
Thanks
Sun Feb 10 2008, 08:08 am
Datasheet says 20-30pf caps........33pf will do fine.
Check your ckt's wiring.Have you wired the reset according to datasheet values?
Check your ckt's wiring.Have you wired the reset according to datasheet values?
Powered by e107 Forum System