Discussion in "8051 Discussion Forum" started by    snake    Feb 9, 2008.
Sat Feb 09 2008, 12:57 am
#1
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


Sat Feb 09 2008, 02:18 am
#2
can u show us program??
Sat Feb 09 2008, 03:14 am
#3
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.
Sat Feb 09 2008, 07:28 am
#4
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.
Sat Feb 09 2008, 09:18 am
#5
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....


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
#6
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.
Sun Feb 10 2008, 01:23 am
#7
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 ?
Sun Feb 10 2008, 01:26 am
#8
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
Sun Feb 10 2008, 08:08 am
#9
Datasheet says 20-30pf caps........33pf will do fine.
Check your ckt's wiring.Have you wired the reset according to datasheet values?

Get Social

Information

Powered by e107 Forum System

Downloads

Comments

KevinTab
Sun Apr 28 2024, 05:35 am
Tumergix
Sun Apr 28 2024, 12:59 am
StevenDrulk
Sat Apr 27 2024, 08:47 pm
StephenHauct
Sat Apr 27 2024, 09:38 am
Adamsaf
Sat Apr 27 2024, 07:12 am
Robertphype
Sat Apr 27 2024, 12:23 am
ktaletrryp
Fri Apr 26 2024, 10:55 pm
Robertrip
Fri Apr 26 2024, 11:20 am