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
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
It doesn't seem to be exactly reproducible, although the sequence of events needed to trigger the problem may just be eluding me. I do have MON51 loaded, and yes; i'm using RTX51TNY (with round-robin disabled). Question: the keil documentation seems to say that STARTUP.A51 is the absolutely first piece of code run after a cpu reset. I must admit though, the problem did first occur once I started using the rtx51tiny rtos; so your suggestion as to the probable cause is likely correct :) cheers, Barry