galacticstudios / Logic-Meter

Other
43 stars 2 forks source link

[TOC]

Logic Meter

Introduction

Logic Meter is a piece of electronic test equipment meant to make certain functions of a logic analyzer as easy to use as a multimeter. You can see a demo at https://youtu.be/55UjsmX5F90

It looks like a multimeter: it's handheld, battery operated, has a display, has a knob for selecting the measurement you want to make, and has a set of buttons for navigating a menu to set options (e.g. setting the baud rate for the UART "measurement").

But unlike a multimeter, the logic meter's probes are for digital signals only (max. 5 volts) and the "measurements" are the sorts of things you'd do to test a microcontroller-based system.

The currently implemented measurements are:

This repository contains the hardware design and the firmware. This Readme file contains helpful information in understanding them.

It is my hope that someone will take this design, or at least this idea of a logic meter, and turn it into a mass-manufactured product. If you do this, I only ask that you contact me and let me know. I would like to be able to buy a professionally made version of this. You can contact me through my GitHub account, galacticstudios, or my website, GalacticStudios.org.

Hardware

This repository includes the schematic and layout files in the Hardware folder. They were generated by DipTrace, a CAD package available at no cost for non-commercial projects or at relatively modest cost for commercial projects.

The logic meter is based on a Microchip PIC32MZ2048EFH064 microcontroller. It uses a color LCD module with an SPI interface and a 10-position rotary switch.

The PIC32 is programmable with an In-Circuit Serial Programmer from Microchip. The ICSP connector, however, is not Microchip's. It is the Tag-Connect TC2030-MCP. Its advantage is that it doesn't require a header to be soldered onto the PCB.

The rotary switch does not have a common pin. Instead, it connects adjacent pins to each other, so in position 1 it connects pin 1 to 2; in position 2 it connects pin 2 to 3, and so on until the last position, where it connects pin 10 to 1. See the comment in the schematic for a description of how we use this switch.

There is a 0.1" header with 4 pins for the probes. One pin is ground. The other 3 are connected to 5V tolerant pins on the PIC32. The PIC32 has a "Peripheral Pin Select" (PPS) feature where different peripherals (UART, SPI, etc.) can have their inputs and outputs routed to different pins. There are four PPS groups, so each of the three probes is connected to four pins on the PIC32. This ensures that every probe pin can be routed to nearly any peripheral on the PIC32. The current design does not make use of all that flexibility, but it's there.

A separate 0.1" header with two pins is for the LED Test. The PIC32 selects different voltages to drive the LED by setting its Comparator Voltage Reference to one of 16 levels. That voltage goes into a Programable Gain Amplifier chip that can source up to 25mA. (The CVref + PGA are essentially forming a low resolution D/A converter) The PGA's output goes through a 22 ohm, 1% resistor and then to the LED Test header, where the user can insert an LED for testing. The PIC32 uses its A/D converters to measure voltage on either end of the resistor. The difference between them is the voltage drop across the resistor, and we can calculate the forward current from that. The voltage on the low end of the resistor (also the LED's anode) is the forward voltage of the LED.

The logic meter is powered by a LiPo battery. There is a USB port with circuitry for charging the battery. The USB port data lines are connected the the PIC32.

There are six buttons. Five are for selecting menu items on the screen; the sixth is meant as a Help button.

Suggested Improvements

Mechanical

The PCB is sized to fit in a Takachi LC145-N enclosure.

Suggested improvements

Software

The software uses Microchip's freely available toolchain:

The Harmony code is in C. My code is in C++. If you re-generate the Harmony code from MHC, you'll see I've made some changes directly to the Harmony-generated files. These are generally to make the .h files compile under C++, although there are also a couple of places where I'm fixing bugs in the Harmony code.

For my code, look in the "Application" logical folder in the MPLAB X Projects pane. It contains subfolders:

Suggested Improvements

Manufacturing

Need a test harness that exercises all the features.