I2C Audio Trigger and Switch Sensing Assembly
Bug Repair on Audio Prioritization
=====================================================================
PROBLEM: System is failing to prioritize which MP3 to play when certain events occur.
SOLUTION: Bidders must analyze the code and determine how to correct the code so the system works properly. It is understood that bidders will not likely have the hardware to completely test their code changes. Advanced Arduino skills are required to successfully resolve this problem.
CIRCUIT DESCRIPTION
Using Arduino open source hardware and firmware platforms, the circuit sends and receives one byte of data when requested by the master under address 0x30. The received byte triggers the audio circuit to play predefined tones based on the bits set. When multiple bits are set, a prioritization determines which mp3 to play. The circuit also monitors 5 switch positions, and sends corresponding bit status to the I2C Master via one byte of data 12.5 times per second.
BYTE OF DATA TO SEND (SWITCH POSITION SENSING)
=================================
bit 0 = FIRE
bit 1 = BCU
bit 2 = ACTUATOR
bit 3 = NONE
bit 4 = IFF_INTERROGATE
bit 5 = NONE
bit 6 = UNCAGE
bit 7 = None
BYTE OF DATA TO RECEIVE (TONES TO PLAY)
==================================
bit 0 = None
bit 1 = IFFunknown
bit 2 = IFFmode3
bit 3 = IFFmode4
bit 4 = Spinup
bit 5 = Acquisition
bit 6 = LockTone
bit 7 = BaseTone
SYSTEM TEST CONFIGURATION
1 Arduino Uno to simulate the master and to monitor data transfer.
1 Arduino Uno to test the code of the main board.
1 MP3 Trigger Board. PN WIG1102
1 SD card containing the audio tracks
5 switches connected to the main board to test sensing
1 computer with Arduino software to test code and monitor serial data.
Prioritizations are as follows:
Bit 1,2 and 3 (IFF modes) are the highest priorities. They are short tracks (beeps) identifying one of 3 conditions friendly, unfriendly, and unknown. If one of these bits are set, whatever tone is play must stop, and the IFF tone must play. Only one of the three tones are set at one time.
Bit 6 (lock) is next highest priority, all other tones should stop, and the bit 6 six should play. Only IFF tones (Bit 1,2 & 3) interrupt bit 6.
Bit 5 (Acquisition)is the next highest priority, and should play unless an IFF bit is set, or the lock bit is set.
Then bit 4 (Spinup)
Then bit 7 (BaseTone)
Bit 0 is not used.
All switch positions test fine. The problems with playing the correct MP3 are as follows:
Test with ORC4
The prioritization from bit 5 to 6 fails when both bits are set. Should play bit 6, but plays bit 5 if it is set first. Interestingly, the bit 5 to 6 transition does work when bit 0 and is set (in addition to 5 and 6). If bit 7 is set along with 5 and 6, the bit 5 to 6 transition does work fine too.
None of the IFF tones override bit 5 or 6, if they are set individually set. If 5 and 6 are both set, then IFF toned do override.
IFF tones do consistently override bit 7 and bit 7 and 4 together. But do not override the IFF when 4 is set independently.
When 2 IFF tones play the systems locks up and flashes an error code. I know you talked about this before, but can’t you just make it play bit 1 (unknown) or bit 0 (do nothing) if multiple IFF bits are set? This way the system doesn’t have to to rebooted.
Bit 4 plays through without 5 or 7 overriding it.
When bits 4 through 7 are all set together, the prioritization works as it should.
bit 0 = None
bit 1 = IFFunknown
bit 2 = IFFmode3
bit 3 = IFFmode4
bit 4 = Spinup
bit 5 = Acquisition
bit 6 = LockTone
bit 7 = BaseTone