Forum Rule: Always post complete source code & details to reproduce any issue!
-
Senior Member+
Dual channel 16bit dac PT8211
Hi,
Has anyone used this component ? Is the soundquality ok ?
The price is amazing, only cents!
-
hey 
i hope this answer is still relevant for you... i bought the pt8211 chip and used it in a synthesizer project. it works without any problems
i cannot tell you much about the noise ratio or frequency response though, since i used pc speakers to test it.
you can use the "teensy-i2s" library (a small project later used for the audio library) or the audio library's i2s output for the data communication.
-
Hello everybody!
Looking at the datasheet the PT8211 use the i2s protocol, but the object in the audio library has different pin configuration. How BCLK,MCLK,TX,LRCLK relate to SCK, WS and SD? How did you connected them together?
Thanks!
R.
Last edited by Ruben; 05-27-2016 at 10:47 AM.
-

Originally Posted by
Ruben
Hello everybody!
Looking at the datasheet the PT8211 use the i2s protocol, but the object in the audio library has different pin configuration. How BCLK,MCLK,TX,LRCLK relate to SCK, WS and SD? How did you connected them together?
Thanks!
R.
inside "i2s.h" you can select which pins are used, i used I2S_TX_PIN_PATTERN_1.
iirc BCLK == SCK, TX = SD, LRCLK == WS
MCLK is not needed.
this is the code to transmit the bits:
Code:
I2STx0.begin(I2S_CLOCK_32K_INTERNAL,[](int16_t* buffer){
int16_t val = play();
buffer[0] = val;
buffer[1] = val;
});
I2STx0.start();
buffer[0] and buffer[1] have the same value, because my synth is mono
-
Thanks for the quick reply 
I'll be trying it out in the afternoon.
R.
-
I test it out, and seem to work, but I'm getting a very distorted sine wave by using this simple patch.
///
#include <Audio.h>
#include <Wire.h>
#include <SPI.h>
#include <SD.h>
#include <SerialFlash.h>
// GUItool: begin automatically generated code
AudioSynthWaveformSine sine1; //xy=192,220
AudioOutputI2S i2s1; //xy=390,220
AudioConnection patchCord1(sine1, 0, i2s1, 0);
AudioConnection patchCord2(sine1, 0, i2s1, 1);
// GUItool: end automatically generated code
void setup() {
AudioMemory(1);
sine1.amplitude(0.5);
sine1.frequency(100);
}
void loop() {
}
These are few pictures from the scope. Changing the amplitude value of the sine wave result in different shapes. At minus gain is almost a square wave, and by increasing the gain it get folded. Any suggestion on what could be wrong?
The "i2s.h" file where is supposed to be located? In the Audio library I found only "output_i2s.h".


Thanks in advance
R.
Last edited by Ruben; 06-06-2016 at 04:25 PM.
-
Senior Member
I've ordered 10 PT8211 chips from Futurlec.
I'm assuming you've used the connections from msg #4, but it would really help me to quickly reproduce this problem if you'd post clear photos or diagrams of how you've connected all 8 pins. Please attach the photo to your message (not dropbox).
-
Senior Member+
That distortion problem might be a coding issue. The PT8211 data sheet says that the I2S data has to be shifted in twos-complement format which I understand as signed int16_t. I don't know how the I2S object of the audio library does output its audio data, but if it were unsigned uint16_t, that would explain the "phenomenon" described above.
-
Hello Paul,
Your assumption is correct, I followed the suggestion from Tly.
Here an image of the schematic and a pic of teensy.
I don't know enough about the audio library to comment on Theremingenieur but thanks for helping :-).

-
Senior Member
Looks like you're using AGND (analog ground).
Use regular GND, since I2S is digital signals. AGND is only meant for analog signal stuff.
-
Senior Member+
Just discovered your scope pictures on dropbox. These folded waveforms show clearly a sign/overflow error. The data sheet states "The DIN data must be the 2’s complementary format and the MSB (Most Significant Bit) must be the first.". Looks like you are sending unsigned PCM while the DAC is expecting signed PCM.
-
Thanks for the info Paul.
I don't remember clearly which GND I used for the first tests, but changing it to GND instead of AGND doesn't resolve the issue.
Many thanks Theremingenieur.
This is something hardcoded into "output_i2s.h" right? I'll have a look into it.
-
Senior Member

Originally Posted by
Ruben
AudioMemory(1);
Don't be so stingy with memory, at least give the audio lib a few buffers to work with!
-
Senior Member
I2S signals change the L/R-Clock (WS) before the LSB is pushed out, bus this IC seems to expect the L/R-Clock to change after the LSB. So when fed with an I2S signal the DAC treats each LSB as the following sample's MSB... it think

-Ben
-
Senior Member
I got an email from Futurlec, saying "the PT8211 is out of stock and we have not been able to receive this part to complete your order".
-
Is still out of stock? :-(
I had the same experience. I had to get them from another reseller and use an smd adaptor.
-
Senior Member
Anywhere know where I can buy a PT8211 for testing?
If it's not in stock anywhere, I'm going to assume it's gone obsolete and of course no more follow will happen (at least from me).
EDIT: I ordered some from a random Ebay seller in Hong Kong....
Last edited by PaulStoffregen; 06-16-2016 at 01:10 PM.
-
I wrote an email to Princeton Technology and they suggested me to get them from their Taiwan reseller, so I did the same, I ordered some from an Ebay seller in Hong Kong.
-
Senior Member
Mine arrived today, 40 pcs for about 25ct (€uro-cents) a piece.
@Frank B, I can mail you some if you are interested.
-
Senior Member+
Hm, yes, would be interesting.
Do you have breakout-board ? No problem if not, but would be easier :-)
I can send you some parts in return.
-
Senior Member
No breakouts, sorry. PM me your address.
-
Senior Member
The 10 pieces I ordered just arrived.
-
Senior Member+
@Ben which package are they ? SOP ?
Do you suggest an own voltage-regulator ?
Which OP-Amps ?
-
Senior Member
SO8, 1.27mm pitch.
Regarding Vreg and op amps, filters: Definitely worth a try, but let's get it running first, Vusb will do for first experiments. I fear the 3.3V supplied by Teensy will be a bit on the low side, so maybe a dedicated low-dropout-regulator that supplies 4.5-ish volts would be better. The DAC has a common supply for it's digital and analog section, so expect no miracles... I think I have a design for a 20kHz 3rd order reconstruction filter somewhere, I'll post what I find.
-Ben
-
Senior Member+
Looking at the Datasheet (https://www.futurlec.com/Datasheet/Others/PT8211.pdf) I have the impression that one (the only?) problem might be the Frame-Sync-Early in the existing I2S Code.
Code:
I2S0_RCR4 = I2S_RCR4_FRSZ(1) | I2S_RCR4_SYWD(15) | I2S_RCR4_MF | I2S_RCR4_FSE | I2S_RCR4_FSP | I2S_RCR4_FSD;
Perhaps worth a try to remove that bit. Since i have no hardware, currently, i can't verify this..
#
Edit: Oops, wrong line. It should be removed from TCR4, of course.. The receiver-code can be removed completely
Last edited by Frank B; 07-04-2016 at 05:25 PM.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules