Projects‎ > ‎Electronics‎ > ‎

Data Bus Tester

Motivation

I can't count the times in my engineering career when I have been working relentlessly on a project, only to be brick walled because I didn't have an adequate way to test it. Even when I worked in expensive labs, often times the one piece of equipment I needed was being used by others. Moving on without testing is never a good idea, but sitting and waiting can be a huge waste of time that might even lead to you losing interest in the project at hand. In my personal work, I face this issue all of the time but in a different way. There is simply no way I could afford to purchase all of the testing equipment and tools used by large industries, so I try to make due with what I have.

This has been a huge problem concerning my work with microcontrollers and various data buses. I can design a uC circuit to act as a slave on some data bus, but to test it, I am forced to program an additional uC to act as the bus master. If the slave doesn't work correctly, I am faced with the problem of finding the fault. Is it the slave, or did I not program the master correctly? Then there is the additional issue of needing to test every possible command code to ensure the slave is reacting appropriately. These commands cannot always be sent at once, so again, I am forced to juggle the programming of two separate uC circuits at once.

At the time of this writing, I have three separate circuits, each designed and tested for correct functionality, but waiting to be strenuously tested for every possible command code which could be sent. Doing so would just have taken up to much of my time, so I never finished them. That is where this circuit comes in. I have created a manual data bus controller which can be used to test multiple slaves on a bus at once. The prototype version can handle either TWI or SPI commands. 

Circuit Design

I had been toying with the idea of this circuit for quite some time, so I had a pretty good idea of what I wanted it to do long before I actually started working on it. Most importantly, there needed to be a lot of buttons for command input, and a lot of pins for data output. Adding an LCD screen would make the data entry much easier. I eventually settled on a fairly simple hardware setup based around at Atmel ATmega328p chip. I also incorporated a 4x4 matrix keypad for the data input and a couple of LEDs for quick status indication, but that latter is primarily because I had a few  left over i/o pins. Although three status LEDs are shown in the schematic I only used two, but one of them is bi-color. I didn't feel like creating a new schematic symbol at that time...

The TWI and SPI buses are connected directly to the uC, with a 74595 8 bit shift register providing the chip select lines used for SPI communication. I used a 7805 voltage regulator in the TO220 package to provide enough supply current for whatever slave devices may be added to the data bus. A slide switch selects which bus is active. The LCD screen to be used in this version is a stand alone device I picked up from Sparkfun which operates serially, hence the RS232 connections. In a future version, an LCD screen may incorporated into the actual hardware design.

Theoretical Operation

A user will be able to enter a binary code into the device and send it out on the appropriate data bus. Multiple bytes can be sent out at once. There are also eight memory channels, each of which can store multiple bytes of data for commands which may be used frequently such as a specific address. An LCD screen will display the current command to be sent as well as recall the contents of any given preset.

Stay tuned; more information and
software design are coming soon!








Click schematic to enlarge.

There are a few parts shown on the schematic which were not actually built - mostly power supply filtering. They are included for use in future versions and PCB design.




Data Bus Controller V2 Prototype