[SOLVED] P89V51RD2 header in Keil?

Status
Not open for further replies.

vikky

Full Member level 3
Joined
Oct 18, 2007
Messages
150
Helped
4
Reputation
8
Reaction score
3
Trophy points
1,298
Visit site
Activity points
2,664
Hello

Can anyone please tell me what header should i use for P89V51RD2 in Keil.Tried both p89v51rx2.h and p89v51rd2.h but still getting errors related to header file.Thank you.

Regards

Vikky.
 

Greetings vikky
You can use either of them, Both are fine. There must be some syntax error in your program. post your code(in code tags).

Good Luck!!
 

Greetings vikky
You can use either of them, Both are fine. There must be some syntax error in your program. post your code(in code tags).

Good Luck!!

Thanks tushki7 for the reply.I found it has nothing to so with syntax because once i change the header to reg51.h it works fine.The header p89v51rd2.h attracts errors such as undefined identifier and there is a warning in the start saying cant open file p89v51rd2.h.Additionally it compiled well when i used SDCC compiler.The reason why i am shifting to P89V51rd2.h from 89c51 is i need to limit my code size in 89c51
 

Can't open file means that the compiler cannot find your p89v51rd2.h file in its include directory. Go to your keil INC directory and check if p89v51rd2.h header file is there. If its not there you need to download it from keil site.
Or
Your p89v51rd2.h file may be corrupted, re download it.

On the second thought after reading your first comment I am sure your both p89v51rd2.h and p89v51rx2.h files are missing from include directory.

Good Luck
 
Reactions: vikky

    vikky

    Points: 2
    Helpful Answer Positive Rating
you are right.its not there.i will copy paste the 89v51rx2.h file in that location.Can P89V51rd2 accommodate more code space than 89C51?
 

P89v51rd2 has 64KB flash while at89c51 has 4KB, p89 has some additional functions like its X2 mode, 1 more timer etc. There are many more differences, the point is it is better to use micro controller specific header files.
Note : Be careful unlicensed keil has a code size limit of 2KB only.

Good Luck!!
 

    V

    Points: 2
    Helpful Answer Positive Rating
I am using open source SDCC version to compile for P89V51RD2.So license must not be a issue i suppose.

- - - Updated - - -


Included the P89V51RX2 header file inside INC but now error showing is redefinition.Cannot open header file warning is not seen now.
 

Post your code here.
According to warning problem seems to be that you have included both header files if so, Don't use both header files, use either reg51.h or p89v51rd2.h.
Or
You may have redefine some port or something that is already defined in header file.

Good Luck !!!
 
Last edited:
Reactions: vikky

    vikky

    Points: 2
    Helpful Answer Positive Rating

Spot on!The library file had reg51.h definitions too.Deleted it.Now works fine.But is code size limit of P89V51RD2 and 89C51 same?
 

Read post #6 carefully, Code size limit of P89V51 is 64KB while At89C51 Flash only supports 4KB of data.
 

Yeah.i had read that.tried compiling but both in Keil and SDCC the two controllers seems to have the same code size.Program Size: data=128.0 xdata=0 code=2802 seems to be maximum for both codes.beyond that *** ERROR L107: ADDRESS SPACE OVERFLOW error is showing.
 

Status
Not open for further replies.

Similar threads

Cookies are required to use this site. You must accept them to continue using the site. Learn more…