E-I-E…I/O? Data sheet - part IV

July 24th, 2008 Timothy D. Swieter Posted in Beginner, Hardware, SX Micro, Uncategorized 1 Comment »

Next in our series of the SX Data sheet is the I/O. There is a lot to cover here, so it may end up being a couple posts. First, look at page 3 of the SX20/SX28 data sheet for an overview of the I/O functions.

Flexible I/O
• All port pins individually programmable as I/O
• Inputs are TTL or CMOS level selectable
• All pins have selectable internal pull-ups
• Selectable Schmitt Trigger inputs on Ports B and C
• All output pins capable of sourcing/sinking 30 mA
• Port A outputs have symmetrical drive
• Analog comparator support on Port B (RB0 OUT, RB1 IN-, RB2 IN+)
• Selectable I/O

There are a lot of terms here that you may be unfamiliar with. Or maybe you heard them, but you are not sure what they mean. Flip in the data sheet to page 9. Page 9 to 12 of the data sheet covers the Ports of the SX. More specifically it is the I/O Ports. The Wikipedia article is good. Besides I/O port, this could also be called I/O or I/O registers (which are multiple registers).

I am sure when you read the top description on page 9 of the I/O ports you will be even more confused. One of the first things to recognize is that the I/O ports are made up of multiple 8-bit registers. Another thing to recognize is that each of these registers has a known, default state at power up. So what are the registers?

The diagrams on page 9 and 10 show the detail about the registers. There is a direction register. The bits in this 8-bit register determine the direction of each I/O line. If the least significant bit (bit 0) is a 1, then the corresponding I/O pin on that port is an input. If the least significant bit is a 0, then the I/O pin is an output. As stated in the data sheet, all I/O registers are initialized to 1 on power up. That means that all I/O pins are inputs at the moment the SX is first powered on. The software you write on the SX will change the pins to be outputs. (side note: Port A is only 4 bits while Port B and C are 8-bits and Port C is on the SX28 and not the SX20)

Another register that can be configured is the Pullup Enable Register. This register configures the pin with an ~20K ohm resistor tied to Vdd. This function is valuable when using the pin as an input. Usually there are external pullup resisters, but because this port has the ability to pullup, we can eliminate some external devices. A future post on switches will cover the pullup concept further.

The other register to mention is the TTL/CMOS selectable register. Usually a device is TTL or CMOS compatible. TTL and CMOS are construction techniques for chips and the different techniques determine the different operating characteristics of the device. If you jump forward to page 41 of the data sheet and review the middle part of the page you will see how the SX handles the I/O differently based on the selection in this register. If the chip is in TTL mode (default at power up) then the input will be on or 1 if the voltage on the pin is higher than 2.0V DC. It will be off or 0 if the voltage is below 0.8V DC. The region in between 0.8V and 2.0V is called the hysteresis because sometimes the input is on and sometimes it is off in this region. The hysteresis is undefined state and you should avoid having inputs “hang out” in this region because you will get erractic inputs.

There is much more to learn here, stay tune for another post.

AddThis Social Bookmark Button

Further Reading

July 22nd, 2008 Timothy D. Swieter Posted in Beginner, Intermediate, Tool, Uncategorized 1 Comment »

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?

AddThis Social Bookmark Button

Project: SX & VGA

July 18th, 2008 Timothy D. Swieter Posted in Hardware, Intermediate, SX Micro, Uncategorized No Comments »

Check out Michael Kohn’s web site. He used an SX to create a VGA signal. This a good example of a simple project that harnesses the raw speed of the SX.

AddThis Social Bookmark Button