;TRIAX07.asm RB25Sep03 (For use with TRIAX2.4 or later revisions) ;---------------------- At RESET ; ======== ; A: if S2 pressed for <3s, runs most recent Application 1-3 (pointed to by FLASH byte NApp) ; B: if S2 pressed for >3s, beeps for 1s and then runs FreeFall ; C: if S2 not pressed, starts communication with PC at 38,400 bauds and... ; - If S2 presssed after Reset and before Handshake, ; then goes into Sample Mode (X&Y 100x/s 40.96s) ; - Handshake= waits for 'R' then responds with 'N' ('M' for <TRIAX06) and beeps once ; - once Handshake established, waits for one of the following ; 'V': sends 6 bytes = 'x',Xval,'y',Yval,'z',Zva ; 'F': sends 2050 bytes = 'A', Zval x 2048, 'Z' (2048 readings in 1s) ; 'G': sends 2050 bytes = 'A', Yval x 2048, 'Z' (2048 readings in 1s) ; 'H': sends 2050 bytes = 'A', Xval x 2048, 'Z' (2048 readings in 1s) ; 'K': sends 9 calibration bytes = 'X',Xoff,Xmax,'Y',Yoff,Ymax,'Z',Zoff,Zm ; 'k': waits for 'k' + 6 cal bytes (Xoff,Xmax,Yoff,Ymax,Zoff,Zmax) ---> flag ; '0': runs App0 (FreeFall) ; '1': runs App1 (Shock Detection); remembers App1 as last App ; '2': runs App2 (Anti-Theft); remembers App2 as last App ; '3': runs App3 (Battery Saver); remembers App3 as last App ; 'E': waits for AdrH & AdrL and returns EEPROM content at that address ; 'W': waits for AdrH & AdrL & Data and stores byte at that address