c51 program on oregano mc8051

Status
Not open for further replies.

irun2

Member level 2
Joined
Jan 20, 2008
Messages
49
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,286
Activity points
1,701
Hi there,
I think some of you may have the experience of using oregano mc8051 core, current version is 1.5.
Recently I did some simulation on it, using asm and sometimes c51 coding. Strange enough this core can run nicely with the codes written as asm, but when I applied the .dua file which is converted from the hex file generated by keil( the source code is c51), it does not function correctly. Till now I haven’t figured out the cause..
Here is an example.:
/* source code */
#include <reg51.h>
#include <math.h>
/*---------------------------------------------------------------------------*/

void main() {
float x = 3.0;
float y = 4.0;
float xx, yy, xx_yy, sqrt_xx_yy;
xx = x * x;
P0 = (unsigned char)xx;
yy = y * y;
P1 = (unsigned char)yy;
xx_yy = xx + yy;
P2 = (unsigned char)xx_yy;
sqrt_xx_yy = sqrt(xx_yy);
P3 = (unsigned char)sqrt_xx_yy;
while(1);
}
I used keil to create a hex format file, then turn to hex2dua.exe to convert it to a .dua file to initialize the rom. It just didn’t work correctly. The P0, P1, P2 and P3 ports remain the FF value.
I am wondering now is that it does not support c51 programming at all?
modelsim sim capture for your ref:
 

Attachments

  • divmul.PNG
    12.1 KB · Views: 87

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…