M
Reaction score
23

Latest activity Postings About

    • 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.
    • M
      MarkT replied to the thread Triggering problem.
      Sounds like a custom audio class is needed then.
    • M
      MarkT replied to the thread Teensy 3.2 End Of Life.
      I suspect during the chip shortage they prioritized the chips that were required by major industries like car makers and white-goods, no big mystery really.
    • M
      MarkT replied to the thread Triggering problem.
      This sounds as tricky as USB audio synchronization. You have two independent instances of the audio chain on the two boards. BTW why are you wanting this to work to better than 3ms resolution - that's usually fine for the human ear.
    • M
      Code is also faulty - you call close on a null pointer....
    • M
      MarkT replied to the thread Triggering problem.
      You're not synchronizing to the audio system I think. Since blocks by default are about 3ms that's enough jitter to fully randomize the phase of a 1kHz signal. The audio chain updates on that 3ms period with the default 128 samples-per-block setup.
    • M
      Just be aware that the headphone jack is for headphones/earbuds only, do not use it as a line output, it will not work. G = ground, L = left, R = right for the line inputs and outputs BTW
    • M
      Try the search term "rate conversion" for that. Reverse play is going to involve seeking in the wav file and reversing blocks in memory before feeding to the audio chain. Do you want to play at fixed speeds, or continuously variable? Speed-up...
    • M
      If there are vias the solder will wick into them and allow the chip to settle down, probably OK with solder covering the whole pad when that happens - surface tension does the work with SMT. WIthout vias bad things are indeed likely.
    • M
      Here is a new quick semi-jam using this synth project and some other Teensy based stuff. Cheers!
    • M
      MarkT replied to the thread Need advice on PCB manufacturers.
      cheapest and quickest are mutually incompatible I'm afraid. OSHPark are worth a look for convenience and price, their web portal parses the files and shows you what you'll get visually which is handy.
    • M
      MarkT replied to the thread Teensy 4.0 5v Serial Tolerance?.
      The only part of the chip that can handle 5V is the USB interface, the I/O pins are strictly 3.3V and its very easy to damage the chip if you exceed this, either through direct over-voltage damage or CMOS latchup caused by excessive protection...
    • M
      You disable interrupts across the Serial output, I don't think that's a good idea - keep the critical section(s) as short as possible: cli(); uint8_t count = PulseCount; uint32_t ticks = PulseEndTime - PulseStartTime; sei(); if (count > 3) {...
    • M
      MarkT replied to the thread Have I broke my teensy 4.1 board ?.
      400C will char FR4 under a trace rapidly - I would never recommend running that hot for PCBs - proper temperature controlled iron is the best approach, and decently designed bits, not super thin pointy ones. Practice on scrap PCBs is a great...
    • M
      Just lose it, you need the cap direct on the analog pin for best performance. The divider provides current limiting anyway.
    • M
      Like that, but with the top diode to the 3.3V rail, not 5V.
    • M
      Schottky clamp with series resistor is typically used for this. Add a cap on the analog pin to keep the impedance low, so 1k, schottky to 3.3V rail, 100nF to ground...
    • M
      MarkT replied to the thread Teensy 4.0 + ADS1220.
      In what way exactly? Have you done a basic sanity check that you are getting ADC readings at all?
  • Loading…
  • Loading…
Back
Top