07-02-2025 06:56 AM
Hello NI Community,
I'm working on capturing UART data sent from an STM32 microcontroller using a PXIe-6570 Digital Pattern Instrument and NI-Digital Pattern Driver. The UART baud rate is 115200, and I’m trying to capture the character 'A'
(ASCII 65 = 01000001
) on pin UART_IO_1
.
I've created a pattern file using the match
, jump_if(matched, label)
, capture_start
, and capture
opcodes to detect the start bit and capture the 10-bit UART frame (start + 8 data bits + stop). The waveform name is set to "read"
, and I'm using niDigital Fetch Capture Waveform
in LabVIEW with Samples to Read = 10
.
Here’s the issue:
I only receive 1s or random results, not the expected bit pattern for 'A'
.
Sometimes the capture buffer shows all 1s.
It seems the capture is either starting too early or too late.
I’ve verified:
Timing set is configured with t.bit = 8.68 µs
Levels file is set for 3.3V logic
Pattern starts with a match
to detect UART_IO_1
going low (start bit)
jump_if(matched, capture_frame)
is placed after 80 match cycles (as required)
Pattern captures 10 vectors using capture
What’s the best way to synchronize the pattern start with STM32's UART transmission, given that the PXIe-6570 doesn’t support external hardware triggers?
Is my usage of jump_if(matched, ...)
correct, or would seqflag
be more suitable?
Could the capture window alignment still be off despite correct timing?
Any best practices for reliably capturing UART from an external asynchronous device like STM32?
I can share my full pattern file, timing set, and LabVIEW VI screenshots if needed.
Thanks in advance!
Solved! Go to Solution.
07-02-2025 10:23 AM
If you cannot make the DUT synchronous to 657x, then the only way is to use match opcode.
Here is an example https://forums.ni.com/t5/Example-Code/Digital-Pattern-Instrument-Source-Synchronous-Acquisition/ta-p...
07-05-2025 12:54 PM
Thank you for the clarification and for sharing the example. I understand that if synchronizing the DUT with 657x isn't feasible, using the match
opcode is the alternative.
I'll review the example you provided in detail. If I have any follow-up questions or need help with the implementation, I’ll reach out again.