SOFTWARE - BALLOON MONITOR
Balloon Monitor
The balloon monitor is a PIC programmed by the teaching staff that sends messages from its data line. A new status report is made each time the query line is pulled from high to low and held low for at least 1mS. The data comes out in the form 0x02 AA BB CC DD EE CK 0x03 , where for an intact balloon status, AA = 0x48, BB = 0x75, CC = 0x6d, DD = 0x61, EE = 0x6E and CK = 0x5F and, for the popped status, AA = 0x5A, BB = 0x6f, CC = 0x6d, DD = 0x62, EE = 0x69 and CK = 0x53. For both cases the CK value is a checksum that is calculated according to AA ⊕ BB ⊕ CC ⊕ DD ⊕ EE. In an uncorrupted message, the XOR of the 5 data bytes and the checksum will produce a result of 0.
This message is sent to a PIC16F690 of our own. First confirming a valid checksum, the PIC then analyzes the AA byte, which has been stored, to determine if the message represents the intact or popped state. The PIC queries the balloon monitor immediately after receiving data, so it is regularly updating the status. Whenever we receive a "popped" message, the PIC pulls high an output that is connected to the Tiva. The Tiva stores these messages, and when it has received 20 "popped" messages in a row, it executes the code it needs to signify that we are without a balloon, putting us in the mind-controlled state. Because we are simply pulling a line high to signify the popped state, we chose to protect against noise by requiring the multiple "popped" messages. Because the code is almost constantly querying, this only adds negligible time to our popped response.
The balloon monitor is a PIC programmed by the teaching staff that sends messages from its data line. A new status report is made each time the query line is pulled from high to low and held low for at least 1mS. The data comes out in the form 0x02 AA BB CC DD EE CK 0x03 , where for an intact balloon status, AA = 0x48, BB = 0x75, CC = 0x6d, DD = 0x61, EE = 0x6E and CK = 0x5F and, for the popped status, AA = 0x5A, BB = 0x6f, CC = 0x6d, DD = 0x62, EE = 0x69 and CK = 0x53. For both cases the CK value is a checksum that is calculated according to AA ⊕ BB ⊕ CC ⊕ DD ⊕ EE. In an uncorrupted message, the XOR of the 5 data bytes and the checksum will produce a result of 0.
This message is sent to a PIC16F690 of our own. First confirming a valid checksum, the PIC then analyzes the AA byte, which has been stored, to determine if the message represents the intact or popped state. The PIC queries the balloon monitor immediately after receiving data, so it is regularly updating the status. Whenever we receive a "popped" message, the PIC pulls high an output that is connected to the Tiva. The Tiva stores these messages, and when it has received 20 "popped" messages in a row, it executes the code it needs to signify that we are without a balloon, putting us in the mind-controlled state. Because we are simply pulling a line high to signify the popped state, we chose to protect against noise by requiring the multiple "popped" messages. Because the code is almost constantly querying, this only adds negligible time to our popped response.
BalloonMonitor.asm | |
File Size: | 9 kb |
File Type: | asm |