Would you like to react to this message? Create an account in a few clicks or log in to continue.

You are not connected. Please login or register

Is mcs51's machine cycle time correct?

2 posters

Go down  Message [Page 1 of 1]

1Is mcs51's machine cycle time correct? Empty Is mcs51's machine cycle time correct? Thu Aug 31, 2023 3:21 pm

royqh1979



It seems that mcs51's machine cycle time is 0.5us.

Is mcs51's machine cycle time correct? Snap613

But the 8051 user guide says it should be 1us.

Is mcs51's machine cycle time correct? Snap813

So I wonder if the clock is not correcly handled?

royqh1979



Is here right? Should it be 12?

Is mcs51's machine cycle time correct? Snap912

arcachofo

arcachofo

So I wonder if the clock is not correcly handled?
Most probably yes.

Is here right? Should it be 12?
Yes, there is, but I need to have a look.
8051 does 2 read cycles per machine cycle, so it needs to be called every 6 clock cycles.

royqh1979



So is the i51timer implementation not correct? It should increment every 2 read cycle instead of 1? (If "clock cycle" displayed is "read cycle", not "machine cycle" )

Is mcs51's machine cycle time correct? Snap1012



arcachofo wrote:
So I wonder if the clock is not correcly handled?
Most probably yes.

Is here right? Should it be 12?
Yes, there is, but I need to have a look.
8051 does 2 read cycles per machine cycle, so it needs to be called every 6 clock cycles.

royqh1979



I think here should divide "psCycle()*2" instead of "psCycle()",
because psCycle() is read cycle time, which is 1/2 machine cyle time.

Is mcs51's machine cycle time correct? Snap1110

arcachofo

arcachofo

The problem is not only about Timer.
There are other issues to solve.

royqh1979



arcachofo wrote:The problem is not only about Timer.
There are other issues to solve.

I'm trying to use 8051 timer/counter to delay. And it's a bit too fast.

It shoulde count about 65535 machine cycles = 65535 us.

But time displayed is 32787.5, half of it should be.

Is mcs51's machine cycle time correct? Snap613

arcachofo

arcachofo

I'm trying to use 8051 timer/counter to delay. And it's a bit too fast.
It shoulde count about 65535 machine cycles = 65535 us.
But time displayed is 32787.5, half of it should be.
Yes but the underlying problem is not exclusive for Timers.
We need a solution that fix the discrepancy between read cycles and instruction cycles.

arcachofo

arcachofo

I think it should be solved at Rev 1836.

Sponsored content



Back to top  Message [Page 1 of 1]

Permissions in this forum:
You cannot reply to topics in this forum