bad cpu/memory?

Hello everyone, this time I doubt the problem is caused by my (lack of) c skills, as the issue occurs inside the standard keil STARTUP.A51 file :)

Have a look at this assembly code;
I expanded it to be more "granular", so as to see exactly which partial instruction is failing:

IF IDATALEN <> 0
MOV R0,#IDATALEN - 1
IDATALOOP:
CLR A
MOV @R0,A
DEC R0
MOV A,R0
JNZ IDATALOOP
; DJNZ R0,IDATALOOP
ENDIF

This piece of code sometimes stalls (seemingly at random); if I step into it with the uVision debugger, I see the DEC R0 instruction decrementing R0, then the MOV A,R0 puts the old(!) value of R0 into A.

To me that says faulty hardware. [confirm/deny]?

my IDATALEN is 80H, and i'm using a 8252.


Cheers,
Barry

Parents
  • Barry
    Graham's suggestion is a good one but I would like a few more details.
    Does the problem occur on the first startup or after a debugger reset?
    Are you running on a target with the debug monitor loaded?
    Are you using a version of an RTOS with your program?
    Does offsetting your initial program load change the symptoms.
    I do not feel that you have a memory problem at this time but long distance trouble shooting is worth every penny.
    Bradford

Reply
  • Barry
    Graham's suggestion is a good one but I would like a few more details.
    Does the problem occur on the first startup or after a debugger reset?
    Are you running on a target with the debug monitor loaded?
    Are you using a version of an RTOS with your program?
    Does offsetting your initial program load change the symptoms.
    I do not feel that you have a memory problem at this time but long distance trouble shooting is worth every penny.
    Bradford

Children
More questions in this forum