CYCLE_COUNTER and Simulator

Go To Last Post
11 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

 

 

When I run the simulator, I can print out the CYCLE_COUNTER in the debug output window. But the chip I am currently using (attiny427) does not have a simulator. Also, the CYCLE_COUNTER does not work with ICE.  I would still like to count the number of CPU cycles to reach certain breakpoints in the program. I suppose i could use the hardware timer, but I am using both timers for other purposes in the program. Are there any other options for counting the cycles? 

 

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

There are three timers. (TCA0, TCB0, TCB1)
In addition, TCA can be split.
Do you really have no resources?

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

kabasan wrote:

There are three timers. (TCA0, TCB0, TCB1)
In addition, TCA can be split.
Do you really have no resources?

 

Currently I am using the 16-bit counters. Yes, I can split, and re-write the code to accomodate. But I wanted to know if there are any other options I might be overlooking.

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

As far as simulators go, if AS7 doesn't support a chip then MPLABX might. I'd rather use AS7 but having other options is never a bad thing and it has helped me out.

I reserve my right to assemble!
Brawndo's got what plants crave... It's got electrolytes!

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I regularly look at the compiled assembly and manually count the opcode cycles.  If it's just a short bit of code like a small ISR then that is really quick and easy to do.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Got a spare pin? Toggle it and connect your scope/logic analyser. 

#1 Hardware Problem? https://www.avrfreaks.net/forum/...

#2 Hardware Problem? Read AVR042.

#3 All grounds are not created equal

#4 Have you proved your chip is running at xxMHz?

#5 "If you think you need floating point to solve the problem then you don't understand the problem. If you really do need floating point then you have a problem you do not understand."

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

asarangan wrote:
But the chip I am currently using (attiny427) does not have a simulator.
Indeed; closest with simulator is tiny1627.

 

"Dare to be naïve." - Buckminster Fuller

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Can add CLKOUT on PB5.

59B0F Data Sheet ATtiny424/426/427/824/826/827 (page 17)

 

"Dare to be naïve." - Buckminster Fuller

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 1

ATtiny427 is basically a ATtiny1627 with less memory. A simulation with ATtiny1627 would give you the same result as a simulation with ATtiny427 would have.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

closest with simulator is tiny1627.

That's weird.  I could understand not having correct cycle counts due to the new instruction timings, or not "understanding" the nvmcontroller and mapped flash, but I see a reason for not support the 427 if the 1627 IS supported.

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 1

je_ruud wrote:

ATtiny427 is basically a ATtiny1627 with less memory. A simulation with ATtiny1627 would give you the same result as a simulation with ATtiny427 would have.

 

Great advice. Thank you.