When working on a Microchip PIC project, I created a set of SCPI-style commands (Standard Commands for Programmable Instruments) to control the PIC. These SCPI com- mands use the first four characters of text words separated by a colon ':' character. In previous projects, I found that parsing text consumes significant computing time and code space; typically, text parsing is handled by string comparisons or developing a parsing tree. Neither of these techniques is simple to design and implement on a microcontroller.
展开▼