Playing wave files off an SD card or raw samples from flash doesn't cut it: Pokemons can tell the difference between imitated and real cries ;)
That's the main (and maybe only) interest of this project.
I want to use a CPLD to get as close as possible to the original Gameboy Pokemon sounds, by trying to copy the Gameboy's APU logic.
I chose one from the newest MAX 10 range from Altera, which really are cheap FPGAs with embedded flash. I had no choice but to go for a 0.8mm pitch BGA package.
The CPLD only has a clock input, mixed parallel/serial input bus, and one PWM output.
Pokemon pictures and cry data directly copied from the Pokemon Crystal ROM are stored in a 1MB SPI flash chip, which a LPC1342 ARM microcontroller pulls when requested to display on the OLED display and feed as APU registers updates to the CPLD.
The high frequency PWM audio is filtered by a R-L-C network and then amplified by a SSM2305 class D amp for a small 8-ohm speaker.
An electret microphone allows for simple blowing detection (noise amplitude), and a two-way navigation switch allows for Pokemon selection.
The whole thing is powered off a single cell LiPo battery, which is charged by USB.