Keil™, An ARM® Company

Discussion Forum

use keil c51 for rtx51 tiny

Next Thread | Thread List | Previous Thread Start a Thread | Settings

DetailsMessage
Read-Only
Author
yuan peng
Posted
30-May-2005 20:52
Toolset
C51
New! use keil c51 for rtx51 tiny
I change the xtal value in options for target, but the ticks time not change, why?
select use simulator in options for debug.
Thanks for your answer!
Read-Only
Author
Reinhard Keil
Posted
31-May-2005 07:06
Toolset
C51
New! RE: use keil c51 for rtx51 tiny
You need to use the sec value to determine execution times. Another way is the Performance Analyzer.

Reinhard
Read-Only
Author
yuan peng
Posted
31-May-2005 20:17
Toolset
C51
New! RE: use keil c51 for rtx51 tiny
Thanks for your answer!
I am a beginer for keil c51, I found my question should be as follows:
when I change the xtal in options, but the time of timer0 which I used not changed.
Read-Only
Author
Reinhard Keil
Posted
1-Jun-2005 00:53
Toolset
C51
New! RE: use keil c51 for rtx51 tiny
Sorry, still I do not understand your question. What 'time' did not change? How did you measure this 'time'?

Reinhard
Read-Only
Author
yuan peng
Posted
1-Jun-2005 04:01
Toolset
C51
New! RE: use keil c51 for rtx51 tiny
I use timer0 to control the P1 output, but
the flash frequency not change as the xtal setting changed.
I watch the flash in simulator mode.
Push button "Peripheral" and select "Port0",
can see the port flash.

my program is as follows:

#include <reg51.h>
#include <stdio.h>

#define RELOADVALH 0x9e;//3C
#define RELOADVALL 0x58;//B0

unsigned int tick_count = 0;

void main(void) {
TMOD=(TMOD & 0xf0) | 0x01;
TR0=0;
TH0=RELOADVALH;
TL0=RELOADVALL;
TR0=1;
EA=1;
ET0=1;

for(;;) {
P0 = 0;
}
}

void timer0(void) interrupt 1 {
TR0=0;
TH0=RELOADVALH;
TL0=RELOADVALL;
TF0=0;
TR0=1;
tick_count++;
if (tick_count == 120) {
tick_count = 0;
P1 = ~P1;
}

//printf("tick_count=%05u\n",tick_count);
}
Read-Only
Author
Reinhard Keil
Posted
1-Jun-2005 09:48
Toolset
C51
New! RE: use keil c51 for rtx51 tiny
You are running on the simulator. The simulator shows the time in the register window under sec=.

Reinhard

Next Thread | Thread List | Previous Thread Start a Thread | Settings