Timer in simulation

cpedw

Senior Member
I'm planning a project using timer with settimer and setintflags on a 20X2. Will timer variable keep realistic step with the commands in the simulator?

In this thread, Buzby appears to say Yes but Hippy's post:

McAlester said:

I am beginning to think that the Programming Editor does not simulate timing.

That's probably correct for hardware timers which can have all manner of configurations which the simulator can't really hope to keep track of while simulating the software side of things. It is a simulator rather than an emulator.
makes me uncertain.

Derek
 

Buzby

Senior Member
Hi Derek,

Working with interrupts and timers in the simulator is very frustrating !.

That's why I said, in that post you linked, "I found it much easier to use a real chip when coding stuff with timers."

If your final design is going to use the interrupt from the timer, its easier to call that routine in the simulator from a pin state change or a loop counter. Once you are happy that the routine does what you want, then move to a real chip.

You will find it easier if you take it a step at a time.

Write some test code on the real chip which just sets the timer interrupt, then goes into an empty loop. Code the interrupt routine to just toggle a LED or sertxd a number.

Once you get this 'skeleton' working you can add the detail step-by-step.

Cheers,

Buzby
 
Top