beautypg.com

Spi operation, Spi commands, Table 5-1: spi command summary table – PNI CommBoard User Manual

Page 11: 5spi operation, 1 spi commands

background image

PNI Sensor Corporation

DOC#1018122 r02

PNI CommBoard User Manual

Page 9

5

SPI Operation

The RM3100 Evaluation Board, RM3000-f Evaluation Board and V2Xe incorporate a SPI

interface. For the RM3100 an I

2

C interface is also available, as discussed in Section 6. This

section reviews how to use the CommBoard to communicate with these SPI devices via a

computer using a terminal emulation program. Note the CommBoard not only converts UART

to SPI, but it also allows for control and monitoring of the SSN, CLEAR, and DRDY lines.

5.1 SPI Commands

A summary of the commands relevant for working with SPI devices is given below.

Table 5-1: SPI Command Summary Table

ASCII

Char.

Command

Syntax

Response

W, w

SPI Write

W{NIML}#(delimiter){{NIML}#(delimiter)

…}{}

R, r

SPI Read

R{#}{S}(NIML){{#}{S}(N

IML)…}

#{(delimiter)#...}{}

,

Delimiter

Delimiters. Used to separate characters or data
in a string. Sending a delimiter also changes the
default delimiter used in the return data string
sent to host.

X, x

Hex/ Decimal

X = Hex mode (default), x= Decimal mode

~

Hold for
DRDY

~1 = Hold until DRDY HIGH,
~0 = Hold until DRDY LOW

Y, y

Hold Always

Y

Q

Quit Hold

Q

(Capital „Q‟ only)

F

Flush UART
Receive
Buffer

F

(Capital „F‟ only)

?

Handshake
Status

?

Num2str (Uint8) or
dec2hex(Uint8). More
verbose in terminal
mode

!

Pulse CLEAR
pin

!

$

SSN Control

$1 = Set SSN HIGH, $0=Set SSN LOW

.

Pause 2 ms

.

V, v

CPHA Setting

“V” sets CPHA=1, “v” sets CPHA=0

O, o

CPOL Setting

“O” sets CPOL=1, “o” sets CPOL=0

Z, z

Clock Rate

“Z” = 1 MHz, “z” = 50 kHz, default = 100 kHz

T, t

Terminal
Mode

“T” turns on verbose terminal mode. “t” turns off
terminal mode.

For

“T”: Sign-on text

including mode and
version number