In a PIC16F688 assembly language program, I'm trying to debug a time delay subroutine. It's just some nested loops that use up processor cycles. I need a one second delay—actually 999997 cycles which leaves 3 cycles for the main program to stop Timer_0. When I run it, it seems to use a couple more processor cycles than I've calculated. I was hoping the MPLABX simulator would have a facility for counting cycles, but if it does, then I haven't figured out how and where.
I've written my own PIC simulator in BASIC and have just added a cycle counter feature to it in order to test this routine. It shows two more cycles than I'd calculated, but that could be a bug in my BASIC simulator. I'd rather not compound my problems (and bugs) with the BASIC simulator. I'd prefer to do this in MPLABX if possible.
Anyone know if there's a cycle counter, and if so, how to access it?
I've written my own PIC simulator in BASIC and have just added a cycle counter feature to it in order to test this routine. It shows two more cycles than I'd calculated, but that could be a bug in my BASIC simulator. I'd rather not compound my problems (and bugs) with the BASIC simulator. I'd prefer to do this in MPLABX if possible.
Anyone know if there's a cycle counter, and if so, how to access it?
Last edited: