0

When I burn a program on AT89C2051 using WILLAR, for example:

#include <reg51.h>
#define port P3
void delay(unsigned int); 
void main(void)
{
    for(;;)
    {
       port = 0x0;
       delay(1000);
       port = 0x0ff;
       delay(1000);
    }
}

void delay(unsigned int a)
{
    unsigned int i;
    unsigned int j;
    for(i=0; i<a; i++)
    for(j=0; j<120; j++);
}

It shows a message: The data out of range will be ignored. But if I use port P1, instead of port P3, my program burns successfully.

Where is the problem?

Abdurrahman Mubeen Ali
  • 1,331
  • 1
  • 13
  • 19
PradeepBhati
  • 63
  • 1
  • 3
  • 11
  • sir actually there is no error in program but when i burn this program in micro controller then it shows notification **"the data out of range will be ignored"**. when i test output on *port 3* pin there is no output value. if i take **p1** insist of **p3** it run correctly let me know why this happen. – PradeepBhati Aug 13 '12 at 18:32

1 Answers1

0

Port 3 is multy purpose specially reserved form timer/read/write/interrupt/. other port are general purpose. port0 and port1 may have pull ups you don't want to globally define port 3 instead you can use P3 in your program with hexa value

port=0xff instead of port=0xfff

Robert
  • 5,278
  • 43
  • 65
  • 115
jinulal
  • 1
  • 1