- Published: Friday, 15 January 2010
- Written by Jon Chandler
- Hits: 8569
The PICKit 2 is an awesome program er for PIC microprocessors and is simple to use. Adding to its value, it includes a UART tool for serial communications to the PC without the need for a MAX232 chip (or serial-USB chip/adapter) and functions as a 3 channel logic analyzer. Not bad for $35.
This article will focus on the Logic Tool.
The logic tool has one line that's an input only and three additional lines that can be inputs or outputs (all digital as opposed to analog). Inputs indicate whether a signal is high (1, +V) or low (0, ground). Outputs provide a signal that's either high or low.*
So what does that do for us?
In the simplest case, the logic tool can substitute for LEDs on a microprocessor board so that you can monitor your program's status and check that certain functions happen. Outputs can take the place of switches to select options in programs during testing.
You might use the logic tool to simulate operation of a sensor, a remote switch or an external indicator.
In a more advanced case, the logic tool can be used for troubleshooting. Suppose your program changes the status of an output pin and something is supposed to happen but doesn't. Is something wrong in the program so the pin doesn't change? Is something wrong with the circuit so that it's not responding to the change? You can set the logic tool up as a input to monitor the status of the pin. Toggle the status of the pin in your program and observe what happens to narrow down the problem. You might use an output to force a signal high or low but this can be risky if two output pins are tied directly together.
The screen below shows the logic tool screen.
Operation is pretty self-explanatory. The diagram at the lower left shows the connections. Note that the ground connection MUST be connected to the circuit ground. The VDD (V+) connection may be tied to the circuit, in which case the logic levels are automatically set, or VDD can be set on the main PICKit 2 screen and clicked to on.
Clicking the input or output radio button sets the direction for each channel. Input levels are shown in the center column. A dark blue box with a 0 indicated a low or ground condition while a light blue box with a 1 indicates a high condition. Outputs are shown in the right-hand column, with a brown square and a 0 indicating a low (ground) condition and a red square with a 1 indicating a high condition. Clicking the indication or using the indicated keyboard shortcut toggles the output level.
Clicking the "Enable button turns all the outputs off - to a disconnected state.
Keep in mind that connecting two outputs together is a bad idea, so use some caution.
0 or low indicates a level that is approximately at ground. There is some wiggle room depending on the type of part used, so the level will be near zero but may not be exactly zero. 1 or high indicates a level near VDD, where VDD is the operational voltage of the circuit. If VDD is 5 volts, a high logic level may be considered as 4 volts for example. If the same circuit was operating from 3.3V, the threshold might be 2.7 volts. Only the data sheet knows for sure! Return to top