notahardwareguy
Active member
This is driving me NUTS! I have two newly acquired and assembled PT8211(s) that I am trying to pair with Teensy 4.1 boards that are no Ethernet. One is lockable and one is not. The lockable has the PT8211 in a top mount configuration. The non-lockable 4.1 is breadboard connected to the PT8211.
I can not get either of them to work. I have removed/moved all non-stock audio-library branches, so I am using the standard stock audio library. Have confirmed this is so via the compiler logs. The first program below loads fine as shown to both a 4.1 with an audioShield and one with a PT8211. It plays fine (as expected) on the Teensy with the audioShield and as just static on the Teensy with the PT8211.
I can compile and auto-load a program to either of the two 4.1 boards that are connected to PT8211(s) from Arduino and can open a monitor window just fine (like blink or anything that does NOT reference a PT8211 - or maybe not the audio.h at all?). In the below file, if I comment out the "#define", I can ONLY load a program to the Teensy once where the loader automatically loads the Hex. No com ports are available to open the monitor window. If it try to load again, I have to use the board button. If I reset to factory default I can get one auto-load but again no com port. WHAT AM I DOING WRONG?!? This is driving me NUTS! I expect it is something simple I am just not seeing so any/all help is appreciated.
This is the "basic" audioShield program. Just comment out the define at the top for the PT8211 version. I tried the stock PT8211 test programs but they don't work either so this version was to try and fine out where.
Here is the end of the compiler logs for the "clean" compile of the "PT8211" version:
Again, thanks for any help.
I can not get either of them to work. I have removed/moved all non-stock audio-library branches, so I am using the standard stock audio library. Have confirmed this is so via the compiler logs. The first program below loads fine as shown to both a 4.1 with an audioShield and one with a PT8211. It plays fine (as expected) on the Teensy with the audioShield and as just static on the Teensy with the PT8211.
I can compile and auto-load a program to either of the two 4.1 boards that are connected to PT8211(s) from Arduino and can open a monitor window just fine (like blink or anything that does NOT reference a PT8211 - or maybe not the audio.h at all?). In the below file, if I comment out the "#define", I can ONLY load a program to the Teensy once where the loader automatically loads the Hex. No com ports are available to open the monitor window. If it try to load again, I have to use the board button. If I reset to factory default I can get one auto-load but again no com port. WHAT AM I DOING WRONG?!? This is driving me NUTS! I expect it is something simple I am just not seeing so any/all help is appreciated.
This is the "basic" audioShield program. Just comment out the define at the top for the PT8211 version. I tried the stock PT8211 test programs but they don't work either so this version was to try and fine out where.
Code:
/*
Modified demo of the audio sweep function against audioShield and PT8211...
*/
//#define AUDIOSHIELD // uncomment this line for audioShield test, comment this line for PT8211 test
#include <Audio.h>
AudioSynthToneSweep myEffect;
// comment this out to use PT8211...
#ifdef AUDIOSHIELD
AudioOutputI2S audioOutput; // audio shield: headphones & line-out
AudioControlSGTL5000 audioShield;
#else
AudioOutputPT8211 audioOutput; // audio shield: headphones & line-out
#endif
// The tone sweep goes to left and right channels
AudioConnection c1( myEffect, 0, audioOutput, 0 );
AudioConnection c2( myEffect, 0, audioOutput, 1 );
float t_ampx = 0.250;
int t_lox = 50;
int t_hix = 400;
float t_timex = 2.5;
void setup( void )
{
int timeout = 10;
Serial.begin( 9600 );
while ( !Serial && timeout )
{
timeout--;
delay( 1000 );
}
Serial.print( "setup (" ); Serial.print( timeout ); Serial.print( ")..." );
AudioMemory( 2 );
#ifdef AUDIOSHIELD
audioShield.enable( );
audioShield.volume( 0.5 );
#endif
Serial.println( "setup done" );
}
void loop( void )
{
Serial.println( "AudioSynthToneSweep - loop( ) start" );
playeffect( );
Serial.println( "AudioSynthToneSweep - loop( ) end" );
}
void playeffect( void )
{
Serial.println( "AudioSynthToneSweep - playeffect( ) start");
if ( !myEffect.play( t_ampx,t_lox, t_hix, t_timex ) )
{
Serial.println( "AudioSynthToneSweep - begin failed" );
while( 1 ) ;
}
while( myEffect.isPlaying( ) ) ;
if ( !myEffect.play( t_ampx,t_hix,t_lox,t_timex ) ) // and now reverse the sweep
{
Serial.println( "AudioSynthToneSweep - begin failed" );
while( 1 ) ;
}
while( myEffect.isPlaying( ) ) ; // wait for the sweep to end
Serial.println( "AudioSynthToneSweep - playeffect( ) end" );
}
// eof
Here is the end of the compiler logs for the "clean" compile of the "PT8211" version:
Code:
Memory Usage on Teensy 4.1:
FLASH: code:65564, data:9112, headers:8264 free for files:8043524
RAM1: variables:11648, code:62584, padding:2952 free for local variables:447104
RAM2: variables:14976 free for malloc/new:509312
Multiple libraries were found for "SD.h"
Used: C:\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\SD
Not used: C:\Program Files (x86)\Arduino\libraries\SD
Using library Audio at version 1.3 in folder: C:\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\Audio
Using library SPI at version 1.0 in folder: C:\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\SPI
Using library SD at version 2.0.0 in folder: C:\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\SD
Using library SdFat at version 2.1.2 in folder: C:\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\SdFat
Using library SerialFlash at version 0.5 in folder: C:\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\SerialFlash
Using library Wire at version 1.0 in folder: C:\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\Wire
C:\Program Files (x86)\Arduino\hardware\teensy/../tools/teensy_post_compile -file=ToneSweep_-_PT8211.ino -path=C:\Temp\arduino_build_213802 -tools=C:\Program Files (x86)\Arduino\hardware\teensy/../tools -board=TEENSY41 -reboot -port=Port_#0004.Hub_#0002 -portlabel=hid#vid_16c0&pid_0478 Bootloader -portprotocol=Teensy
No Teensy boards were found on any USB ports of your computer.
Please press the PROGRAM MODE BUTTON on your Teensy to upload your sketch.
Again, thanks for any help.