Home
PICKIT™ 2 LOGIC TOOL USER GUIDE
Contents
1. 0 Logic Low The channel must be at a logic low state to trigger P Rising Edge The channel must transition from low to high states to trigger V Rising Edge The channel must transition from high to low states to trigger All trigger events on all channels must happen at once in order for the trigger to activate data capture For example for Figure 3 3 The trigger was set to simply detect the first rising edge on channel 1 Figure 3 3 Trigger Conditions Ch 1 rising edge Chi ignore Ch3 ignore If the trigger conditions are changed as follows where both a rising edge must be detected on channel 1 at the same time channel 2 is at a logic high state the trigger will happen on the second clock instead as shown in Figure 3 5 During first clock s rising edge channel 2 is logic low so this does not fully satisfy the trigger condition Figure 3 5 Trigger Conditions Ch 1 rising edge Ch2 1 logic high Ch3 ignore FIGURE 3 5 TRIGGER CH 1 RISING EDGE WHEN CH 2 IS HIGH Finally it is also possible to specify how many times the trigger condition must occur before waveform capture 1s initiated up to 256 times For example suppose we wanted to capture the 16 byte of a long SPI transmission sequence If we triggered on the first clock edge of the first byte we probably wouldn t be able to see the 16 byte as the analyzer would stop sampling before it occurred However we can set the analyzer to pass
2. for setting trigger conditions for a capture 3 Acquisition for setting the waveform sample rate and the waveform relation to the trigger sample Each section will be covered one at a time FIGURE 3 1 ANALYZER WINDOW SECTIONS PICkit 2 Logic Tool 50 us f Div Cursors e RES ue eS GNIS weer kee Rae n a ue S aad uaa Aquisition CHT ECH i Sample Rate ao ml Dont Cae ff TMH2 1 ms window il pull down F Logic High NOTE Signals greater than 500 kHz will alias resistors Logie Low i l Perac ie Trigger Position PICkit 2 VDD MUST connect to Y Falling Edge StatofDaa C Delay 1 Window circuit VOD Center of Data Delay 2 Windows Sef VDD Vatage Oni occurs times End of Data Delay 3 windows AT That fount iT 256 T handas T000 sampes 2008 Microchip Technology Inc Page 7 of 16 PICkit 2 Logic Tool Users Guide 3 2 1 The Analyzer Display Section The display section of the analyzer window allows the waveform to be viewed zoomed measured and saved as a bitmap file Figure 3 2 shows a SPI bus waveform capture of a 2 byte transmission and details the elements of the display window section FIGURE 3 2 ANALYZER DISPLAY 50 us f Dir Cursors BET UE Pe Ch Trigger Time Scale Division Line Waveform Scroll Waveform Save Zoom Level Waveform Trigger The trigger is a pre defined event in the monitored signals that causes a capture of the signal wavef
3. sample rate may be selected from those shown in Table 3 1 TABLE 3 1 SUPPORTED SAMPLE RATES Waveform Limitations Time Between Sample Rate Captured Waveform Length Maximum Frequency Samples ee 1024 samples before aliasing ets tims 500 KH 250 KHz 250 kHz 4 1 ms 125 kHz 100 kHz 10 2 ms 50 kHz 50 kHz 20 5 ms 25 kHz 25 kHz 41 ms 12 5 kHz 10 khz 102 4 ms 204 8 ms 25 KH Note 1 Waveform length is rounded to the nearest 0 1 decimal place 2008 Microchip Technology Inc Page 13 of 16 PICkit 2 Logic Tool Users Guide Trigger Position Changing the trigger position allows more flexibility over how the captured data relates to the trigger event For example we might be more interested in what happened before the trigger rather than after There are 6 selectable trigger positions Start of Data This is the trigger position used in all the prior Figure waveforms All the waveform data except for one division is captured after the trigger occurs This is best used when all the waveform data of interest happens after the trigger FIGURE 3 9 START OF DATA TRIGGER POSITION Trigger event is here orm Cap Ch 1 A cc ch2 K Ch3 KM Center of Data This is best used when all the waveform data of interest happens around the trigger The trigger event is in the middle of the waveform display FIGURE 3 10 CENTER OF DATA TRIGGER POSITION Trigger event is here Waveform captured Ch 1 E ciMMMMOOO _ CO TTT C
4. up the first 15 bytes by setting the trigger count to 15 bytes 8 clocks 1 121 times This way it will start counting clock edges on the first byte but it won t trigger the data capture until the 16 byte is transmitted 2008 Microchip Technology Inc Page 11 of 16 PICkit 2 Logic Tool Users Guide To illustrate we ll add a count of 4 times to our trigger conditions of Figure 3 5 Trigger Trigger when ge Dont Care 1 Logic High To O Logie Low Rising Edge Falling Edge Ch I Il a7 8 h i Ch DJ lI occurs 4 times fF 296 Now we ll trigger on the 4 rising edge of channel 1 that occurs while channel 2 is logic high This will be the last clock of the first SPI byte as shown in Figure 3 6 FIGURE 3 6 TRIGGER CH 1 RISING EDGE WHEN CH 2 IS HIGH OCCURS 4 TIMES 3 2 4 The Analyzer Acquisition Section The Acquisition section of the analyzer window is used to set the waveform sample rate the position of the trigger relative to the captured waveform and to start or run the analyzer FIGURE 3 7 ACQUISITION SETTINGS Aquisition Sample Rate 1 MHz 7 ms Window we NOTE Signals greater than 500 kHz will alias RUN Trigger Position Start of Data Delay 1 Window Center of Data O Delay 2 Windows End of Data Delay 3 windows T handas T000 sampes Sample Rate The sample rate
5. PICKIT 2 LOGIC TOOL USER GUIDE MICROCHIP 1 Introduction The PICkit 2 Logic Tool allows the PICkit 2 ICSP connector pins to be used for stimulating and probing digital signals in a target circuit and as a simple 3 channel logic analyzer The Logic Tool is opened by selecting Tools gt Logic Tool in the main PICkit 2 application window The Logic Tool has two operating modes The Logic I O mode is useful for triggering inputs to a PIC microcontroller or other digital circuitry and can monitor digital signals to display their state In essence it provides an alternative for wiring buttons and LEDs to pins or signals while debugging or developing I O functions The Analyzer mode can display waveforms of up to 3 digital signals and trigger on specific events such as arising edge on one signal when another signal is at a logic high level This may be very useful for debugging serial communication buses such as UART SPI and I2C It is also very applicable to monitoring the behavior of general microcontroller I O Information in this guide covers e Logic I O mode e Analyzer mode 2008 Microchip Technology Inc Page 1 of 16 PICkit 2 Logic Tool Users Guide 2 Logic I O Mode The PICkit 2 Logic Tool Logic I O mode is the default mode when the Logic Tool is first opened It allows simple stimulus and monitoring of digital signals The Logic Tool mode is set by the two buttons in the upper right of the Logic Tool w
6. WINDOW TRIGGER POSITION Trigger event is here Delay 1000 samples Waveform captured Ch 1 N E Re ate cCh2 K ch3 KN 2008 Microchip Technology Inc Page 15 of 16 PICkit 2 Logic Tool Users Guide Running the Analyzer Once the trigger conditions sample rate and trigger position are set as desired click the RUN button to begin collecting waveform data and looking for trigger events When the analyzer is running it will show the dialog in Figure 3 13 and the Busy LED on the PICkit 2 unit will be lit FIGURE 3 8 ANALYZER RUNNING PICkit 2 Logic Tool Running a Waiting for Trigger Flickt 2 Logic Tool is waiting for a valid tigger condition To cancel abot press the FiCkit z pushbutton Do not aisconna ct ie PIRI S cong so may cause its BO Oceano 10 ANG Once the trigger condition is met the Busy LED will turn off the Waiting for Trigger dialog will close and the analyzer waveform display will be updated with the newly captured data If the analyzer is not triggering as expected or 1f for any other reason it is necessary to stop the analyzer from running press the PICkit 2 unit pushbutton When an analyzer run is cancelled the waveform display is not updated IMPORTANT When the analyzer is running the PICkit 2 unit is unable to service USB requests The application will wait until the run completes at a trigger condition or is cancelled by the pushbutton If the PICkit 2 unit is
7. e target or pins 4 5 amp 6 wall not function Now that the pins of the PICkit 2 unit are enabled the pin directions and output states can be configured 2 1 1 Setting Pin Direction Pins 4 5 amp 6 may be configured as Outputs output a digital signal from PICkit 2 or Inputs monitor a digital signal state connected to the pin Pin 1 is only available as an Output Click the radio buttons next to the Pin to set the pin as an Output or Input When the pin is an Input the connected signal state is displayed in the blue Inputs box as shown in Figure 2 3 and Figure 2 4 FIGURE 2 3 LOGIC I O INPUT SIGNAL IS LOGIC LOW 0 n5 Siem o Pin 5 Input 0 dk Clann puido FIGURE 2 4 LOGIC I O INPUT SIGNAL IS LOGIC HIGH 1 ms om fo 4 fk Clana pudon 2008 Microchip Technology Inc Page 4 of 16 PICkit 2 Logic Tool Users Guide Pin 4 and Pin 5 have a 4 7k Ohm pulldown resistor internal to the PICkit 2 This resistor is necessary for the PICkit 2 debugger functions but note that this pulldown resistor will affect any digital signal it is connected to Generally this is only an issue when using Pin 4 or Pin 5 as an input See the PICkit 2 schematic in the PICkit 2 User s Guide Appendix for the pin circuit diagrams When a pin is selected as an Output the pin will drive the logic level shown in the read Outputs box Toggle the output state by clicking on the Output state box Alternative
8. h3 K End of Data All the waveform data except for just over one division is captured prior to the trigger occurs This is best used when all the waveform data of interest happens before the trigger FIGURE 3 11 END OF DATA TRIGGER POSITION Trigger event is here Waveform cap Ch 1 LMM MMM MM TTT ch2 KA ch3 KN 2008 Microchip Technology Inc Page 14 of 16 PICkit 2 Logic Tool Users Guide Delay I Window Delay 2 Windows Delay 3 Windows In these cases the trigger position is considered Start of Data but the waveform capture is delayed 1000 samples nearly one waveform display after the trigger This allows a user to capture events that occur further out than the display width after a trigger happens without reducing the sample rate In other words when Delay 1 Window is selected the analyzer will wait 1000 samples after the trigger event occurs before it begins recording waveform data When Delay 2 Windows is selected it will wait 2000 samples etc Each waveform display is 1024 samples so the 1000 sample delay increment gives a small overlap between successive delay captures Assuming that the data of interest after the trigger is repeatable and consistent this allows a total waveform of up to 4 times the sample rate window width to be pieced together For example it would be possible to collect 4 ms worth of waveform data after a trigger event at the 1 MHz sample rate FIGURE 3 12 DELAY 1
9. indow The 6 pin PICkit 2 ICSP connector has 4 signal pins that can be used inject a digital signal into a circuit or display the state of a digital signal from a circuit The remaining two pins are dedicated for Vdd and Ground connections The 6 ICSP pins can function as follows in Logic I O mode w Pin ICSP Function Logic I O Function l VPP MCLR Digital Output Ei op 2 VDD VDD must connect to or match target VDD ma 3 GND GND must connect to target circuit ground 4 PGD Digital Output or Digital Input F 5 PGC Digital Output or Digital Input 6 AUX Digital Output or Digital Input IMPORTANT The PICkit 2 VDD pin must be connected to the target circuit VDD supply or set to provide a VDD output voltage in the main PICkit 2 application form The voltage level at the VDD pin sets the output high voltage for pins 4 5 amp 6 when used as outputs For example if using the PICkit 2 to provide digital stimulus to a 3 3 Volt circuit the VDD pin should be either set to or connected to a 3 3 V supply to limit the output high voltage to 3 3 Volts Pin 1 s output voltage swing is determined by the voltage on the VDD pin when the Logic I O is first enabled IMPORTANT When used as inputs pins 4 amp 5 may be used to monitor signals down to 2 5 Volt logic as these are TTL input buffers Pin 6 as an input may be used to monitor signals down to 3 6 Volt logic It may not reliably report high signal states for lower voltage logic sig
10. is how often the analyzer channels are looked at Each waveform capture is only 1024 samples long so if we want to look at a longer period of time in the waveform display we have to sample less often 2008 Microchip Technology Inc Page 12 of 16 PICkit 2 Logic Tool Users Guide The trade off is that at higher sample rates we can see more detail and faster signals but only a small window of time At lower sample rates we can see a longer window of elapsed time but at less detail and may miss fast pulses Generally the sample rate should be set at least 10 times the highest frequency or 5 times the fastest pulse width to get a decent representation of the waveform Any waveform that has frequency higher than half the sample rate may alias Aliasing means that waveform edges are missed and so the waveform can appear slower than it actually 1s Of course the sample rate can always be set slower than these limits if all that s desired is to get a general idea of what s going on in the circuit without much detail For example the sample rate could be set much slower so it could be seen how many SPI bytes are being sent In Figure 3 8 we can see that 8 bytes are being sent on the SPI bus Now that we know how many bytes are sent we could set the sample rate higher and adjust the trigger count to see each byte in detail to figure out the byte value FIGURE 3 8 8 SPIBYTES AT SLOW SAMPLE RATE In the PICkit 2 Logic Tool analyzer the
11. lacement of the cursors When zoomed the cursors will get wider as they are the width of a sample and the sample width grows with increasing zoom Above the waveform display the time difference between the Trigger and each cursor is displayed along with the difference between the triggers The time period between the cursor is also displayed as the related frequency In Figure 3 4 the cursors are used to measure the period 19 us and frequency 53 kHz of the SPI clock in channel 1 The X cursor sample is 116us after the Trigger sample and the Y cursor point is 135 us after the Trigger FIGURE 3 4 ANALYZER DISPLAY CURSORS Enable Disable Time difference from Time delta between cursors Cursors N J cursor to trigger period frequency 50 us f Dir Cursors 116 us Y 135 us T A 19 us 52 63 kHz ii manana ninnan ll Hai ag O 0 5 Ly 1x H e lt Fi O 4s gt X Cursor Y Cursor Left click mouse Right click mouse 2008 Microchip Technology Inc Page 10 of 16 PICkit 2 Logic Tool Users Guide 3 2 3 The Analyzer Trigger Section The trigger is a user defined set of events in the monitored signals that causes the capture of a waveform Each channel can be assigned one of the following trigger events Trigger Events Don t Care The analyzer channel is ignored for triggering purposes 1 Logic High The channel must be at a logic high state to trigger
12. ly a keyboard shortcut key can used for each pin to toggle the output The shortcut keys are Pin Shortcut Key l lt A gt 4 lt S gt 5 lt D gt 6 lt F gt FIGURE 2 5 LOGIC I O OUTPUT LOGIC LOW 0 Pin 5 Output 0 Click Output bos or press lt d key 47 Ohm Input Dua et FIGURE 2 6 LOGIC I O OUTPUT LOGIC HIGH 1 Pin 5 Output Ev Click Output bos or press sdy key 47 Ohm Input Dudo 2008 Microchip Technology Inc Page 5 of 16 PICkit 2 Logic Tool Users Guide 3 Logic Analyzer Mode The Analyzer mode of the PICkit 2 Logic Tool enables using PICkit 2 as a simple 3 channel logic analyzer to capture view and measure the digital waveforms of up to 3 signals 3 1 Connecting the PICkit 2 in Analyzer Mode The PICkit 2 ISCP connector pins 4 5 amp 6 are used as the inputs for the 3 logic channels Pin ICSP Function Logic Analyzer Function l VPP MCLR No Connect a oe 2 VDD VDD must connect to or match target VDD 3 GND 3 GND GND must connect to target circuit ground 3 CH2 4 PGD Analyzer Channel 1 5 PGC Analyzer Channel 2 wd 6 AUX Analyzer Channel 3 For example to monitor a SPI bus the analyzer channel pins could be connected to monitor the 3 main bus signals as follows Logic Analyzer Pin SPI Bus Signal Analyzer Channel 1 SCK Analyzer Channel 2 SDO bus master output Analyzer Channel 3 SDI bus master input IMPORTANT The PICkit 2 VDD pin must be c
13. nals as the input buffer is a Schmitt Trigger 2008 Microchip Technology Inc Page 2 of 16 PICkit 2 Logic Tool Users Guide 2 1 Configuring the Logic Tool Logic I O First to use the Logic I O mode the Logic I O mode button on the upper right of the logic window must be depressed as shown in Figure 2 1 FIGURE 2 1 INITIAL LOGIC I O MODE DISPLAY PICkit 2 Logic Tool PIN dutou Oni Pin 4 d fk OA puldor Pin 5 d rk Chat Dinion Pin 6 Enable I0 PICKit2 VOD pin MUST have a valid voltage ether sourced from PICK 2 or the target or pins 4 5 amp 6 wall not function Secondly the 4 PICkit 2 pins used for Logic I O digital signals pins 1 4 5 amp 6 will remain tri stated inactive until the Enable IO button is pressed as shown in Figure 2 2 Once the IO is enabled it becomes active and can be configured If no valid voltage is detected on the VDD pin when clicking Enable IO a dialog will pop up to alert the user and the PICkit 2 pins will remain disabled 2008 Microchip Technology Inc Page 3 of 16 PICkit 2 Logic Tool Users Guide FIGURE 2 2 LOGIC I O MODE ENABLED PICkit 2 Logic Tool Mode Inputs Outputs Cutout Ori 0 Click Output box or press lt a gt key 2 Output Pin 4 E A 7k Ot outset e Input 2 Output Pins lt d rk r Duon Input Output Pin 6 F Input Enable I0 PICkit 2 YOD pin MUST have a valid voltage either sourced from PICkik 2 or th
14. onnected to the target circuit VDD supply or set to provide a VDD output voltage in the main PICkit 2 application form Having the VDD pin connected is necessary as the PICkit 2 logic channel pins are clamped to the VDD pin voltage If no voltage is present on VDD the analyzer channel pins will be essentially clamped to ground It is possible to have PICkit 2 output a VDD voltage without connecting pin 2 to the circuit VDD as long as the VDD level is greater than or equal to the target circuit logic high voltage Note Pin 4 and Pin 5 have a 4 7k Ohm pulldown resistor internal to the PICkit 2 This resistor is necessary for the PICkit 2 debugger functions but note that this pulldown resistor will affect any digital signal these pins are connected to See the PICkit 2 schematic in the PICkit 2 User s Guide Appendix for the pin circuit diagrams IMPORTANT Channels amp 2 pins 4 amp 5 may be used to monitor signals down to 2 5 Volt logic as these are TTL input buffers Channel 3 pin 6 may be used to monitor signals down to 3 6 Volt logic It may not reliably report high signal states for lower voltage logic signals as the input buffer is a Schmitt Trigger 2008 Microchip Technology Inc Page 6 of 16 PICkit 2 Logic Tool Users Guide 3 2 The Logic Analyzer Window The Logic Tool analyzer window is divided into 3 sections as show in Figure 3 1 These are 1 Display for viewing and measuring captured waveforms Trigger
15. orm Triggering is discussed in detail in section 3 2 2 The Analyzer Trigger Section On the waveform display the point where the trigger occurred is indicated by a vertical red line In Figure 3 2 the trigger was set to occur at the first rising edge of Channel 1 the SPI SCLK clock signal Time Scale Above left of the waveform display is the time scale This is how much time each Division Line in the waveform represents In Figure 3 2 each division is 50 microseconds of time Division Line A division line is a gray vertical line across the waveform display which can be used to give a time reference to the displayed waveform In Figure 3 2 the first 8 clocks on Channel 1 occupy about 3 divisions so transmitting the first SPI byte took about 3 x 50 150 us Smaller hash marks at the top and bottom of the display subdivide each time division into 5 smaller units Since each time division in Figure 3 2 is 50 us the smaller hash marks represent 10 us of time Waveform Scroll The captured waveform is longer than can be shown all at once effectively in the display so the horizontal scroll bar allows the display to scroll for viewing the entire waveform 2008 Microchip Technology Inc Page 8 of 16 PICkit 2 Logic Tool Users Guide Waveform Zoom Level The waveform Zoom allows 4 levels of zoom to be selected Normally at 1x zoom each sample of a waveform is displayed as a pixel A waveform is 1024 pixels of which 500 can be displa
16. unplugged from USB during a run the PICkit 2 application may hang waiting for a response from the PICkit 2 unit 2008 Microchip Technology Inc Page 16 of 16
17. yed in the window By selecting zoom level 0 5x the waveform is compressed so 2 samples are shown per pixel which allows the entire waveform to be view at once but with a loss of detail Zoom levels 2x and 4x display the waveform with 2 pixels per sample and 4 pixels per sample respectively This allows relative time details between the waveforms to be more easily seen Figure 3 3 shows the SPI waveform at zoom levels of 0 5x 1x and 2x Note that the time scale changes as the zoom is changed FIGURE 3 3 ANALYZER WINDOW SECTIONS 0 5x Zoom O0us Dre 1x Zoom Dug fn 2x Zoom Save Waveform Click the Save button to save the current waveform display in a bitmap file The time scale will be added to the bottom of the display as shown in Figure 3 3 If cursors are active the cursors and their times will also be saved with the display Note that the entire waveform is saved In Figure 3 3 the 1x and 2x waveforms were truncated after saving to only show the first portion 2008 Microchip Technology Inc Page 9 of 16 PICkit 2 Logic Tool Users Guide 3 2 2 The Analyzer Display Cursors The display cursors are useful for making time and frequency measurements in the displayed waveform Click to check the Cursors checkbox and enable the cursors Place the X cursor by left clicking in the waveform display Place the Y cursor by right clicking in the waveform display It can be helpful to use Zoom for exact p
Download Pdf Manuals
Related Search
Related Contents
Danby Premiere DDR45B3WP Use and Care Manual Maintenance Copyright © All rights reserved.
Failed to retrieve file