This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

I/O problem

Dear all,

I have a working program which has been running for about a year. This project uses the AT89C51ED2 from Atmel. Seeing as I was using uV Version 7.02 which didn't support this chip I decided to upgrade and am now running V7.50a (I believe the latest).

I did some alterations on the above mentioned project like changing timers and including the origional keil header file instead of the one I altered myself, and then recompiled.

Tested the project in the simulator, everything seems ok.

Then I flashed a chip and.... nothing....

Even the Outputs didn't get set to "0".

After examining the header files I came accross the following differences.

Old altered file:

sbit P1_7 = P1^7;
sbit P1_6 = P1^6;
sbit P1_5 = P1^5;

New AT89C51XD2.h file

Sbit (P1_7 , 0x90, 7);
Sbit (P1_6 , 0x90, 6);
Sbit (P1_5 , 0x90, 5);

etc...etc...etc...

In my progarm I have the following:

sbit relais = P1^1;
sbit active = P1^0;

etc...etc...

The question: Could this be the cause of the problem? If so, why don't I get compiler errors?

Thanks in advance for any responses.

Regards
John Garrelts

Parents
  • I understand that the address of P0^0 = 0x90 bit 0. I'm just trying to understand why a previously running program stopped running. The only main thing I changed since ungrading was the header files.

    My guess is a mistype like the one above (P0^0 = 0x90 bit 0). NOTE, the mistype could be in your original header file.
    One of the meanest bugs I have been exposed to was modifying a project where the original coder (this could not have been a programmer) had "fixed" errors by e.g. when he found out that what he had coded a being attached to p1.5 really was at p0.3 he changed the definition of p1.5 to 0x83.

    When I say "the mistype could be in your original header file" I am not trying to insult you, but mistakes DO happen.

    Erik

Reply
  • I understand that the address of P0^0 = 0x90 bit 0. I'm just trying to understand why a previously running program stopped running. The only main thing I changed since ungrading was the header files.

    My guess is a mistype like the one above (P0^0 = 0x90 bit 0). NOTE, the mistype could be in your original header file.
    One of the meanest bugs I have been exposed to was modifying a project where the original coder (this could not have been a programmer) had "fixed" errors by e.g. when he found out that what he had coded a being attached to p1.5 really was at p0.3 he changed the definition of p1.5 to 0x83.

    When I say "the mistype could be in your original header file" I am not trying to insult you, but mistakes DO happen.

    Erik

Children