It's been awhile but try this code:
// This sets the system time (NOT the Teensy RTC Clock)
setTime(tt); // seting the System Time Library only here.
// now we can use the system time to update the Teensy's RTC bits
// This sets the RTC Clock from System Time Library - epoch stylee...
Not really only the few notes in the (ADAT white noise on Teensy 4.0) thread. I did this for Atari Falcon 030 DSP connector since it's running in 8ch TDM.
Look here: ADAT white noise on Teensy 4.0
On Teensy 4.1 i had Extra 8 channels ADAT Out on Pin 31- EMC36 - SIA3 - Tx_Data0 out .
Just a Note: there is a BUG somewhere that will prevent compilation on Teensy 3.x
Wrong placement of #endif.
I wish I could tell you all the details but it's been a while since I was working on that project (about 3 years).
From what I remember all SAI 1~3 is running in slave mode and it's not synced to S/PDIF this is one of the reasons I am interested in this synchronization.
Well that's not good I didn't have any issue yet with the CD spdif output project.
By the way I am using SAI3 for AudioOutputADAT3 8ch Output instead (MQS) Medium Quality Sound on pin 31_TX_DATA _ [C3] _GPIO_EMC_36.
Been too busy but I just managed in fixing the CD frequency.
I was wrong on the frequency I use the wrong cd service manual :mad:
New Crystal: 4981-QT49-16.9344MBBK-B-ND
Interesting I think we need some software SAI reconfiguration depending on SPDIF_SRPC_LOCK.
Original: I2S_TCR2_DIV((1)) |...
I got some interesting samplerate from CD 44220Hz ?
Serial Monitor:
RX INPUT copy-restricted audio: bit is 0
TX OUTPUT copy-permitted audio: bit is 1
SampleRate: 44220
Test sketch:
#include <Audio.h>
CDTextAudioInputSPDIF3 spdif3_1;
//AudioInputSPDIF3 spdif3_1;
AudioOutputI2S...
EDIT: I am reading this in the i.MX Forums:
I have the SAI1 sub-system working, its used in master mode and it drives an ADC and a DAC. I have no issue with that, I use the audio pll (pll4) for root clock and all the clocks are fine. But we want to clock the ADC and DAC from the SPDIF. I can use...
I only need spdif to spdif for my best friend Technics SL-MC409 multi-disc CD changer.
I just added Optical Toslink Out and I think I'm running into the copy permitted bit in the channel status.
I'm also dealing with DTS CD Dolby Digital surround this is the reason I can't use Async_Spdif_out.
I'm about to test this but It took me awhile to figure out this piece of code: SPDIF_STC_TXCLK_SOURCE(2) 2 ???
if (syncToInput)
{
SPDIF_STC =
SPDIF_STC_TXCLK_SOURCE(2) | // tx_clk input (from SAI1 / MCLK3 = SPDIF in)
SPDIF_STC_TXCLK_DF(0); //...
Just few notes: Teensy 4.x is only 3.3v max.
I only use Open-Collector for control lines and SN74LVC4245A push pull for data lines.
NOTE the LVS not LS (too slow)
// SN74LS07 Hex Buffers and Drivers With Open-Collector High-Voltage Outputs
// Power the ic with 5v, Teensy OUTPUT_OPENDRAIN -- USE...
Now I don't remember if I use these but just in case I am including it here:
// Pin masks for direct port access Teensy 4.1
#define CS_MASK 0b00000010000000000000000000000000 // 0b0000 0010 0000 0000 0000 0000 0000 0000 -GPIO6-25 pin 23/A9
#define A1_MASK 0b00000001000000000000000000000000 //...
I did one 8-bit bus back in 2021 for A t a r i ST/e ACSI (Atari Computer Systems Interfac) hard drive Emulator + Media Transfer Protocol (MTP)
// 19 pin D-SUB male connector at the cable.
// ---------------------------------
// \ 01 02 03 04 05 06 07 08 09 10 /
// \ 11 12 13 14 15 16 17...
TPS2113A Power Multiplexer Carrier with USB Micro-B Connector https://www.pololu.com/product/2596
Good for Teensy 4.1 with pogo pins under for usb data lines D+, D-.
Reference manual p.399
11.6 IOMUXC Memory Map/Register Definition
Example:
// SPDIF_IN
CORE_PIN15_CONFIG = 3; // mux config registers control which peripheral uses the pin
// or
//
// Select one of iomux modes to be used for pad: GPIO_AD_B1_03
IOMUXC_SW_MUX_CTL_PAD_GPIO_AD_B1_03...
@joepasquariello
I find your modifications excellent for my project ( Audio I2S SAI1 SLAVE IN to S/PDIF OUT sync ).
I can't believe how accurate the frequencies seems to be here :D
I'm measuring WCLK (Word Clock) Master to Slave T4.0 on - LRCLK pin20.
FreqMeasureMulti #define...
If you're using Windows I highly recommend USBDeview. ( www.nirsoft.net/system_tools )
USBDeview is a small utility that lists all USB devices that currently connected to your computer, as well as all USB devices that you previously used.
For each USB device, extended information is displayed...
Example:
// Release data pins by putting them back to input
static inline void releaseData() {
GPIO6_GDIR &= ~0x00FF0000; //Set the 8 Data pins of GPIO6-16 to GPIO6-23 as input (note the invert ~)
}
@alex6679
Bit off topic question related to this thread: Resampling I2S slave inputs at the T4/ T4.1
Do you think it's possible - resample between 8khz ~ 50khz 8 channel 16bit TDM on T4.1 ?
Since you can't change USB frequencies @ run time I would love to have I2S slave input resampling the...
Alex on Windows I use USBDeview right click on VendorID 16c0 (I believe that's T4.x) and uninstall selected device now when you plug in USB T4.x it will reinstall with new configurations.
USBDeview v3.07 by NirSoft
I'm not sure I understand your issue but the delay(1000) will probably not work too well.
Try this example non-blocking loop().
// IntervalTimer myTimer; // NOT IN USE HERE
const byte interruptPin = 2; //button
volatile unsigned long blinkCount = 0; // use volatile for shared variables
unsigned...
WoW :D
I've been using your asynchronous spdif input successful and now you bring us hope for USB 8ch.
Alex thanks for this wish I have time to test this out now.
By default pinMode configure the pin with a feature called slew rate limiting maybe that's the problem ?
void setup()
{
pinMode(?, OUTPUT);
CORE_PIN?_CONFIG &= ~PORT_PCR_SRE; // turn off the slew rate limit
}
EDIT: Not sure if this will work for input instead of output ?
Interesting.
Here is my (Atari HD brick) HD ACSI implementation with Media Transfer Protocol.
I'm pushing the limits of the Atari ST/e DMA speed, based on Teensy 4.1. :D
Hey I am just curious is there any more information about your project somewhere for the Atari ST disk drive ?
Just asking because I am big fan of Atari computers.
Here is one of my projects for Atari Falcon 030 FDI+ Work In Progress !!!
You can only set the priority for the whole port not just one pin.
void setup() {
// put your setup code here, to run once:
NVIC_SET_PRIORITY(IRQ_PORTD, 0);
}
void loop() {
// put your main code here, to run repeatedly:
}
Well there is issue with the code actually.
#if defined(__MK20DX128__)
Serial.println( "CPU is T_3.0"); // FIX ME ):
#elif defined(__MK20DX256__)
Serial.println( "CPU is T_3.1/3.2");
#elif defined(__MKL26Z64__)
Serial.println( "CPU is T_LC");
I am curious if you overclock the F_BUS in (kinetis.h line:764 file) will things improve ?
This may help a bit:
void setup() {
// put your setup code here, to run once:
Serial.begin(115200);
while (!Serial && millis() < 2000 ); // 2 sec timeout
CPUspecs()
}
void loop() {
// put your...
The Teensy audio library can be made to work with slave mode but it does need to be modified.
For example 4 data input slave ( i use this with CoolAudio ADAT V1402 )
/************************* slave ********************************/
void AudioInputI2SOctslave::begin(void)
{
dma.begin(true)...