User manual

Peripheral Microcontroller API
The Peripheral Microcontroller communicates via the SPI bus using a 3 byte packet structure. Flag 1
serves as the SPI slave select line. The SPI bus is bi-directional. Commands are always initiated by
the DSP. The Peripheral Microcontroller only responds.
Most packets will have this form:
Cycle DSP -> PM PM-> DSP
Byte 1 Command Status
Byte 2 Data Echo Command
Byte 3 0x00 Response
Command Summary
Name Description
PM_Cmd_NOP 0x00 No Operation
PM_Cmd_COM_WR 0x01 Transmit a byte from the RS-232 port
PM_Cmd_COM_RD 0x02 Receive a byte from the RS-232 port
PM_Cmd_VERSION 0x03 Firmware version of the Peripheral Microcontroller
PM_Cmd_COM_BAUD 0x04 Set the UART baud rate
PM_Cmd_EE_ADDR 0x05 Set the address of the EE Memory
PM_Cmd_EE_WR 0x06 Write a byte to EE Memory
PM_Cmd_WD 0x07 Watchdog Timeout
PM_Cmd_COM_RESET 0x08 Reset the UART
PM_Cmd_EE_WREN 0x09 Enable Writes to EE Memory
PM_Cmd_RESET 0x0A Reset the dspstak
PM_Cmd_MODE 0x0B Get the dspstak mode setting
-- Reserved 0x0C
PM_Cmd_EE_RD 0x0D Read a byte from EE Memory
-- Reserved 0x0E
PM_Cmd_RESYNC 0x0F Used to resync the Peripheral Microcontroller
-- Reserved >0x0F
dspstakā„¢ 21262sx User Manual Page 21