 | Discussion Forum |  |
|
|
RTX bugs in Atmel AT89C51Next Thread | Thread List | Previous Thread Start a Thread | Settings | Details | Message |
|---|
Read-Only Author John Lin Posted 2-Jan-2004 07:35 GMT Toolset C51 |  RTX bugs in Atmel AT89C51 John Lin Hi~ All I have write a RTX51 test program with AT89C51, see following code:
#include <reg51.h> #include <rtx51tny.h> void init (void) _task_ 0 { os_create_task (1); os_create_task (2); } void LED (void) _task_ 1 { P2=0; } void LED2 (void) _task_ 2 { P2=1; }
and this compile is OK, but when debug run something error: error message as below: *** error 65: access violation at I:0xFE : no 'write' permission
but when I change to at89c52, the same code is OK. So is there something wrong in RTX51? | | Read-Only Author Hans-Bernhard Broeker Posted 2-Jan-2004 11:43 GMT Toolset C51 |  RE: RTX bugs in Atmel AT89C51 Hans-Bernhard Broeker That message means that the simulator doesn't believe there's any IDATA memory at that address. Cross-check that with the data-sheet, and your settings in the target options dialog of uVision2 , please. | | Read-Only Author Dejan Durdenic Posted 2-Jan-2004 13:03 GMT Toolset C51 |  RE: RTX bugs in Atmel AT89C51 Dejan Durdenic As far as I remember, 89C51 has only 128 bytes of internal RAM, so 0xFE is out of address space.
regards
Dejan | | Read-Only Author Jon Ward Posted 2-Jan-2004 19:35 GMT Toolset C51 |  RE: RTX bugs in Atmel AT89C51 Jon Ward Task 1 and task 2 set P2 and then exit. they never run again. You should probably have a while (1) at the end of each of these functions.
Additionally, task 0 also just exits. This is probably NOT what you should do. Calling os_delete_task is the best idea if you just want to kill off these tasks.
Jon | | Read-Only Author John Lin Posted 5-Jan-2004 02:13 GMT Toolset C51 |  RE: RTX bugs in Atmel AT89C51 John Lin Thanks for the replies~ I think I found the problem. Just as Dejan says, 89C51 only have 128 bytes rams, and RTX51 defaulty uses 256 bytes rams, so problems happened. We must change Ramtop value from 0xFF to 0x7F and it works. | | Read-Only Author Eduard Jadron Posted 7-Jan-2004 07:25 GMT Toolset C51 |  RE: RTX bugs in Atmel AT89C51 Eduard Jadron Hi.
RTX51 tiny required 256Bytes Internal RAM. Only 89c52 or higher. One task 3*IDATA. RTX51 Full need external XDATA. Your definitions task is incorrect.
Good bye.
void Job1(void) _task_ 1
{
while(1)
{
P3=~P3;
}
}
void Job2(void) _task_ 2
{
while(1)
{
P1=~P1;
}
}
void Job0(void) _task_ 0
{
os_create_task(1);
os_create_task(2);
os_delete_task(0);
}
| | Read-Only Author John Lin Posted 7-Jan-2004 08:44 GMT Toolset C51 |  RE: RTX bugs in Atmel AT89C51 John Lin Hi~ Thanks for your advise,Just as I say before,RTX default need 256 bytes, but we can modify the ram size where on the CONF_TNY.A51. So it works on AT89C51 too. Hopes this is use for you ^_^ | |
Next Thread | Thread List | Previous Thread Start a Thread | Settings |
|