What happened?

This is where you'll see the difference between playing with a little plastic chip and playing with the Web, Windows, Unix, MAC and all those other huge toys.

Remember the end bit of this?

How, and why, did it jump out of the loop and start again at the beginning?

A "normal" program wouldn't. But most microprocessors have a thing called a watchdog. It's a friendly thing.

Here is one:

Related image
The watchdog keeps an eye on what your code is doing. We'l go more into it later, but the reason the code jumps back to the beginning is because of him.

You can turn him off. Put him back in his kennel.

Let's do that. In the Window Menu, underTarget Memory Views, click on Configuration bits.



Look down the bottom, you'll see them.



There's one there called WDTE. You can find it. Click where it says ON and turn it to OFF.

Now debug the program again, and see if it runs ad infinitum. That's Latin. Impressed?

Bet it does. Hope it does.

I'm off now for a few days, have fun!

Comments

  1. It worked wonderfully - once I'd put those pesky semi-colons in...

    ReplyDelete

Post a Comment

Popular posts from this blog

Get the software

Your first test

Lights!