Teensy 4.0 and Talkie Library

Status
Not open for further replies.

andydasmith

Active member
Has anyone tried to get this working?. I have a project that uses the Talkie library which works fine on Nano (pin 3), Teensy 3.2 and LC via the DAC pin. My 3.2 source compiles on the 4.0 but I don't get any output on pin 3.
Not relevant to this forum I'm but also using the Accelstepper library to drive an X27.128 instrument stepper motor. The code I wrote for the Nano migrated perfectly to the LC and 3.2 but the motor movement is very erratic on the 4.0. I've tried slowing the beast down but that makes no difference.
 
I had a look at the AccelStepper problem - you need to call [tt]stepper.setMinPulseWidth (10);[/tt] or perhaps a bit more.
On other machines the default 5µs gets stretched to more than 10µs (the minimum most opto-isolated drivers can handle)
due to the slow code execution. On the Teensy 4 the code is super fast and you get only 5µs pulses...
 
Thanks Mark, I'll try that tomorrow and post the result here.
I've done a bit of digging on my Talkie problem and it looks like it was solved about a year ago:
https://forum.pjrc.com/threads/54711-Teensy-4-0-First-Beta-Test?p=194821&highlight=talkie#post194821

TALKIE LIBRARY: Got it working, two simple changes using pin3. (1) set up an if define for the RT1052 and (2) added analogWriteFrequency(3, 62500). Now its working. Guess its a pull request to the teensy library, only thing is the examples may need notes in them, since you don't have make pin5 high anymore for the propshield - that one now sure how to handle, unless it gets moved to the .cpp?

Can't see if the change was committed but I may just need to update the library
 
Tried updating to Talkie-1.1.0 and also just replacing the Talkie.ccp file from the link above, Both do not compile with Teensy 4.0 board selected. Will do more digging tomorrow. Searched Talkie-1.1.0 for the RT1052 define but could not find it. File does reference Teensy 4.0 however
 
That was tested early in T_4.0 beta and updated to work.

May need to call this function with desired PWM pin:
Code:
void Talkie::beginPWM(uint8_t pinPWM){
	_pwmPIN = pinPWM;
	_hasPShield = false;
}

In the end T_4.0 like T_4.1 ship with the 1062. The first Beta hardware was shipped when the 1052 was the available chip - but is no longer supported.
 
Evening all
Sorry I didn't answer this sooner. In addition to what @defragster mentioned the Talkie library is installed when you install Teensyduino and select it to be installed. The version shipped with Teensyduino has already been updated to use any PWM pin or the propshield. For instance, from the Tom's diner example:
Code:
  //voice.beginPWM(9);      // specify PWM pin to be used
  voice.beginPropShield();  // use if a propshield is attached using for talkie
  delay(10);
  voice.say(spDINER);

You have 2 choices for selecting where the output goes. The first option is to use any PWM pin by specifying:
Code:
voice.beginPWM(9);
where pin 9 is a PWM pin on the T4 or the T4.1
or if you are using the propshield you would use:
Code:
voice.beginPropShield();
 
Talkie working now on Teensy 4.0, pin 3. Thanks for all those that have helped.
Accelstepper now working too.
Damn, this thing is fast! I'm using a LM7805 1 amp regulator to power it and its hot. The Teensy 4.0 stays at room temp however, maybe I need a better regulator. I used this regulator on the same pcb with the Teensy 3.2 and LC and it only got warm.
Only difference between the setups I can see at the moment is that there is a very quiet audible whistle at max volume.
 
Having switched back to a Teensy 3.2 I think that the volume level (I had pin 3 configured for the 4.0 but have removed the "voice.beginPWM(3);") with the new library (Talkie-1.1.0) is much reduced from the old Talkie-1.1 library. Has anyone else noticed this? I can easily compare as I have 2 identical units which behave like this when they are switched to compile from the different libraries.
 
Status
Not open for further replies.
Back
Top