This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Simulation Difference from actual ADuC7026 chip

I'm using a ADuC7026. I'm using timer 1 as a counter (i.e. I want to have it count up to some number and then reset the count to zero). To reset the count, I execute the following lines:

T1LD  = 0x000;  // Set the load value to zero
T1CON = 0x0C0;  // HCLK, count down
T1CON = 0x7C0;  // P0.6 source, count up
My counter source is P0.6. When executing from the chip, after executing these 3 lines, the count it reset to zero and is ready to begin counting again. When simulating, however, the count is only reduced by 11, which is the number of states it takes to execute the 3rd line.

It seems that when a value is written to TxLD, that upon receiving the next rising edge of the clock source that the TxVAL is set to the value of TxLD. This behavior is not transfered to the simulator.

Can anyone think of a way to work around this in the simulator or maybe another way of reseting the count?

0