Sie sind auf Seite 1von 33

Additional Information for PIC CVD and CTMU Demos

14 November 2011 Michael W. Mann HPMD 32-Bit Application Engineer

Real-Time Debugging
To assist in debugging button/slider behavior, Microchip has provided Profilab GUI project for use on your PC Profilab is like LabView, but much cheaper
http://www.abacom-online.de/uk/html/profilab-expert.html

Standalone Windows mTouch GUI.exe allows use of GUI without purchasing Profilab Profilab projects can be customized to meet your debugging needs
Plot average voltage and button voltage Model product front panel on a GUI tab
Additional Information 1/20/2012 2

Typical Bench-Top Setup


REAL ICE Debugger

USB Cable for board power RJ-11 to ICSP Adaptor PICKit Serial Analyzer interface between PC and UART

mTouch Evaluation Board

Sensor Daughter Card (8-Key)

Interface Cable

Additional Information

1/20/2012

PKSA-EVB J2 Interface Cable

Jumper Settings
PKSA Plug TX Gnd 1 2 3 4 5 6 EVB Plug to J2 2 1 4 3 6 5 8 7 10 9 12 11 14 13 16 15 18 17 Most Boards 2 1 4 3 6 5 8 7 10 9 12 11 14 13 16 15 18 17 PIC32 CTMU 2 1 4 3 6 5 8 7 10 9 12 11 14 13 16 15 18 17 PIC18F CVD 2 1 4 3 6 5 8 7 10 9 12 11 14 13 16 15 18 17
4

Footprint of J2 on EVB

Rx

1 x 6 x 0.1

2 x 9 x 0.1 Additional Information

1/20/2012

Finding the .EXE GUI File


Standalone Project

GUI .EXE

Microchip Application Library Project Directory

GUI ProfiLab Project

Additional Information

1/20/2012

Setting Up GUI Com Parms

Click here to launch Configuration Window

Click to Select COM Port

Additional Information

1/20/2012

mTouch GUI Screen 1/3


Normalized Voltages for Buttons 1-4

For Matrix Keys Channels 1-3 are Columns 1-3


For Matrix Keys Channel 4 Zerod Out

Additional Information

1/20/2012

mTouch GUI Screen 2/3


Normalized Voltages for Buttons 5-8

For Matrix Keys Channels 5-8 are Rows1-4

Additional Information

1/20/2012

mTouch GUI Screen 3/3

Prior Button Assert

Current Button Press

Equivalent Slider Value


Slider value not available with Matrix Keys

Additional Information

1/20/2012

Voltage Plot Screen Controls


Quit data collection and exit GUI Reset Min/Max for all Channels Maximum ADC Count Save voltage plot data to ASCII file Save all UART data to ASCII file

Delta = Max - Min

Record or Stop Recording

Erase file and start over

Additional Information

1/20/2012

10

Configuring Voltage Plots


Right mouse click in plot window

Increasing Channel 1 Line Width

1/20/2012

1/20/2012

11

Plot Controls
Record Stop Print Plot Save Plot Copy Plot to Clipboard Delta Time between samples

Y Zoom + Zoom All Y Zoom X Zoom + X Zoom Reset Zoom

Plot Settings Scroll Forward in Time Scroll Back in Time

1/20/2012

1/20/2012

12

Profilab = LabView Lite


Parsing comma delimited UART text string

Plotting Button Voltages

Saving Button Voltages to Text Files

Min/Max
Displayed on Button Voltage Plots

Virtual Front Panel on First GUI TAB

Additional Information

1/20/2012

13

Parsing Comma Delimited Data


Block decodes comma delimited UART string into status and voltages

Voltage Holds for Plots

Voltages
Additional Information

1/20/2012

14

Scale and Plot Channels

PlotScale macro scales ADC counts into normalized Voltage

Virtual Front Panel on First GUI TAB

Min/Max
Displayed on Button Voltage Plots
Additional Information 1/20/2012 15

Benchtop Setup for Differential with Pull-Ups Demo

100 Kohm Pull-up Resistors

Channel 1 on Button Signal

Reference Signal on AN4

PICKit Serial Analyzer interface between PC and UART


Additional Information 1/20/2012 16

Close-Up of Differential Setup using Pull-Ups

100 Kohm Pull-up Resistors Channel 1 on Button Signal

Top side of pull-ups on reference pin (AN4)

Reference Signal on AN4

Additional Information

1/20/2012

17

Example Differential with Pull-Ups Scope Signals


Unasserted
External pull-up charges button

Asserted
Button Signal

Ref. Pin Voltage

VNEGATIVE measurement VPOSITIVE measurement

VNEGATIVE goes up

VPOSITIVE

goes down

Additional Information

1/20/2012

18

Timing of Diffl w. Pull-Ups


Reference Pin Voltage

0.79 usecs

Interrupts Masked

V--

V+

Additional Information

0.55 usecs

1/20/2012

19

Benchtop Setup for Single-Ended or Differential w/o Pull-Ups Demos

Channel 1 on Button Signal Reference Signal on AN4

PICKit Serial Analyzer interface between PC and UART

Additional Information

1/20/2012

20

Example Differential w/o Pull-Ups Scope Signals


Unasserted
Reference Signal
Multiple charge dumps from ADC SAH cap to button cap

Asserted

Button Signal

VPOSITIVE measurement

VPOSITIVE goes down


VNEGATIVE measurement

VNEGATIVE goes up

Additional Information

1/20/2012

21

Differential w/o Pull-Ups Timings


1.00 usecs

0.58 usecs

Interrupts Masked

V+

V--

Additional Information

1/20/2012

22

Benchtop Setup for CTMU Measurements


REAL ICE for debugging

PICKit Serial Analyzer interface between PC and UART

Scope probe on Button 8

UART TX pin on J2

Additional Information

1/20/2012

23

Example CTMU Measurements


Unasserted
Reference Signal *

Asserted
VPOSITIVE

goes down

Interrupts Masked
(1.53 usecs)

ADC Capture 2.57 usecs

* Reference Signal: Interrupt masking, from asm(di) to asm(ei)


Additional Information 1/20/2012 24

Perf. Metric: Interrupt Masking Duration All these examples were taken using the Direct Key daughter card, but with different CVD/CTMU Evaluation Boards Each application tuned to provide equivalent cap touch performance
Interrupt Masking Durations [usecs] Technique Vpos Vneg Vtotal Diff w/o Pull-Ups 0.58 1 1.58 Diff w Pull-ups 0.55 0.79 1.34 CTMU 1.53 n/a 1.53
Additional Information 1/20/2012 25

Interrupt Masking Duration Workarounds


What if interrupts wont accommodate these black out periods?
Dont use asm(di) and asm(ei) to mask interrupts, set CapTouchMeas flag instead of asm(di), clear flag instead of asm(ei) ISRs set DumpMeasurement flag if ISR executes when CapTouchMeas is set Timer ISR dumps/ignores cap touch measurement when DumpMeasurement is set, then clears the flag
Additional Information 1/20/2012

26

PIC32MX2xx Starter Kit App


CTMU Cap Touch on 4-channel slider
Selects music Selects music volume

Three switches I2S I/F to CODEC PMP I/F to 220x172 pixel TFT display SPI I/F to microSD music card Playback of 44.1 Ksps .WAV files

Additional Information

1/20/2012

27

PIC32MX2xx Starter Kit Board


Headphone Jack CODEC MicroSD Memory Card 220x172 TFT Display

Switch Prompts

PIC32MX220F032D 3 Switches Button Prompts

Slider Display 4 Channel Button/Slider


Additional Information 1/20/2012

28

PIC32MX2xx Starter Kit Display


Button State: Asserted Button Prompts

Music Timing

Switch Prompts

Slider Display
Additional Information 1/20/2012 29

Selecting Music 1/2

Button State: Pressed

Additional Information

1/20/2012

30

Selecting Music 2/2


Press Switch 3 to Execute Selection

Button State: Asserted

Additional Information

1/20/2012

31

Cap Touch Tricks 1/2


Leave interpretation of button/slider status to the main application, only it knows context of the measurements!
while(1) { // Update Switch1St8 Switch2St8 Switch3St8 switches = UpdateSwitch( 1, CheckSwitch1(), (char *)0 ); = UpdateSwitch( 2, CheckSwitch2(), (char *)0 ); = UpdateSwitch( 3, CheckSwitch3(), (char *)0 );

// Update buttons/slider if( ApplicationState != STARTUP && mTouchCapStatus_Check( &CurrentButtonStatus, &CurrentButtonAsserts, &Temp ) ) { mTouchUpdated = TRUE; if ( IgnoreSlider != TRUE ) { SliderValue = Temp; UpdateSlider( SliderValue ); } if ( IgnoreButtons != TRUE ) { UpdateButton( 1,(CurrentButtonStatus UpdateButton( 2,(CurrentButtonStatus UpdateButton( 3,(CurrentButtonStatus UpdateButton( 4,(CurrentButtonStatus } }//end if( mTouchCheckStatus... switch( ApplicationState ) {

>> >> >> >>

0)&0x1,(CurrentButtonAsserts 1)&0x1,(CurrentButtonAsserts 2)&0x1,(CurrentButtonAsserts 3)&0x1,(CurrentButtonAsserts

>> >> >> >>

0)&0x1,(char 1)&0x1,(char 2)&0x1,(char 3)&0x1,(char

*)0); *)0); *)0); *)0);

Additional Information

1/20/2012

32

Cap Touch Tricks 2/2


Only update screen after completion of button scan to prevent crosstalk between PMP screen pins and button inputs
case FILE_PLAYING_SETUP: if ( mTouchUpdated == TRUE ) // Only update display when mTouch { // has been updated and isn't running. UpdateSwitch(3,-1, "Pause" ); UpdateSwitch(2,-1, "Stop" ); UpdateSwitch(1,-1, "GoBack"); IgnoreButtons = TRUE; IgnoreSlider = FALSE; mTouchCapStatus_Reset(128); UpdateSlider(128); ApplicationState = FILE_PLAYING; } else // mTouch is still running don't do anything { ApplicationState = FILE_PLAYING_SETUP; } break; case FILE_PLAYING: PMADDRSET = 1<<10; // Turn on LED WM8731Codec_MusicOn(TRUE); // Start playing

Additional Information

1/20/2012

33

Das könnte Ihnen auch gefallen