Archive for July, 2008

Further Reading

Tuesday, July 22nd, 2008

I am out traveling so I don’t have time to cook up a technical post for you. How about book recommendations? If you are new to electronics and robotics I have a couple books to recommend. If you have been experimenting and learning for a while, then maybe you have come across these resources before. These books are valuable and I recommend getting a copy.

The first one is by Forrest Mims. Forrest has written countless books and magazine articles explaining electricity, electronics and science in easy to understand terms. I first got this book when I was as youngster. Now, I am an electrical engineer. I can’t begin to imagine how many other people became engineers after reading Forrest materials and getting started on a path in electronics.

Gordon McComb is the author of my second recommendation, a robot book. Gordon wrote the first edition of the Robot Builder’s Bonanza before robot books existed. Since the first edition he has revised and updated the book using modern materials and tools and knowledge. Gordon also writes regular articles for Servo Magazine.

Have you heard of Make Magazine? If not, then where have you been? Do you have a subscription yet? Go ahead get it. This magazine is chuck full of electronic, art, mechanical and other such projects. This magazine will blow you away with ideas and cool projects.

What do you recommend?

SX/B Book by Jon Williams

Saturday, July 19th, 2008

Jon Williams (aka JonnyMac of the Parallax Forum) is still working on his SX/B book. You can find a draft copy of the parts I and II in this thread. From what I read the book is still a ways out from being finished, but will be updated to match the new SX/B 2.0 compiler release. For now you can watch the thread and stay updated on news to come.

Reset: Data sheet - part III

Friday, July 18th, 2008

In Data sheet - part II one of the comments asked a questions about the /MCLR function on the SX. I answered the question in the comments of that post, but we should explore the reset function a little further.

Open up your SX20/SX28 data sheet and turn with me to page 30. Just prior to this page is a detailed explanation on the reset circuit. We can read that later, but on page 30 we see a table. This table is titled “REGISTER STATES UPON DIFFERENT RESET OPERATIONS” and it shows that there are five different ways the SX can be reset. Each way is triggered by a different path and each way leaves the internal registers of the SX in a particular state. This is important to remember as you get deeper into the SX and its software.

The wakeup reset is slightly different from the other four reset options. The Power-On, Brown-Out, Watchdog Timer, and MCLR all initialize the chip to start the code execution over. The wakeup is slightly different and continues execution where the program left off last. The wakeup is commonly used to put the SX “asleep” to save battery and processing. I need to read more myself before I can explain this further.

How about a brief description of each reset:

  • Power-On: As the name suggests the reset condition when the device is first powered on. The MCU is kept off until the voltage crosses a certain threshold and is stable.
  • Wakeup: This reset condition is usually caused by an external event to cause the MCU to stop “sleeping” and to start processing again.
  • Brown-Out: If your Vdd supply voltage (+5 or +3.3) dips below a threshold the MCU will turn off to ensure it does not create erratic output. A dip in the Vdd could be from low batteries or from motors turning on and off.
  • Watchdog Timer: This reset is a good option in critical systems where you must ensure that the chip is operating at all times. What I mean is you can set a timer in the MCU. If the timer expires before the software gets around to servicing the timer, then the MCU resets. This can help to ensure the MCU doesn’t lock up or get stuck processing one thing when it should be doing another task.
  • MCLR: This reset is similar to the Power-On and Brown Out, but this reset is often caused by a user or some other external event. The circuitry inside the chip for Power-On, Brown-Out and MCLR is similar.

OK - now go ahead and read page 28 and 29 if you haven’t. The description is a little technical if you are not familiar with electronics. The basic thing to understand though is that the instant you apply power to a system the MCU isn’t on yet. There is a slight delay, very small, that keeps the MCU off until the Vdd has stabilized.

That is about enough of an overview of the reset for now.