M
Reaction score
26

Latest activity Postings About

    • M
      MarkT replied to the thread LED PWM without resistor.
      No, use a resistor, or you'll fry the LED or the Teensy. The absolute maximum ratings are just that. Exceed them and degradation and failure can happen. Why not consider a neopixel which takes one control signal and does the PWM for you?
    • M
      MarkT replied to the thread Including a library after booting.
      #include's happen at compile time. You are asking for something like dynamically linked runtime libraries, loaded from a filesystem at runtime (SDcard?), or something like code overlays. Do you actually have a problem with running out of code...
    • M
      MarkT replied to the thread T4 interrupt latency and etc.
      Remember there's also the time to de-glitch the input and process the vectored interrupt, not every part of the chip is clocked at the full 600MHz either. Anyway 72 cycles is only 120ns at 600MHz, which is very fast for an ISR response. Beyond...
    • M
      MarkT replied to the thread T4 interrupt latency and etc.
      No, it has to save all the registers it uses to stack which is many cycles. When the interrupt occurs it has no knowledge of which registers are live or not so it has to save all the ones it will clobber, not just the callee-save set like a...
    • M
      Its been a while since I used this, it might be a lack of memory (only the setSampleCount() function currently reports back a success value, the setFIRCoefficients() call blindly ignores if setSampleCount() fails - that needs fixing really, both...
    • M
      Maybe it is fussy about the ESR of the decoupling capacitor?
    • M
      MarkT replied to the thread I2S Speed (768kHz?).
      Left justified is a variant of I2S with a 1 bit timing shift of the data. It is easier for some chips to handle. Audio ADCs and DACs are all at least stereo because why wouldn't they be...
    • M
      Best done with DMA, although more complex to setup - interrupts are subject to timing variation from other interrupts, critical sections etc. The Audio library analog input class might be a source of inspiration.
    • M
      MarkT replied to the thread I2S Speed (768kHz?).
      4 channels? They would run in parallel, so BCLK for 32bit 768k is 64 x 768k = 49.152MHz, which has a period of ~20ns. There might be a ratio between MCLK and BCLK, but its not to do with channels, hopefully the device doesn't need MCLK anyway?
    • M
      Everyone and their dog uses a BAT54S (dual Schottky's in series) for such protection of a single line (usually the SOT23 version). If protecting multiple lines you can get the QSBT40 or similar (that one's a quad protection circuit, ie 8 diodes).
    • M
      MarkT reacted to SteveSFX's post in the thread Teensy 4.1 DIN rail system with Like Like.
      Hello all I have been tinkering around with a DIN rail mounted 4.1 system and it is actually coming out quite well! The main CPU module has the 4.1 in it with a 36 way bus that runs the length of all the slave modules. It incorporates a...
    • M
      MarkT replied to the thread X100 inspired Guitar Processor.
      Because it is the identity function... Probably the correct approach is to define an absolute-difference function: unsigned abs_difference(unsigned a, unsigned b) { return a < b ? b - a : a - b; } Note that this cannot overflow like the code...
    • M
      Two possibilities: mechanical construction - some dead track at each end before the metal contacts? Or there are IR drops on the power and ground wires so that the faders don't see the full supply range. Star grounding is the usual cure for this.
    • M
      Maybe start here (the link is in the comments to output_i2s.cpp) https://forum.pjrc.com/threads/65229?p=263104&viewfull=1#post263104
    • M
      Analog multiplexer for the inputs, PWM expander for the bulbs (using white LEDs will greatly simplify driving these lights).
    • M
      The pots have ground and supply switched too I think, caps normally to ground.
    • M
      MarkT replied to the thread Teensy 2.0 hi-Z outputs?.
      pinMode(pin, INPUT) is high-Z.
    • M
      Just give some Python examples for generating sos (second-order-sections aka biquad sections) with scipy.signal, very flexible, mirrors the functionality in Matlab... You probably don't want to lump this functionalty on the Teensy itself...
    • M
      Not necessarily, use a Cauer (elliptical) filter, rather than cascading 2nd order Butterworth stages. You can get much steeper filter skirts this way, although phase distortion is higher and there is pass-band ripple. This is 6th order Cauer...
      • Screenshot 2024-02-21 at 20.40.49.png
    • M
      MarkT replied to the thread cube 15x15x15.
      So the data signal and signal ground aren't run alongside each other? That could lead to large loop areas and lots of stray inductance on the digital signal.
    • M
      C46/47/50/52 provide very low impedance (at HF) to the ADCs while they are sampling - usually needed to get to datasheet levels of SNR. The opamp by itself will have quite high output impedance at HF, allowing ADC input currents to inject noise...
    • M
      MarkT replied to the thread cube 15x15x15.
      How are you routing signal ground?
    • M
      You can buy unique ID chips (often used for ethernet MAC addresses), and just log the ID at commissioning time in your database.- the chips are read-only and unique, often OneWire or I2C I think. Given a suitable driver that ought to be readable...
    • M
      T4's can do 1200 instructions per microsecond on a good day - yes it will make a huge difference to throughput.
    • M
      MarkT replied to the thread I2S Input Downsampling.
      It must be clocked at 2.048MHz to 4.096MHz, meaning it can handle 44.1kSPS and 48kSPS, not a low rate though. So its decimation filter is limiting to 20kHz basically. You'd have to take those samples and further decimate.
    • M
      Normally you'd code a state machine and use pressed() to trigger state changes - each state would test some subset of the buttons relevant to that state. Only if you need to know when a button is released would you need the extra complication of...
    • M
      MarkT replied to the thread I2S Input Downsampling.
      Yes, a decimation filter. Just selecting every 6th sample or whatever will mean lots of aliasing all across the band of interest. If the relevant ADC can work at 8k or 11.025k that's also an option (the device will have its own internal...
    • M
      @MarkT: Did you intend for the code to be as follows (appears to have a simple cut/paste duplication): void processButtons(){ btnLeft.update(); btnRight.update(); btnSelect.update(); if ((btnLeft.pressed()){ pIndex = mIndex...
    • M
      The pressed() method returns true once when the button has just changed to being pressed - you can't call it twice in succession as you'd clear the state by the second call. You could use isPressed() method, but then you have to debounce...
    • M
      LEDs are far noisier as the current being switched is large and there are many segments, ePaper is one possibility - only active when updating, although slow to update. Maybe use a separate display module with serial graphics commands?
    • M
      That style of dynamically adjusting filter may introduce distortion (as its not a linear time-invariant system). Sometimes that may matter, but not for the intended application, tracking movement.
    • M
      MarkT replied to the thread Changing the volume pin.
      Audio Adapter rev D/D2? No, its hard wired on the PCB. If you don't piggyback the adapter you could wire it however you like though.
    • M
      MarkT replied to the thread Teensy 4.1 Pins.
      A single position switch doesn't do anything (!) - do you mean single-throw? A diode-switch array can be used to scan multiple switches using fewer pins, ie a 4x4 array allows 16 switches to be sensed by 8 pins. IO expander chips also allow...
    • M
      MarkT replied to the thread FFT not working properly.
      But the data (#20) clearly has low frequency content, not just a DC offset...
    • M
      MarkT replied to the thread FFT not working properly.
      In post #15 for function loop() you've got braces in the wrong place (doesn't match indentation).
    • M
      Not going to work if that encoder pin happens to be open circuit at the time of the test - as I said there is no precise way to distinguish the cases for standard encoders.
    • M
      MarkT replied to the thread FFT not working properly.
      The FFT is going to dominate compute time. Hamming isn't my choice of a window function. Hann window is widely used for basic use, if you want accurate peak values a flat-top window is required. Alas many systems have a low quality flat-top...
    • M
      MarkT replied to the thread FFT not working properly.
      The low frequencies will be due to the DC offset - the peak value is often bin 1 for a naive FFT with a big DC offset. Removing DC offset is simple, subtract the mean from every sample.
    • M
      There is no precise way since a single input produces a signal indistinguishable from a quadrature encoder oscillating back and forth. You could have a statistical test on the assumption such oscillation is too rare to worry about. Simply count...
    • M
      MarkT replied to the thread FFT not working properly.
      One point to note, SAMPLES must be a power of two.
    • M
      That's for full bandwidth for each chip I guess - more microcontrollers these days have quadSPI for instance.
    • M
      You need CHANGE interrupt, but you can just trigger on A for the interrupt if you don't mind 1/2 the resolution. Triggering only on rising edges is distinctly odd timing - draw the waveforms and you'll see... BTW if the encoders are on a long...
    • M
      MarkT replied to the thread Triggered I2S.
      Interrupt driven code to pull samples from the I2S hardware. Reading up on the SAI units in the i.MX RT1060 manual (link in the T4 product pages). Some of the setup for these can probably be adapted from the AudioInputI2S class.
    • M
      AudioMemory call? setup code for the CS42448?
    • M
      MarkT replied to the thread Teensy 4 power supply.
      Well it would help to identify this mystery chip so we're all on the same page...
    • M
      MarkT replied to the thread Suggestions for recording data.
      I'd suggest sampling the data interrupt driven and putting in a circular buffer - then the main code pulls data from the buffer to write out - this allows for slow SD card access etc. SD cards in particular can occasionally take a long time to...
    • M
      MarkT replied to the thread Triggering problem.
      Well the audio sample time is more than twice that...
    • M
      MarkT replied to the thread Triggering problem.
      So you do need to synchronize 12 Teensy's - what time resolution?
    • M
      MarkT replied to the thread Triggering problem.
      I guess an input class that samples a pin using DMA and sets the output stream to 0 or 1 audio values, then that could be handled like any other audio stream. But that would have different latency from any particular ADC or DAC... But I'm not...
    • M
      MarkT replied to the thread Triggering problem.
      It would have to be interrupt driven to do that.
  • Loading…
  • Loading…
Back
Top