We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
I have one program with RTXtiny on AT89C51. I compiled it successfully. Message was: Program Size: data=94.3 xdata=0 code=3903 creating hex file from "ds1302"... "ds1302" - 0 Error(s), 0 Warning(s). It occupied 94.3 data ram and 3903 bytes code rom in small mode.But when I use simulator to run this program. I got some error messages:
*** error 65: access violation at I:0xFE : no 'write' permission
When I changed target to AT89C52, I can run this program normally... I know that AT89C51 has 128 bytes RAM and 4096 bytes flash ROM. But why I can not run this proram on AT89C51?
Brs Tomy Lee
"*** error 65: access violation at I:0xFE : no 'write' permission"
The important bit is highlighted - does an AT89C51 have any IDATA...?
I am just only use small mode to compile this program. I think I don't need IDATA RAM. Isn't it?
Brs Tomy
The important bit is highlighted - does an AT89C51 have any IDATA...? well that depends the AT89C51 does not have any indirect only addressable data, but any byte in the ram can be addressed indirectly. The Keil 'standard' is that IDATA start where DATA ends which, most often, is below 128.
Now, since I have not used the small derivatives for ages (have I ever used a small processor and C, I doubt it, it would not make sense) there is one question: Does the Keil tools in the way the OP use them disallow IDATA for < 128 RAM processors ?
Erik
The RTX51 Tiny configuration allows you to change the top of the stack. By default, it is set to 0xFF.
The following manual page shows how the RTX51 Tiny stacks work:
http://www.keil.com/support/man/docs/tr51/tr51_stackmgmt.htm
The following manual page discusses configuration file settings for the stack:
http://www.keil.com/support/man/docs/tr51/tr51_cfgstack.htm
I would think that based on the previously described error that µVision generates, this configuration was left in the default state. Updating the configuration files to match the hardware would probably be my first step.
Jon
For such a small project, why are you using an RTOS anyway...?!
Hi.
You must change highest RAM address used for CPU stack RAMTOP EQU 0FFH ; default is address (256-1) ---> This for 89C52 with 256Bytes. For 89C51 this nubmer RAMTOP is 07FH !!!
Best Regards.
Sorry....
RAMTOP setting into file conf_tny.a51 ....
Best regards
Thanks for you help. And thank you Eduard, I think you are right. I will do it tonight and tell you results.
Best regards Tomy
OK.
Eduard
When asked questions the OP see no reason to answer.
As Eduard said, when I modified RAMTOP parameter from 0ffh to 7fh, and FREE_STACK parameter from 40 to 15, then my program run successfully. If I don't modify FREE_STACK from 40 to 15 or 10, this code also can not run.
Thanks Eduard again!