
USR-WIFI232-G2 SPI Interface User Manua l http://en.usr.cn
Jinan USR IOT Technology Limited tec@usr.cnPage 3 of 3
1.2 SPI Function Switch Method Description
Use AT command
“
AT+SPIEN=on ” to open SPI mode, use
“
AT+SPIP ” set
parameters.
AT+ SPIEN set SPI mode, restart to effect, UART will automatic close
AT+SPIP set SPI parameters; master mode, transmission mode, clock
frequency
AT+SPIP=<ms, mode, frequency><CR>
+ok<CR>< LF ><CR>< LF >
Parameters:
ms: m, means master
mode: transmission mode, support 0,1,2,3
frequency: clock frequency, support 6MHz,3MHz,1.5MHz,750KHz,350KHz
Transmission mode corresponding clock polarity (CPOL) and clock phase (CPHA) in
the following table:
SPI Bus Protocol
Mode
CPOL CPHA
0 0 0
1 0 1
2 1 0
3 1 1
1.3 SPI Function Using Introduction
1.
1.
1.
1. SPI
SPI
SPI
SPI data
data
data
data sending
sending
sending
sending (module
(module
(module
(module
slave
slave
slave
slave device)
device)
device)
device)
When module sends data to slave device, INTR_I pin need to be a high level; and
the module will set CS pin low level. While transmitting, the MSB is first.
2.
2.
2.
2. SPI
SPI
SPI
SPI data
data
data
data receiving
receiving
receiving
receiving (slave
(slave
(slave
(slave device
device
device
device
module)
module)
module)
module)
When slave device sends data to the module, need to write data to the SPI buffer,
then set INTR_I pin low level, until the data is read by module, and then set INTR_I pin
high level.
Note:
Note:
Note:
Note: While
While
While
While reading
reading
reading
reading data,
data,
data,
data, module
module
module
module don
don
don
don ’
’
’
’ t
t
t
t set
set
set
set CS
CS
CS
CS pin
pin
pin
pin low
low
low
low level.
level.
level.
level.