Simulator and external events

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

Brand new to AS7.  Started playing with the simulator for the first time, and ran into this: my code uses i2c/twi.  In my specific example, it starts an i2c communication and waits for the TWI interrupt bit to be set - which never happens.

 

Now, I've found at least two solutions to that - I can break the code and manually set the register bit, or I can go into the disassembled code wait for the BRGE instruction, and set/clear a status register bit to get past it.

 

But I'm wondering if there's a better way.  Is there some way to simulate responses from the i2c bus?  What about other external events?  If, for example, the code was waiting on a button press, would I have to manually set the register to make it work?

 

Thanks.

This topic has a solution.
Last Edited: Fri. Jan 19, 2018 - 08:48 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 1

jgalak wrote:
I'm wondering if there's a better way

Use an actual target with debug ... ?

 

Top Tips:

  1. How to properly post source code - see: https://www.avrfreaks.net/comment... - also how to properly include images/pictures
  2. "Garbage" characters on a serial terminal are (almost?) invariably due to wrong baud rate - see: https://learn.sparkfun.com/tutorials/serial-communication
  3. Wrong baud rate is usually due to not running at the speed you thought; check by blinking a LED to see if you get the speed you expected
  4. Difference between a crystal, and a crystal oscillatorhttps://www.avrfreaks.net/comment...
  5. When your question is resolved, mark the solution: https://www.avrfreaks.net/comment...
  6. Beginner's "Getting Started" tips: https://www.avrfreaks.net/comment...
This reply has been marked as the solution. 
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 1

You have some stimuli features: http://www.microchip.com/webdoc/...

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

je_ruud wrote:

You have some stimuli features: http://www.microchip.com/webdoc/...

 

Aha!  Will explore this.  Thanks!