uMP3_SYNCThis routine will synchronize the Basic Stamp to the uMP3. The routine sends an ASCII ESC (27 decimal, 0x1b hex) to the uMP3, which will clear its buffer and return the command prompt. uMP3_SYNC: loopvar1 = 0 uMP3_SYNC_AGAIN: SEROUT UMP3R, uMP3Baud, [27] ' Send an ESC to clear the buffer SERIN UMP3T, uMP3Baud, uMP3StartUpTimeOut, uMP3_SYNC_Error, [STR buffer\1] IF buffer(0) = ">" THEN GOTO uMP3_SYNC_Complete uMP3_SYNC_Error: loopvar1 = loopvar1 + 1 DEBUG "uMP3 Sync Error: Bad/No response - check ST R (minimum 5)", CR IF loopvar1 > 3 THEN GOTO uMP3_SYNC_Error_2 GOTO uMP3_SYNC_AGAIN uMP3_SYNC_Error_2: DEBUG "uMP3 Sync Error: Too many retries - check ST R, or ST D (Baud)", CR GOTO uMP3_SYNC_End uMP3_SYNC_Complete: DEBUG "uMP3 Synchronized", CR uMP3_SYNC_End: RETURN
|