HT98R068 Two-way Radio MCU
SPI Application Example Program
The source codes are attached in the HT98R068_AppInc.inc file where the SPI
application section contains:
SPI command Macro = SPITX (macro)
SPI Write = Procedure_SPI_Tx (procedure)
SPI Read = Procedure_SPI_Rx (procedure)
I/O Command (C[3-0]
:
Write/Read=8xxxx/9xxxx)
The Bit[19-16] setting differs for reading and writing. Set to “8(Dec)” for a write
command and “9(Dec)” for a read command. The audio processor will not reply with
any information during data writing. D7-D0 will be in a “Don’t Care” condition during
a read command execution. A7~A0 is the register addresses. D7~D0 is the access
data.
Write I/O CMD:
Master Write:
SPI[19:16]
SPI[15:8]
SPI[7:0]
4’b
1000
Address (A7~A0)
Data (D7~D0)
Audio processor reply:
SPI[19:16]
SPI[15:8]
SPI[7:0]
x (No signal)
x (No signal)
x (No signal)
Read I/O CMD:
Master Write:
SPI[19:16]
SPI[15:8]
SPI[7:0]
4’b
1001
Address (A7~A0)
x (Don’t care)
Audio processor reply:
SPI[19:16]
SPI[15:8]
SPI[7:0]
4’b
1001
Address (A7~A0)
Data (D7~D0)
Ex: Write C3h to the I/O register “1Eh” and then read this register to confirm if it is
correctly written.
Write 1Eh Flow
Flow description:
<81E3C>: Enable the DAC2, DAC1, AMP2, AMP1, Buffer, MIC, PGA circuits. There
will be no data response after the command is transmitted.
8