Props Ammo Counter Wip

Status
Not open for further replies.

Toby

Member
Okay, I've always wanted an ammo counter. Soooo I built one.
It's based on an atmega8 micro controller. I had to sell my soul to the devil and spend some money, but I managed to get ultra bright 1" 7-segment LED displays in BLUE! Features:

- 2x Ultra-Bright 1" LED displays in BLUE (!!!).
- Switch to select rifle type (MA5B [60 rounds @ 15 r/s], MA5C [32 rounds @ 10 r/s], BR55 [36 rounds @ 10 r/s]) on the fly.
- Muzzle Flash LED (high power if needed).
- Fire and Reload (duh).
- Fancy start-up sequence.

Not yet done/planned is burst mode for BR55 and maybe audio playback (done by PWM).

Pictures: LED Displays, Glowing Display, Development Board and Development Board.

I'll be posting schematics and code soon, I think this project is quite easy. I may be able to help out on some stuff, drop me a pm or post away.

Comments please!
 
Last edited by a moderator:
Looks good TF, that's similiar to how I'm redesigning mine. I'm interested in seeing your code, what did you write it in Assembly? I'm working on sound implementation one mine now, it's tricky.
 
No, I use C to program them. Assembly is obviously vital for such a project, but it just gets too tedious. You can look at the code outputted from the compiler, and it's very efficient. It's actually more efficient than assembly in the long run, because the compiler can optimize and use registers wisely. Plus, you can write asm code in C if you need time critical stuff.

I'm really not sure about sound, especially where to store the samples, how big the samples should be, how to loop them. I'm just not an embedded developer, so I'm used to... more resources and libraries :lol: . That being said, I still have 93% of the program space left and 99% of data space, so that shouldn't be the problem. I'm doing research now, but I've got two jobs (!) currently, moving and uni coming up, so I'm kind of tied up ^^.
 
Awesome, that's how I've been doing mine. Been writing them in C++ and using MPLAB to compile it. I think my MA5C program was only took up 2% of space on a PIC12F629.

For sound I've been fooling around with a project by Roman Black. It doesn't actually store or play a audio clip, it just recreates it by using the PICs outputs to recreate the frequencies, which you feed into a speaker. Needless to say, it's rather bad quality. I'm not much into embedded systems either though. lol Good luck though, I'll be following along.
 
You can achieve AM quality playback using PCM wav file sound samples stored in program memory. If you want higher quality, you'll need a voice chip or mp3 decoder chip.
You could also go the super crazy way of using the frequency generator on the atmega to mix your own audio to match the game sounds... sounds like what goku is decribing.

It's hard to tell in the pictures. Are you directly controlling the 7 segs or using a BCD counter?
 
2x Ultra-Bright 1" LED displays in BLUE (!!!).

wow thats a big display, my display is closer to a 1"
 
thatdecade said:
You can achieve AM quality playback using PCM wav file sound samples stored in program memory. If you want higher quality, you'll need a voice chip or mp3 decoder chip.
You could also go the super crazy way of using the frequency generator on the atmega to mix your own audio to match the game sounds... sounds like what goku is decribing.

It's hard to tell in the pictures. Are you directly controlling the 7 segs or using a BCD counter?
I'm directly controlling the segments through PORTD and multiplexing them. I wanted to keep costs down, so instead of using an attiny (which are quite expensive compared to atmega8) and shift registers/bcd ic, I want to implement everything on a single atmega chip.

That's the sound method I'm looking into, feeding the samples to a PWM timer and a highpass filter/smoothing cap. This performs a basic D/A conversion, and uses less pins than a R/2R network. It you know any resources/links, could you send them to me? That would be great, thanks!

I've looked into sound generating algorithms, but stuff like the Karplus-Strong algorithm uses too much processing power. Compared to PCM and the cheap hardware I'm using, the algorithm is an overkill, because quality is not needed.

link4044 said:
2x Ultra-Bright 1" LED displays in BLUE (!!!).

wow thats a big display, my display is closer to a 1"
Yeah, I know, I expected them to be smaller, but the black surrounding is so large. Also, I didn't really have much choice and I don't have a MA5B to size it up. I the end, it also depends on the rifle.
 
Last edited by a moderator:
do you mean schematics/circuit diagram? they're under constant revision obviously, but I can send you my latest working version.

a lot of the power of this circuit is the software on the atmega, you have to understand that, otherwise, the circuit is useless!

edit: PM me with an email, and I'll try and get them to you, but as I said, nothing is final yet, so no guaranties!.
 
Glad to see there's some others with electronics background around here. It's looking good TF. Those 1" LEDs are huge though lol, the 0.56" one I use look pretty accurate.
 
TF_Productions said:
do you mean schematics/circuit diagram? they're under constant revision obviously, but I can send you my latest working version.

a lot of the power of this circuit is the software on the atmega, you have to understand that, otherwise, the circuit is useless!

edit: PM me with an email, and I'll try and get them to you, but as I said, nothing is final yet, so no guaranties!.

This is exactly what I have been wanting to add to mine. I would really appreciate the schematics on this!!
 
Last edited by a moderator:
Status
Not open for further replies.
Back
Top