For a new project I'm working on, I'm turning an old Casio Personal Mini into a Speak & Spell (with possibly other functions). However, the speech library I plan on using is Talkie, and it takes up quite a bit of program space. I've been trying to look around for some microcontrollers I could use that have high program storage capacity, but I really don't know much about what I should look for, nor how to find ones that are compatible with the Arduino boot loader. Would any of you have any good suggestions? I'd probably need one with over 256KB of program storage.
-
Personally I always recommend the PIC32, but ... it's not the bootloader you want to care about. It's what will work with this "Talkie" library, whatever that is. If it's doing sound reproduction then it's probably going to have very specific non-portable requirements. So the only people that can recommend anything would be the author(s).Majenko– Majenko2020年07月09日 19:59:28 +00:00Commented Jul 9, 2020 at 19:59
1 Answer 1
In a comment, Juraj wrote:
the ATmega MCUs are similar so a port to Arduino Mega should be possible
This seems indeed to be very much the case.
Looking at the source code of the library, it appears it uses timer 2 for generating the PWM signal and timer 1 for scheduling the samples. These timers are almost identical between the ATmega328P of the Uno and the ATmega2560 used in the Arduino Mega 2560. The only relevant difference between these boards, as far as the library is concerned, is the output pin, which is the "OC2B" pin of the microcontroller:
- on the Uno, OC2B is digital pin 3
- on the Mega, OC2B is digital pin 9
So my guess is that the library should work on the Mega with just this tiny change:
--- a/Talkie/talkie.cpp
+++ b/Talkie/talkie.cpp
@@ -71,7 +71,7 @@ void Talkie::say(uint8_t* addr) {
//
// Enable the speech system whenever say() is called.
- pinMode(3,OUTPUT);
+ pinMode(9,OUTPUT);
// Timer 2 set up as a 62500Hz PWM.
//
// The PWM 'buzz' is well above human hearing range and is
Also, make sure you plug your headphones on pin 9 rather than pin 3.
If you try this and it works, please report that either here or directly to the author of the library. It should then be easy to modify the library to support both boards out of the box.
Edit: If you download Talkie through the Arduino library manager, you will get this version, which does supports the Arduino Mega 2560.