VMLAB with ATtiny13
VMLAB is a free tool that you can use to test your code virtually. Official website: http://www.amctools.com/vmlab.htm
VMLAB does not support the ATtiny13 official, but you can use the ATtiny12 as settings when creating a new project.
You also need the tn13def.inc in your project folder to make it work. You can get it here zipped, tn13def.inc
Now let's get a simple example running. I will use the Assembly code used in the Basics Programming ATtiny13 page on my site. For the fast people, get it here zipped, The Code
The code is a fast ON and OFF signal on the pin PB3 of the ATtiny13. For example making a LED blink. The pulse is calculated ±64 ms.
I used this tutorial as reference and adjusted it to my needs. When you made your project, add the following code to the project text.
D1 VDD D1_NODE
R1 D1_NODE PB3 0.62K
.PLOT V(PB3)
The first line will make a diode (number 1) on node D1_NODE. The second line will make a resistor of 620 Ω on the same node and connect to pin PB3. The plot line makes sure the signal gets plotted in the scope. Here is how it looks:

Next we press Build and if everything goes OK you get success message and can press the traffic light. If you have no scope window, go to view menu and select it. The scope will show the image below, counting the spots you can see it is around 64 ms:

When pressing Analyze you get 7.8 Hz. If we change that by 1/7.8 = .128... and divide that by 2, we get 0,06410 seconds. That is 64,1 ms. Right on the spot we calculated. Great!
I still got a lot to learn about VMLAB, but it shows great possibilities.
Thanks for reading. Got any crit or advise, please comment.
February 10th, 2010 - 21:46
Lars,
This is an excellent beginners tutorial on VMLAB. I followed your instructions and only had one minor problem. I forget initially to change the default clock frequency of 1.0 Mhz to 1.2 Mhz.
February 11th, 2010 - 14:38
Thanks.
Good point about the clock (Mhz). I will leave your message here so people can read it.
April 9th, 2010 - 11:37
Hi,
good Tut for beginners (as I am).
But as I understand it, there is a little mistake in your connection diagram.
With the command:
D1 VDD D1_NODE
R1 D1_NODE PB3 0.62K
I think a Diode is connected to VDD (5V, not GND) with its anode and with its cathode to the resistor R1, whose other pin is connected to Port B3. So this is how I would wire it in reality. I rebuilt this in VMLab and the diode turns ON whenever Port B3 is 0. This suggests my belief, too.
Or am I wrong with this? I’m a little confused.
April 15th, 2010 - 23:46
Thanks for reply. I took that code from the other website/tutorial and someone says this:
=================
# scienceprog Says:
September 4th, 2006 at 2:26 pm
Diodes can be connected only to VDD. this means that anode has to be connected to VDD like D1 VDD PD1
==================
For double check you could try the vmlab forum.