Multisim and Ultiboard

cancel
Showing results for 
Search instead for 
Did you mean: 

Incorrect machine-cycle count in 8051 MCU (Multisim)

When I simulate the 8051 code below in Multisim 11.0.1, the machine-cycle count, as registered in TL0, does not increment correctly. Specifically, on some passes of the LOOP iteration, the instruction MOV P1,#00h, causes a machine-cycle count increase of 2 (which is correct) but on other passes of the same instruction the machine-cycle count (TL0) only increments by 1 (incorrect). The timing signal associated with P1, on execution of the same offending instruction, simulates the correct timing (every time) that would be expected for a 2-cycle instruction. I have simulated the same code in other simulators and the machine-cycle count (as registered in TL0) increments correctly with no problems. Am I missing something or is this a bug in Multisim? Any help greatly appreciated, thanks.

 

$MOD51 ; This includes 8051 definitions for the Metalink assembler

; Please insert your code here.
MOV TMOD,#01h;16-bit count mode for timer 0 (TL0, TH0)
SETB TR0 ;enable the count
MOV P1,#00h
MOV R1,#0Ah
LOOP:
INC R0
MOV P1,#0FFh
MOV P1,#00h;this instruction, sometimes, increments the machine-cycle count incorrectly on some passes of LOOP!!
DJNZ R1,LOOP
JMP $
END

 

0 Kudos
Message 1 of 2
(3,100 Views)

This issue has been identified as a bug and will be investigated for fixing in the next version of Multisim.

 

Kind Regards,

Joel G
Applications Engineer
National Instruments UK & Ireland
0 Kudos
Message 2 of 2
(3,067 Views)