SX Tech Board

July 31st, 2008 Timothy D. Swieter Posted in Beginner, Hardware, SX Micro 2 Comments »

Let’s take a small break from the data sheet series. I was reviewing some old posts and thought a few more pictures need to be added to this blog. How about an overview of the SX Tech Demo board?

The SX Tech Demo board is only available in the SX Kit from Parallax. The board design is simple as you can see. There is a plug for power input, a 5V DC voltage regulator, an LED to indicate power, a socket for an SX28 DIP chip, a spot to plug in either an SX-Key or an oscillator and a breadboard for prototyping your circuits.

The backside of the board

The back side of the PCB isn’t anything special, but I thought I would show it to you anyway.

The backside of the board

Here is the plug for power input. Note the symbol on the left side. First the text tells us that the input voltage should be 6 to 9 volt direct current (DC). The symbol above the text says that the center of the barrel power plug should be positive and the outer ring should be negative or common. Why is the minimum 6V DC? The on-board regulator is a linear regulator. Since the on-board regulator regulates the voltage to 5V DC, the incoming voltage must be above 5V.

Finally here is a close up of a USB SX Key attached to the board. Note the orientation. This is very important. The back side of the SX Key has text indicating which pin is which. Be sure to double or triple check all connections to before applying power.

Allow me a moment to say something about the breadboard. I am happy that the breadboard is included with this board. I am even happier that all the I/O signals are brought to convenient headers next to the breadboard. This breadboard should do well for prototyping small circuits. If your circuits require more real estate, consider using a larger external breadboard and extend your I/O to the other breadboard. Be cautious though, if your I/O is operating at fast rates, then your wires in between the breadboard and SX Tech board may cause circuit problems.

AddThis Social Bookmark Button

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

Reset: Data sheet - part III

July 18th, 2008 Timothy D. Swieter Posted in Beginner, Hardware, SX Micro, Software 4 Comments »

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.

AddThis Social Bookmark Button