I was thinking of a stand alone circuit to make things simple, but I do have two spare I/O pins, it would mean less overall circuitry etc if I am able to use the PIC.
I'll look at incorporating it into the new PIC schematics today.
[EDIT]
And here it is. Two bi-colour LED's per side, Two outputs with darlingon paired transistors for the solenoids, output for the strobe, 3 inputs for fire, magazine and the bolt, and serial or 4 discreet outputs for the sound module.
The actual voltage measurement is done with the voltage divider on pin 2. I'll program it so when the rifle is being charged (Ie. voltage is above 13V or so) it will flash the LED's.
I'll probably go with a sound recorder chip with discreet inputs to generate the sound. That way I can chop the sound up like so.
- Fire - Just the actual concussion sound of the actual firing, with the eject sound mixed in.
- Pin slide sound + fire - just used at the start of the firing for continuity of the clip.
- Eject/Reload chamber - played at the end of the firing sequence (when you lift your finger off the trigger).
- Spare. (empty chamber firing sound?)
I have 4 outputs for the sound effects, so the PIC can select what sounds will be played on the fly. Each of the four possible sound clips will be assigned to one of the outputs, so the PIC just pulses the respective output to tell the sound recorder chip how to generate the final sound.
As follows:
- Single shot: Pin sliding sound + fire > Eject/Reload chamber
- Auto: Pin sliding sound + fire > Fire 2 > Fire 2 > Fire 2 > ......... > Eject/Reload chamber
Does the rifle have an empty chamber sound, ie a sound that's played when you try to fire a gun with no ammo? I'll add that to the spare slot if it does.
That's as far as I have got so far.
Programming this will be interesting... I have NO programming experience outside of BASIC from 15 years ago plus a bit of HTML...... I'll have to get the help of one of the programmers here at work.