Shematic for Teensy 4.1 compatible Pt8211-Kit?

vdbrey

Member
Hi!

Sadly, there is no schematic for the PT8211-kit on the page (https://www.pjrc.com/store/pt8211_kit.html).
I would love to integrate it to my Teensy 4.1

The one schematic i found does not fit with the picture on the site (see pin4 of the PT8211..)
pt8211_t4_pcb.jpg
vs
https://forum.pjrc.com/threads/29284-Dual-channel-16bit-dac-PT8211?p=141252&viewfull=1#post141252

Thank you!
Jan
 
This is probably something that only Paul could fully answer,

As mentioned the product page does mention Schematic... to do.

But I am wondering more specifically what you are asking.

If you are asking should this bersion of the board work with T4.1, I am pretty sure it should. That is if you solder sockets on top of T4.1 and plug it in same orientation, i.e. usb connection to left, first 11 pins with jack on the daughter board also to left...

As for Pin 4 of of PT8211, it appears to be routed to the small capacitor, which makes sense, I have not checked to see where the capacitor runs to, but am assuming ground as this is I am pretty sure the decoupling capacitor C14 shown in the schematic you mentioned. I am guessing that Pin 5 should connect to the other side of that capacitor. And both of these signals should also connect to one of the other larger caps (C11).
 
Thanks KurtE for clarification!
I try to integrate the circuit into a bigger PCB wich comes with some connectors etc for building a synth.
Trying to fit this into a very small case, which is why i try to avoid the audioboard as well.

While the P4 goes into the C14 capacitor at Pauls Design, the Design from the Forum does not - but you're right , this might be an good idea ;)
 
But this means: P4 connects to P5 on the PT... does this feel right?

Sorry I don't have the T4 version board, I did have an older kit for t3.x in box of spare stuff...
But I will assume that is same except: what is shown in the product page:
Update: We are now including 2 circuit boards with this PT8211 kit. This new board brings the 3 signals to pins 7, 20, 21 used by Teensy 4.0. If you are using Teensy 3.2, 3.5 or 3.6, solder the parts to the original board, without text between the capacitors. If using Teensy 4.0, solder with this new board which has "T4" printed between the capacitors.

Again if you look at the Schematic with these two scribbled up photos...
screenshot.jpg
screenshot2.jpg

Where Red is the +3.3v (and 3.3v after inline resistor ) And black is ground

As far as I can tell they match...
 
Wow, THANK you so much! On these images its much clearer. :cool:
I try and route it that way for now :D

If it works, i posts the files ;)
 
You can use the i2s port 2 which is pin to pin compatible with the pt8211 the routing is much nicer that way
Teensy pins
2 3 4
Pt8211 pins
3 2 1
 
That way you can also separate the pt8211 instead of having it underside the teensy you just have it on the side, and the routing wires are all short and nice
 
You can use the i2s port 2 which is pin to pin compatible with the pt8211 the routing is much nicer that way
Teensy pins
2 3 4
Pt8211 pins
3 2 1
Yes, this is the modified pin configuration on the PT8211_2 AudioOutput object that I needed to use in order to stack the PT8211 shield with the SGTL5000 quad shields for hex audio. It worked great, until last night while working with a laser image.
Suddenly, for no apparent reason, there was no output from the PT8211, but the SGTL5000 outputs were fine. Closer troubleshooting this morning revealed that there is no I2S signal on T4.1 pin 2. So, I tried another 'fresh' T4.1. Same deal, even when 'repatching' the working waveforms from the SGTL5000 to either of the PT8211_2 inputs.
I remembered some Arduino updates. So, I reinstalled Teensyduino (w/o uninstalling anything/don't know how). No joy.
Does the audio library only provide an I2S signal to pin #2, if the PT8211_2 is detected? IOW, am I not getting an I2S port 2 signal because of a dead PT8211 shield or is my PT8211 shield dead because there is no I2S signal?
On the other hand, did the audio library change last night to correct the discrepancy between the PT8211_2 pin definitions and the physical PT8211 T4 kit?
Thanks for your help.
:)
 
Does the audio library only provide an I2S signal to pin #2, if the PT8211_2 is detected?

Teensy does not, can not, detect whether a PT8211 chip is connected. All 3 signals are outputs. Teensy simply transmits the data, even if nothing is connected.

If you show the complete code, I'll try running it here on a Teensy 4.1 with the latest 1.57-beta1 Teensyduino and connect my oscilloscope to pins 2, 3, 4 to see the waveforms.
 
Thank you, Paul.
This is a basic Hex audio test sketch, which was working fine, prior to last night. At the time of failure, I was intermittently (between code edits and downloads) generating several (~4) 600 Hz sine waveforms on the PT8211, which is safely housed inside an acrylic enclosure. Perhaps it failed due to overheating?
But, since the 'fresh' T4.1 also failed to provide the I2S signal, then it must have been damaged by the 'dead' PT8211. IOW, another 2 T4.1's down and only 1 spare. Haven't even started the MIDI desk, yet.
I checked for continuity between DIN and Gnd on the PT8211, but there wasn't if that is any indication that I2S wasn't shorted to Gnd within a blown IC.
Thank you for testing this code and helping me to avoid damaging another T4.
:cool:

Code:
#include <Audio.h>
#include <Wire.h>
#include <SPI.h>
#include <SD.h>
#include <SerialFlash.h>


// GUItool: begin automatically generated code
AudioSynthWaveform       waveform1;      //xy=82.00463104248047,28
AudioSynthWaveform       waveform2;      //xy=82.00463104248047,65
AudioSynthWaveform       waveform3;      //xy=82.00463104248047,101
AudioSynthWaveform       waveform4;      //xy=82.00463104248047,136
AudioSynthWaveform       waveform5;      //xy=82.00463104248047,172
AudioSynthWaveform       waveform6;      //xy=83.00463104248047,208
AudioOutputI2SQuad       i2s_quad1;      //xy=344.00463104248047,159
AudioOutputPT8211_2      pt8211_2_1;     //xy=354.00463104248047,92
AudioConnection          patchCord2(waveform3, 0, pt8211_2_1, 0);
AudioConnection          patchCord3(waveform4, 0, pt8211_2_1, 1);
AudioConnection          patchCord1(waveform1, 0, i2s_quad1, 1);
AudioConnection          patchCord4(waveform2, 0, i2s_quad1, 2);
AudioConnection          patchCord5(waveform5, 0, i2s_quad1, 3);
AudioControlSGTL5000     sgtl5000_2;     //xy=351.00463104248047,249
AudioControlSGTL5000     sgtl5000_1;     //xy=356.00463104248047,209
// GUItool: end automatically generated code






void setup() {
  Serial.begin(9600);
  AudioMemory(20);
  Wire.begin();


  sgtl5000_1.setAddress(LOW);
  sgtl5000_1.enable();
  sgtl5000_1.unmuteHeadphone();
  sgtl5000_1.volume(.8);
//  sgtl5000_1.muteLineout();
  sgtl5000_2.setAddress(HIGH);
  sgtl5000_2.enable();
  sgtl5000_2.unmuteHeadphone();
  sgtl5000_2.volume(.8);
//  sgtl5000_2.muteLineout();


  waveform1.begin(WAVEFORM_SINE);   //Orange Left X
  waveform1.frequency(101);
  waveform1.amplitude(0.8);
  waveform2.begin(WAVEFORM_SINE);   //Yel Right Y 
  waveform2.frequency(200);
  waveform2.amplitude(0.8);
  waveform3.begin(WAVEFORM_SINE);
  waveform3.frequency(300);
  waveform3.amplitude(0.8);
  waveform4.begin(WAVEFORM_SINE);   //Red
  waveform4.frequency(200);
  waveform4.amplitude(0.8);
  waveform5.begin(WAVEFORM_SINE);   //Green
  waveform5.frequency(300);
  waveform5.amplitude(0.8);
  waveform6.begin(WAVEFORM_SINE);   //Blue
  waveform6.frequency(400);
  waveform6.amplitude(0.8);
}


void loop() {
}

UPDATE: Encouraged by your information, I installed only the PT8211 code from the above code onto the unused T4.1. The 'good news' is that it also had no I2S in pin #2, but had FS & BCK signals on pins #3 & 4.
IMHO, that proves that my Teensyduino install was corrupted by the Arduino updates. I had hoped that reinstalling Teensyduino on top of my existing install would correct that. Is there an uninstaller or should I simply delete the Teensyduino folders, then run the installer? Otherwise, would running the installer as administrator accomplish the desired restoration?
Sorry for asking so many questions, but this situation is a little too close to the 'cutting edge' for comfort. Only a few more wrong moves could put this project on hold until the end of IC shortages.
 
Last edited:
As promised, I copied the code from msg #13 into Arduino and uploaded to Teensy 4.1.

These are the waveforms my scope sees on pins 2, 3, 4.

file.png

Pin 2 definitely has a digital audio bitstream. Any chance you might have a cold solder or otherwise physically broken connection between pin 2 on Teensy and the data input on your PT8211?
 
Thank you, Paul for testing a Teensy 4.1 with the latest 1.57-beta1 Teensyduino.
After you had explained that the Teensy will produce those DIN, FS, & BCK signals, regardless of whether the PT8211 is connected, I mustered the courage to test the same sketch (w/o the SGTL5000 lines of code) on a new unused T4.1, without any shields to avoid damaging it. It doesn't even have header pins soldered on yet, so my scope probes were clipped directly onto the through holes. There was still no signal on pin #2 of the T4.1, but FS & BCK signals wee present on pins #3 & 4..
I'm guessing that you didn't see my update on msg #13. I had hoped to save you the effort of further testing. On the other hand, it is reassuring to know that the new beta still supports this hex audio configuration. So, thank you for that.
These tests seem to prove that my Arduino/Teensyduino installation was corrupted by those updates I had noticed, close to the time of failure. But, it also proves that simply reinstalling Teensyduino (which I had tried) doesn't correct the problem, so I'll try running the installer again as administrator.
I'm no aware of an uninstaller and briefly searched the forum last night, but nothing of relevance caught my eyes. Apart from the obvious complete uninstall of Arduino's IDE and the deletion of all related folders, are there any other procedures that you would recommend to restore Teensyduino?
Thank you for your time, Paul. Now, there is a glimmer of hope that I haven't damaged the last 3 of my 4 T4.1's.
 
are there any other procedures that you would recommend to restore Teensyduino?

.... procedures for MacOS, Windows, or Linux?

If Windows, 2 ways.

#1: Just run Arduino's installer again. It will delete the old copy. Then run the Teensyduino installer. Your data is kept in {Documents}/Arduino and prefs in {AppData}/Arduino, so if you want to fully purge everything, find and delete those locations. Maybe back up any important code before purging {Documents}/Arduino.... if your computer isn't set up to regularly do full backups of important data.

#2: Look for info online about "Portable Arduino". Unzip the non-admin ZIP file Arduino provides. Convert it to portable mode. Then run the Teensyduino installer on it (by default the installer finds the location Arduino's installer uses, so be careful to manually choose the location where you made the portable copy). The Teensyduino installer specifically detects if you have the portable Arduino and supports it, so you end up with a completely self-contained Arduino+Teensyduino. But later, having 2+ copies of Arduino gets confusing if you're in the habit of clicking files and letting Windows automatically launch the software. You don't get to explicitly control which copy it runs, so it's easy to get into a confusing situation where you're running a different copy than intended.

Similar for Linux. MacOS doesn't support portable Arduino. Default locations of prefs are in ~/.arduino15 on Linux and ~/Library on MacOS.
 
Thank you, Paul. That's very helpful.
".... procedures for MacOS, Windows, or Linux?"
Sorry, I should have previously specified. Windows #1 procedure sounds like the best option forward. I won't waste more of your time on the details, but you should soon see a project demo video on my Teensy Laser Control thread (I probably should not have said that.).
BR.

 
Paul,
Just a quick heads-up regarding the missing I2S port 2 issue. Clean installs of Arduino and Teensyduino didn't fix the issue.
It appears that the problem is being caused by Adafruit's Audio library ver 1.0.4 being upgraded to 1.0.5 by the Arduino IDE. I was only able to fix it by including Audio-master.zip. Initially, I was able to reproduce the issue by downgrading to ver 1.0.4 then allowing the IDE to perform updates. But, the results were inconsistent and now, both versions appear to be working ok.
Just thought you should know what I've learned.
 
What is this "Audio-master.zip" file? Where do I find it? I found this thread and am having the exact same problem (nothing on pin 2) and so am anxious to fix it, but how?

My pt8211s arrived yesterday so I was anxious to get it working. Since finding this same exact problem I have tried:

removing the 1.8.13 arduino install I was using, deleting all links
Installed 1.8.19 and the teensyduino 1.56

the pt8211 sine test runs when I change AudioObjectpt8211 to AudioObjectpt8211_2 but still nothing on pin 2. Four and three work great, no clock on pin 2.

Please tell me how you fixed this, I'm stuck.

Code:
#include <Audio.h>
#include <Wire.h>
#include <SPI.h>
#include <SD.h>
#include <SerialFlash.h>

// GUItool: begin automatically generated code
AudioSynthWaveform       waveform1;      //xy=110,75
AudioOutputPT8211_2        pt8211_1;          //xy=303,78
AudioConnection          patchCord1(waveform1, 0, pt8211_1, 0);
AudioConnection          patchCord2(waveform1, 0, pt8211_1, 1);
// GUItool: end automatically generated code

void setup() {
  AudioMemory(15);
  waveform1.begin(WAVEFORM_SINE);
  waveform1.frequency(440);
  waveform1.amplitude(0.99);
}

void loop() {
}
 
Last edited:
What is this "Audio-master.zip" file? Where do I find it? I found this thread and am having the exact same problem (nothing on pin 2) and so am anxious to fix it, but how?

My pt8211s arrived yesterday so I was anxious to get it working. Since finding this same exact problem I have tried:

removing the 1.8.13 arduino install I was using, deleting all links
Installed 1.8.19 and the teensyduino 1.56

the pt8211 sine test runs when I change AudioObjectpt8211 to AudioObjectpt8211_2 but still nothing on pin 2. Four and three work great, no clock on pin 2.

Please tell me how you fixed this, I'm stuck.

Code:
#include <Audio.h>
#include <Wire.h>
#include <SPI.h>
#include <SD.h>
#include <SerialFlash.h>

// GUItool: begin automatically generated code
AudioSynthWaveform       waveform1;      //xy=110,75
AudioOutputPT8211_2        pt8211_1;          //xy=303,78
AudioConnection          patchCord1(waveform1, 0, pt8211_1, 0);
AudioConnection          patchCord2(waveform1, 0, pt8211_1, 1);
// GUItool: end automatically generated code

void setup() {
  AudioMemory(15);
  waveform1.begin(WAVEFORM_SINE);
  waveform1.frequency(440);
  waveform1.amplitude(0.99);
}

void loop() {
}
Yes, that sounds like the same issue I had. I suspect that you're also seeing a warning, whenever you compile, saying that there are multiple library files named 'Audio.h'. I believe that's because one from Adafruit is automatically installed with the Arduino IDE. Adafruit have their own I2S audio board, so they simply forked the Teensyduino repo on github and changed the pin definitions for DIN, not pin #2.
When you install Teensyduino, it includes the correct Audio.h for the pt8211_2.
I found that including audio_master.zip (from the PJRC repo on github) didn't always solve the problem. So, assuming that you're running Windows here's what does:
1: Open File Explorer and navigate to C:\Program Files (x86)\Arduino\libraries
2: Delete all files named Audio.h within that folder and subfolders
3; Reinstall Teensyduino to include the proper Audio.h

Works for me, anyway. Please let us know whether it solves your problem, as well.
BTW, did you see my approach to modifying the T4 PT8211 breakout board? I used stackable headers (in case I need to replace the PT8211,... again), then cut the pins on the headers to stop the original signals on pins 7, 20, & 21 from reaching those inputs to the PT8211. Then, I rerouted those inputs to pins 2,3, & 4.
Of course, it would be much more convenient to simply have a new T4 PT8211 PCB, with the new pin #s, then standardize it for compatibility with the SGTL5000 I2S shields. Perhaps, someone more clever than I, would like to tackle that someday. JS.
hope this helps. Best of luck with your project.
:cool:
 
Nope, I see no warnings for competing audio libraries when I do this, nor do I see any adafruit files marked "audio.h." Looking into that folder, all I see are PJRC headers.

I just put the chip on an 8 pin adapter board and soldered it next to the chip like a DIP. Works perfectly, except it doesn't (and there's nothing wrong with the solder job, my probe is on the pin)

I'm using ubuntu 20.04 and I have a total fresh install, I have even perm deleted all old folders of arduino just to be safe. When I do a "locate Audio.h" I get exactly one, to be expected.

It doesn't look like it's not working. The clock lines are there and the data line has switching noise, it acts as if it's just outputting zeroes all the time.
 
Last edited:
Nope, I see no warnings for competing audio libraries when I do this, nor do I see any adafruit files marked "audio.h." Looking into that folder, all I see are PJRC headers.

I just put the chip on an 8 pin adapter board and soldered it next to the chip like a DIP. Works perfectly, except it doesn't (and there's nothing wrong with the solder job, my probe is on the pin)

I'm using ubuntu 20.04 and I have a total fresh install, I have even perm deleted all old folders of arduino just to be safe. When I do a "locate Audio.h" I get exactly one, to be expected.

It doesn't look like it's not working. The clock lines are there and the data line has switching noise, it acts as if it's just outputting zeroes all the time.

Bummer. That's very puzzling and disappointing to hear. Thank you for reporting back to let us know. Perhaps the libraries are stored elsewhere in Ubuntu? Try searching your libraries from inside the Arduino's IDE, under 'Tools > Manage Libraries...' select 'Installed' in the left dropdown, then enter 'Audio' in the search box. See if there is an result from Adafruit. Unfortunately, there's no option to delete it, which is why I pointed you directly to File Manager.
With further investigation, it looks like I had previously downloaded PJRC's master Audio repo as a zip file and named it audio-master.zip. I apologize for the confusion. But, since including it in my IDE worked temporarily (until the Adafruit update hit again) that might be an option for you to try next. The downloaded zip file is included from 'Sketch > Include Library > Add .ZIP library...'.
Looking at your sketch, I notice that you are not using the SGTL5000 audio shields. So, if you use just the PT8211 object in the Audio Design Tool, instead of the PT8211_1, then the DIN pin would be pin # 7, by default. That's the same pin configuration of the PCB you have, without needing to modify its pin connections. I only took that route in order to stack 3 audio boards for a HEX audio configuration.
 
From another thread I found the below sketch, which sort of works. If you uncomment ANY of the 12s_quad connections the whole thing "just works" as mentioned in the other thread. However, I am using the pt8211_2 position because it fits perfectly on a pc layout and I need to use the other i2s port for a st7735 display. With none of the pin connections to i2s_quad, the pt8211_2_1 gets no data input from pin 2.

So, it seems, the example does work if you use it as part of all these other connections, but I need all those other pin connections for something else hence using the 4.1 rather than the 4.0.

It seems to be a bug in teensy. I am using 1.56, any chance this is fixed in 1.57?

Code:
#include <Audio.h>
#include <Wire.h>
#include <SPI.h>
#include <SD.h>
#include <SerialFlash.h>



// GUItool: begin automatically generated code
AudioSynthWaveform       waveform1;      //xy=1341,274
AudioOutputI2SQuad       i2s_quad1;      //xy=1709,230
AudioOutputPT8211_2      pt8211_2_1;     //xy=1726,313
//AudioConnection          patchCord1(waveform1, 0, i2s_quad1, 0);
//AudioConnection          patchCord2(waveform1, 0, i2s_quad1, 1);
//AudioConnection          patchCord3(waveform1, 0, i2s_quad1, 2);
//AudioConnection          patchCord4(waveform1, 0, i2s_quad1, 3);
AudioConnection          patchCord5(waveform1, 0, pt8211_2_1, 0);
AudioConnection          patchCord6(waveform1, 0, pt8211_2_1, 1);
// GUItool: end automatically generated code


void setup() {
  AudioMemory(15);
  waveform1.begin(WAVEFORM_SINE);
  waveform1.frequency(440);
  waveform1.amplitude(0.99);
}

void loop() {
}
20220528_165312.jpg
 
I just tested your sketch on my laser projector and it worked fine with no modifications (except to reduce the amplitude to .8) on my Arduino installation. So the problem isn't within your sketch.
Since the DIN signal on pin #2 doesn't depend upon your PT8211 mods, that rules out hardware. I assume that you know there's no signal by testing pin #2 with a scope probe. IOW, the PT8211 can be removed from the equation. Only Arduino's IDE remains.
When I was having this problem, it would mysteriously come and go, often from one older sketch to another. Knock on wood, I haven't had any more issues since deleting the Adafruit Audio library.
TBH, I still believe that the issue is due to a wrong Audio.h. Have you not found it installed in the Library Manager? BTW, the one from Teensyduino won't be listed.
As you can see in the audio design tool, the only patch chords being used are from waveform1 and the PT8211_2_1 object. So, those lines you uncommented shouldn't be there, to begin with.
After battling this for a few days, I feel your frustration. I usually figure it out after walking away rom the keyboard for an hour to decipher the clues.:cool:
 
Back
Top