2. 1
CUSTOMER UNDER NDA
METHODS
• MKE15 Transmit and Receive Boards
• I2C Packet Sniffer
• I2C Data Generator
• Logic Analyzer
• Oscilloscope
• How to program
4. 3
CUSTOMER UNDER NDA
FRDM-KE15Z HEADERS
J2
J1
J3
J4
J2 pinout in manual is wrong
Corrected are in red
20
18
16
14
12
10
8
6
4
2
x x x
J15 set to 3.3V operation
Use this USB connection
5. 4
CUSTOMER UNDER NDA
FRDM-KE15Z CONNECTIONS
• Using I2C examples
• Default configuration
▪ Pin Name Board Location
▪ LPI2C0_SCL J4-12
▪ LPI2C0_SDA J4-10
▪ GND J3-12
7. 6
CUSTOMER UNDER NDA
LOGIC ANALYZER
• Confirms Data
• All valid format
• Expected data sequence
I2C Protocol needs to be set to shifted so that address shows up properly
8. 7
CUSTOMER UNDER NDA
CUSTOMER DRIVER DEBUG
• Insert MKE15 as I2C Master
• See how many bytes customer software driver receives
• Does it consistently fail
Master
Sends to address 0xFC
0x01 0x20
0x00 0x01 0x02 0x03 0x04 0x05 0x06 0x07
0x08 0x09 0x0a 0x0b 0x0c 0x0d 0x0e 0x0f
0x10 0x11 0x12 0x13 0x14 0x15 0x16 0x17
0x18 0x19 0x1a 0x1b 0x1c 0x1d 0x1e 0x1f
0x01
Customer Board
10. 9
CUSTOMER UNDER NDA
LIVE DEMO
• Jumpers
• Permit multiple
combination of connecting
boards, monitors, and logic
analyzer to SDA and SCL
pins
• Two male and two female
headers
16. 1 5
CUSTOMER UNDER NDA
TEST WITH PCA9672
• PCA9672
− Soldered down on board
− Address 0x44
− Hardwired to SDA1 and
SCL1
− Easy to probe same test
points
• Set I2C Clock to 100K
since default is 1MHz
• Pick GPIO Expander 8
bit
• Connect Logic Analyzer
• Press Write and Read a
few times
18. 1 7
CUSTOMER UNDER NDA
EMULATE MKE15 MASTER BOARD
• Use Expert Mode
• Enter Script
• Will write and read data
19. 1 8
CUSTOMER UNDER NDA
LOGIC ANALYZER ON THE SCRIPT
• If no MCU connected (slave address) then NAK
• No further data is sent until the slave gets connected even if the TX buffer has more
bytes to send
No device with this address so data does not get sent
20. 1 9
CUSTOMER UNDER NDA
CONNECT MCU
• Script emulates data exactly to MKE15 Slave Board
21. 2 0
CUSTOMER UNDER NDA
LOGIC ANALYZER ON THE SCRIPT
• With MCU connected
• Data is emulated perfectly
Handshake protocol, not sure what this field is
32 bytes (0x20) of payload data
Start of sequential data
Slave ACK being present
22. 2 1
CUSTOMER UNDER NDA
LOGIC ANALYZER ON THE SCRIPT (PG 2)
• Matches MCU perfectly
23. 2 2
CUSTOMER UNDER NDA
DEMO WITH DATA GENERATOR SCRIPT
• Another way to debug
• MKE15 board is slave or
customer board
• NXP I2C board generates
scripts of messages
• Video demo
− https://youtu.be/bMR1p0zF6cI
Master Board
FRDM MKE15 is the slave
Logic Analyzer on tap points
NXP FM+ Jumper Settings 20220808_030433.jpg
25. 2 4
CUSTOMER UNDER NDA
MONITOR I2C TRAFFIC
• Use two MKE15 in Master/Slave
configuration
• Use I2C Driver GUI Tool
• Place splice so that all lines can be
monitored (Gnd, SCL, SDA) and no VCC
• Slave
− Board on right
− Running with MCU Xpresso for data monitor
• Master
− Always powered up
− Flashed
• Sequence
− Start slave software
− Press reset button on Master board
26. 2 5
CUSTOMER UNDER NDA
MONITOR I2C TRAFFIC
• Use two MKE15 in Master/Slave
configuration
• Use GUI Tool
− Turning on pull ups when already enabled will
really mess it up
− Make sure speed is set correctly
• Now place into Monitor mode
− Screen will say “M”
− GUI will gray out
• Monitor Screen
− shows data being written and read back every
byte
− Data is in sequential order
− Slave was turned off
− Display is correct because every byte sent
(green ACK) is followed by red NAK since no
slave
− Not sure why address is wrong
27. 2 6
CUSTOMER UNDER NDA
MONITOR I2C TRAFFIC
• Place into Capture Mode
− Works best if power off board, exit GUI, power on board, start GUI
− Might have to run GUI second time if first copy does not execute
− On the GUI, setup resistors and buss speed right away
− On the GUI, select Capture mode right away
− Enter file name for CSV
− Screen will show “C”
− If no C, then it will not work properly and go back to step 1
• Do NOT try to go back to monitor mode
• When done capturing
− Close capture by pressing button on GUI
− GUI should report how many events (65 in this example)
− Display should go back to “D”
28. 2 7
CUSTOMER UNDER NDA
MONITOR I2C TRAFFIC
• Captured log
seems reasonable
• But it shows bytes
being
acknowledged
before end of data
• Logic Analyzer
data is a bit
different
• Need to do
decimal to hex on
data
Capture MKE15 Slave Master4 2022_08_09.csv
29. 2 8
CUSTOMER UNDER NDA
COMPARE I2C DRIVER TO LOGIC ANALYZER
• Tap I2C Driver and Logic Analyzer to look at data
Master
Sends to address 0x7E
0x01 0x20
0x00 0x01 0x02 0x03 0x04 0x05 0x06 0x07
0x08 0x09 0x0a 0x0b 0x0c 0x0d 0x0e 0x0f
0x10 0x11 0x12 0x13 0x14 0x15 0x16 0x17
0x18 0x19 0x1a 0x1b 0x1c 0x1d 0x1e 0x1f
0x01
Slave
I2C Driver Logic Analyzer
SCL, SDA, GND
30. 2 9
CUSTOMER UNDER NDA
COMPARE I2C DRIVER TO LOGIC ANALYZER
• Physical Setup
• Two MKE15 boards
− Master will be executed by
pressing reset button near
USB
− Slave on left will be
executed with MCU
Xpresso Code
• I2C Driver Connected in
Capture Mode
• Logic Analyzer also
connected
31. 3 0
CUSTOMER UNDER NDA
COMPARE I2C DRIVER TO LOGIC ANALYZER
• Cable connections
• Yellow is SCL
• Green is SDA
• Black is Ground
32. 3 1
CUSTOMER UNDER NDA
USING DATA GENERATOR SCRIPT
• NXP I2C board generates
scripts of messages
• Compare Logic Analyzer to I2C
Driver
• Use On Board PCA9672
• Video demo
−
Master Device
NXP FM+ Jumper Settings 20220808_030433.jpg
Slave Device
PCA9672
33. 3 2
CUSTOMER UNDER NDA
I2C DRIVER
• Using screen provides some kind of capture
• Only small bits of data
34. 3 3
CUSTOMER UNDER NDA
DATA GENERATOR SCRIPT
• Control a PN7160 NFC reader
• Write commands to see how they work
• Need to use GPIO extended to toggle the IRQ and VEN pins
Sends to address 0x50
NCI >> 20 00 01 01
NCI >> 20 01 00
NCI >> 20 02 05 01 00 02 fe 01
NCI >> 20 03 03 01 a0 14
NCI >> 20 00 01 00
NCI >> 20 01 00
NCI >> 2f 02 00
NCI >> 21 00 10 05 01 01 01 02 01 01 03 01 01 04 01 02 80 01 80
NCI >> 21 03 07 03 00 01 02 01 00 01
35. 3 4
CUSTOMER UNDER NDA
SETUP FOR SCRIPT
• PN7160 Script for
Discovery
2022_08_12.txt
40. 3 9
CUSTOMER UNDER NDA
MKE15 WITH PN7160
• All communications and then Discovery mode
MKE15 to PN7160 All Signals Proper TVDD Register 2022_08_12.sr
41. 4 0
CUSTOMER UNDER NDA
MKE15 WITH PN7160
• Reset condition
• Execute code in Debugger
MKE15 to PN7160 All Signals Proper TVDD Register 2022_08_12.sr
42. 4 1
CUSTOMER UNDER NDA
MKE15 WITH PN7160
• First NCI command written to PN7160
• Unshifted Address is 0x50 might be 0x28 on I2C sniffer
MKE15 to PN7160 All Signals Proper TVDD Register 2022_08_12.sr
43. 4 2
CUSTOMER UNDER NDA
MKE15 WITH PN7160
• 54mS from transmit until receive message
• IRQ low
MKE15 to PN7160 All Signals Proper TVDD Register 2022_08_12.sr
44. 4 3
CUSTOMER UNDER NDA
MKE15 WITH PN7160
• IRQ low 36.14mS after last transmit
MKE15 to PN7160 All Signals Proper TVDD Register 2022_08_12.sr
45. 4 4
CUSTOMER UNDER NDA
MKE15 WITH PN7160
• All 4 bytes count as one line in the NCI read
• IRQ goes low
MKE15 to PN7160 All Signals Proper TVDD Register 2022_08_12.sr
46. 4 5
CUSTOMER UNDER NDA
MKE15 WITH PN7160
• IRQ goes high
• Does another read
• All 12 bytes are one line
MKE15 to PN7160 All Signals Proper TVDD Register 2022_08_12.sr
47. 4 6
CUSTOMER UNDER NDA
MKE15 WITH PN7160
• Second read, second write, third read
MKE15 to PN7160 All Signals Proper TVDD Register 2022_08_12.sr
48. 4 7
CUSTOMER UNDER NDA
MKE15 WITH PN7160
• Second write command
MKE15 to PN7160 All Signals Proper TVDD Register 2022_08_12.sr
50. 4 9
CUSTOMER UNDER NDA
I2C DRIVER WITH LPC804 I2C SLAVE
• I2C Driver will act as I2C Master
− Use GUI to send commands
− Monitor I2C Traffic
• LPC804
− Act as a programmable I2C Slave
− Address can be programmed
− Commands can be parsed
− Register simulation to get back actual values
51. 5 0
CUSTOMER UNDER NDA
LPC804 SOFTWARE
• Start with code from Hackster I/O Site
• https://www.hackster.io/ktown/lpc845-i2c-co-processor-698c43#toc-i2c-slave-engine-2
52. 5 1
CUSTOMER UNDER NDA
LPC804 BOARD
• Has convenient pinouts for I2C on a header
• I2C pull up resistors already mounted
• Can be battery powered, which is very convenient as a test instrument
• Slight software rewrite to work with this board
SCL, SDA, GND
54. 5 3
CUSTOMER UNDER NDA
RECOMMENDATION FOR EXTERNAL PROGRAMMING
• Board powers itself up
• Tester provides SCL, SDA, and Ground connections
• Logic Analyzer capture of SCL, SDA, and Ground with possible Vdd
Tester
SCL, SDA, and GND
Board Under Test
PMIC
Power
Logic Analyzer
Vdd
55. 5 4
CUSTOMER UNDER NDA
CUSTOMER DESIGN
• Board powers itself up
• Tester communicates using UART
• Logic Analyzer capture of SCL, SDA, and Ground with possible Vdd
Tester
Board Under Test
PMIC Power
Logic Analyzer
Vdd
Customer
MCU
SCL, SDA,
and GND
UART
56. 5 5
CUSTOMER UNDER NDA
LOGIC ANALYZER EXAMPLE
• Example of I2C data capture
• Need to check if byte ACK sent by NXP device
Handshake protocol, not sure what this field is
32 bytes (0x20) of payload data
Start of sequential data
Slave ACK being present
Unshifted address
Slave ACK every byte