DRO Interface Pin Functions for MSP430 LaunchPad

Sunday, January 12, 2014

Last week, after posting the “Roadmap for the DRO project”, I received a few emails from different people who were working on developing a custom PCB for the controller that can use the firmware I created. During one of the conversations it dawned on me that I never explained what my intentions for the Launchpad Interface are. At this point a lot of the controller functionality is still “vaporware” (i.e. I’m still working on it). Fortunately, when selecting the platform for the DRO controller I planned out the connections. I wanted to be sure that MSP430G2553 that come with the “Value Line” LaunchPad kit, so I carefully mapped out the future needs. In this post I will try to explain how the pins are currently used, and which pins will be used for future expansion.

I get copious amounts of flack for not posting the source code and designs sooner, but there is a good reason I “procrastinate”. Even though the DRO is a relatively small project, the fact that I decided to go the open source route comes with some responsibilities on my part. For instance, once the source code or a hardware design is posted on the blog, I consider the interface to become a contract and I can’t just change it at will. This way, when someone creates an adapter board or makes a change to the firmware, they can be certain that their contribution will be compatible with the rest of the system. The practical implication for me is that when I need to make changes, I can only add things, but the existing functionality needs to stay in place. With this in mind, it’s makes sense to hold off until I’m certain that the design will stick around.

Scale and Sensor Connections

At the time of this writing there are three different versions of DRO interface firmware for MSP430G2553 microcontroller: “Basic” (supports only iGaging scales), “Universal” (supports a mix of inexpensive capacitive scales), and “Quadrature” (supports only quadrature encoders, such as glass or magnetic scales). Neither of these versions supports tachometer or edge probe (yet). My goal for the near future is to unify all three versions into a single “Mixed Scale” firmware that can auto-detect and read all of the above scales and add the missing functionality.

MSP430 Launchpad pins used for sensor/scale connections
  • X/Y/Z/W Clk/A - clock line input for capacitive scales using iGaging (21-bit), BIN6, 7 BCD and Sylvac (2x24) protocols; “A” channel input for quadrature encoders.
  • X/Y/Z/W Data/B - data line input for capacitive scales; “B” channel input for quadrature encoders.
  • Tachometer A/B - input lines for a directional tachometer that uses square quadrature signal. For non-directional tachometer the firmware will simply count pulses per second on the “A” line, so “B” channel can be left disconnected.
  • Edge probe - input line for an normally-open edge probe.

Please note, all of the above input pins have large value (approx 50 Kohm) internal pull-down resistors enabled in the firmware.

Data Connections

The controller sends the data to the application via UART (serial port), using either a UART-to-Bluetooth adapter or an Serial-to-USB adapter. Each UART port has two lines: Rx and Tx; standard connection scheme is Rx->Tx and Tx->Rx. Since the firmware only uses one-way communications with the application, only MSP430’s Tx pin needs to be connected to the adapter’s Rx.

MSP430 Launchpad pins used by the BlueTooth transceiver

Please note, the microcontroller that ships with the current version of the Value Line Launchpad (MSP430G2553) has hardware UART implementation. Effective as of Rev. 1.4, Rx and Tx ports on the Launchpad are swapped. The unrelying connections are the same, and the change is in the “legend” only. I.e. the older version of Launchpad works just fine with the new chip.

Power Connections

Finally, for those building a DRO unit, here are the points of the LaunchPad where different power supply and the ground connections.

Power and ground connections

Please keep in mind, though, that the 5V voltage available at TP1 come straight from the Mini-USB connector; there is no on-board 5V regulator. When the board is connected to a PC, the 5V supply is likely clean and tightly regulated; if you plug the board using a “wall wart”, make sure that the voltage is what it says it is, or you might end up frying a set of expensive scales.

18 comments :

  1. Hello Yuri
    Can we add a 78L05 on the input for protection?
    and also is there any meaning to add L1117 on each channel (XYZ)?
    Kind regards
    Kyriakos

    ReplyDelete
    Replies
    1. Kyriakos,
      There is a number of problem with adding a regulator:
      1. 7805 and 1117 have some dropout voltage. If I remember right, 7805 needs 7V to output 5V, so the dropout voltage is 2V.
      2. Linear regulators need some minimum load or they won't be stable. That load is on the order of 10-20mA. I don't think the scales draw that current...

      The solution is to make sure that the power supply is regulated (and clean). Most good phone chargers work well enough; it's the ultra-cheap stuff that might cause problems.

      Hope this makes sense.
      Yuriy

      Delete
  2. Hello Yuri,

    Maybe it's also a good idea to define some pins or functionality to be able to use the scales
    in "fast" mode. Per scale 2 bits are necessary. The 1st Bit should pullup the CLK line
    and the 2nd should pullup the DATA line for a short period of time.

    Best regards,

    Arno

    ReplyDelete
    Replies
    1. Arno,
      It would be nice, but the basic setup pretty much maxes out the chip. The only two pins left are the LED pins, which are not critical. I think the most viable approach would be to use a two-way bus driver chip and use one of the LED pins to toggle the direction. This way it would be possible to switch to "output" mode, toggle the fast mode and the go back to reading.

      Regards
      Yuriy

      Delete
  3. Tried to move the MSP430 off the Launchpad to my own board but the radio connects then disconnects. Anything I'm missing that the launchpad has I need & missing?

    ReplyDelete
  4. Yuriy,

    Just found your project, must say, awesome job!

    I'm looking to start the DRO build project for my mill. I am looking to build with the MSP430 LaunchPad. I've looked at TI website and found a newer version of the LaunchPad, called the MSP-EXP430F5529LP. Will this model work with your code base? It seems to have more memory, etc...

    Thanks.
    Jeff From Florida

    ReplyDelete
  5. Hi Yuriy
    Excellent project I have most of my assembly completed,3 out of 4 scales mounted on my mill, and the beta version of the app on my tablet. I will be using a tach and at a later date a touch probe,at the moment the tach I am using is based on a simple magnet and reed switch. Should the pin for each of these be pulled to vcc or gnd?
    Thanks
    Steve

    ReplyDelete
  6. yuriy,

    Originally I built the BASIC MSP430 unit, using only X/Y axis at that time. Since than, I added the Voltage Shifter circuit for the Z-axis I am about to add to my mill. I've noticed in the pin-out pic posted above, you have marked P2.0, P2.1 and P2.2 as Clock line Inputs and P1.7 as Clock out.

    I'm a bit confused, In the Basic build you have all D- on the micro-usb boards going to P1.7?

    If I am adding support for HF scales for the z-axis, Do I need to use P2.2 as the clock line and P2.3 for the data line connected through the Voltage Shift circuit? and leave the other X/Y clock lines connected to P1.7?

    ReplyDelete
  7. Yuriy,
    This is a great project, hope your still checking in here. I have a project that needs XYZ and A or an axis expressed in degrees. I only looked at the app briefly, and only saw config for mm or inch, not degrees of rotation. Is this possible?

    ReplyDelete
    Replies
    1. JIm,
      It's not implemented (yet). I added some hooks for three angular axes but haven't finished the UI, etc.

      Thank you
      Yuriy

      Delete
    2. Any progress on the angular axis?
      My project requires X,Y and Q for a rotary encoder that displays angular readingd in Deg, Min and Sec.

      Delete
  8. Yuriy,

    You talked about quadrature scales, I'm looking at some scales that are not quadrature, these only have the A+ and B+ TTL single and not have the A- B-. My understanding you need the second A- and B- to make it a quadrature scale. My question is this the case and can I use a scale with a TTL single with just A and B non quadrature.

    Thanks,

    Steve

    ReplyDelete
    Replies
    1. Steve,
      A+ and B+ are sufficient, as long as they output square waves. A- and B- are complimentary signals and are used for noise cancellation.
      In fact you would need special chip to connect A+/A- to MSP430.
      Thank you
      Yuriy

      Delete
    2. Yuriy,

      Thanks the scales worked just like you said


      Stwvw

      Delete
  9. Yuriy,

    Thank you once again, The scale produces a square wave.

    Steve

    ReplyDelete
  10. Can you confirm how the PROBE pin works? I'm assuming I should connect one clip to the mill bit, and another to the work piece, with one of them being connected to the PROBE pin and the other connecting to VCC, since the pins have pull-downs?

    I'm working on a PCB for the basic MSP430 functionality for an X/Y/Z iGauging style DRO plus Tach and Probe, I'll let you know how it goes once I fab one.

    ReplyDelete
    Replies
    1. I don't know yet. Got a probe two days ago and started experimenting with it. Also, before you invest too much into a board: https://plus.google.com/communities/107302258278364916741 (find post that starts with "
      I'm ordering some PCBs for a prototype run of a pre-made DRO controller"). It will probably end up being cheaper :)

      Thank you
      Yuriy

      Delete