Chapter 3: AT Commands Reference

June 30, 2008 AT Commands Reference Manual 3-221

Data sending (vector example):
Client has a data bus with 8 bits and plans to implement some protocol over it. In this example 4 pins (pins
1-4) are used as an output and 4 pins (5-8) are used as input.
Example of code is as follows:
AT+MIO D=000 01111,0 // Set I O pin s 1-4 t o be ou tput level mode.
OK
AT+MIOD=11110000,1 // Set IO pins 5-8 to be input level mode.
OK // Unnecessary, because by default all pins are input.
AT+MIOD? // (Optional) Read the IO pin definitions to confirm correct settings.
+MIOD : 11110000// Pins 1-4 output pins 5-8 input.
OK // At this point the module is configured to control the logic values of
all pins.
AT+MIO C=000 01111,0 0000011// Write vector, 0x3 on pins 1-4.
OK // (pins 1,2 high, pins 3,4 low).
AT+MIOC?// Read the pins status.
+MIOC: 01000011 // Pins 1,2,7 show the logical value high.
OK
AT+MIO C=000 01111,0 0000000 // Write vector 0x0 on pins 1-4.
OK
AT+MIOC? // (Optional) read the pins status.
+MIOC: 01110000 // Pin 1-4 low, pins 5,6,7 show logical high.
OK