Using Embedded Artists' LabTool with My Tiva LaunchPad
Lately I've been working with using I/O expanders in conjunction with my Texas Instruments Tiva LaunchPad. The Tiva LaunchPad has a limited number of I/O pins and I'm trying to increase the number by using I/O expander chips.
I came across this YouTube video which shows how to use an MCP23S08 I/O expander with the LaunchPad. Unfortunately, like a lot of other people in the comments of the video, I didn't have a lot of luck in getting it to work quite right. I understood how everything was meant to be setup and operate, but it wasn't quite working as advertised in the video.
After some thought, I realized, to properly debug the problem, I really needed to see the actual signals being sent from the Tiva LaunchPad to the MCP23S08 chip. I wasn't sure how to do this. At first I thought maybe I needed an oscilloscope, but I wasn't certain. After digging around the web I found that a logic analyzer is likely what I needed.
Comparing various logic analyzers on the market, I think I found the best combination of function, features and cost in the Embedded Artists' LabTool. I got it from Mouser for a little under $110 USD - note that you have to provide your own mini USB cable. (Standard disclaimer: I have no financial interest in Embedded Artists, Mouser or any other products discussed here).
I hadn't used a logic analyzer before, and to the best of my knowledge, the last (and only) time I used an oscilloscope was in a physics class when in college (quite a while ago now). Despite this, the Embedded Artists LabTool was super simple to use and was key in helping debug the problem with the I/O expander.
All you have to do is connect the correct digital pins of the LabTool to the output lines the Tiva LaunchPad uses to send data to the I/O Expander chip. The quickstart user guide (PDF link here) clearly labels which LabTool pins to use.
The LabTool device connects to a PC using a standard USB cable. LabTool software (free, open source and easy to download and install) runs on the PC allowing you to easily capture and view these signals as shown in the screenshot below.
After some debugging, I was able to resolve the problem I was having. The key to this was being able to see the signals being sent with timing measurements; exactly what the logic analyzer provides.
The screenshot above shows the correct signals being sent between my Tiva Launchpad and MCP23S08 I/O expander chip when everything is working properly. Without a logic analyzer, I would have just had to guess at what's happening between the LaunchPad and I/O expander - something that could've taken A LOT of time and wouldn't be a lot of fun.
The I/O expander uses four GPIO pins on the Tiva LaunchPad but the expander provides eight additional inputs or outputs. I've just started working with these expander chips, but my goal is to hopefully expand up to a couple dozen separate I/O's while using as few pins on the Tiva LaunchPad as possible.