J
Reaction score
306

Latest activity Postings About

    • J
      I'm not seeing a problem in the Time library with this, rather the hardcoded unix timestamp in the sketch (1725879425) is one hour behind the specified timestamp of 11:57:05 9-9-2024. This is confirmed by www.unixtimestamp.com .
    • J
      jmarsh replied to the thread RAM optimization for large arrays.
      The CPU has a 32KB data cache (which is as fast as RAM1), so there's not much point manually copying any dataset smaller than that from PSRAM.
    • J
      I'm curious what you're doing that has such tight timing requirements? Lots of other things can delay execution by up to 200ns. PSRAM access to uncached data is a big one, accessing flash is another.
    • J
      It can work fine with nothing connected to the USB port, provided you don't write code that does one particular thing... Sometimes at the beginning of setup(), it can be helpful to have a line of code similar to while (!Serial); This makes the...
    • J
      No. Any usb serial communication requires interrupts, including the systick timer. Lots of code relies on the systick timer, either directly or via delay().
    • J
      A better question might be what works without interrupts. Serial output will eventually stop working. millis() will never update, affecting anything that relies on it or delay(). Anything related to audio or USB definitely won't work.
    • J
      Had a quick look, it seems like there are several virtual functions in USBHIDInput that are declared but not defined, intended to be implemented by derived classes. They should be declared as pure virtual (e.g. "virtual void...
    • J
      FS class requires a virtual destructor I consider this a bug since it prevents the interface being used as intended (inherited by other classes, if they are dynamically managed).
    • J
      jmarsh replied to the thread RAM optimization for large arrays.
      Of course, headers are included in compilation. If you declare an array as float input[250]; you cannot change its size at runtime. If you're using dynamic arrays (using malloc), those will go in RAM2. If you're worried about exhausting RAM2...
    • J
      jmarsh replied to the thread Pin Mode Multiplexing with XBAR.
      XBAR is mostly used for inter-module triggers without requiring the CPU to get involved, e.g. using a timer to trigger ADC sampling at a regular interval. It can't be used to reroute arbitrary pins, especially in this case where the bootloader...
    • J
      The Teensy specific stuff now lives in the HardwareSerialIMXRT class, so try using that instead of regular HardwareSerial.
    • J
      jmarsh replied to the thread RAM optimization for large arrays.
      The linker will use RAM1 by default and complain (fail compilation) if it doesn't fit. So unless that actually happens you don't need to worry about manually specifying which memory to use.
    • J
      It should work, the only possible catch would be if you were trying to call it from c++ code without the right declaration: extern "C" uint32_t set_arm_clock(uint32_t frequency);
    • J
      Why clone set_arm_clock() instead of just using the existing function? Regarding overclock step size, we actually ran into some trouble with the SDRAM devboards because they use industrial temperature, 500MHz rated chips instead of 600MHz and...
    • J
      jmarsh replied to the thread Pin Mode Multiplexing with XBAR.
      You can leave it disconnected from the bootloader, as has been done with several other custom boards.
    • J
      jmarsh replied to the thread RAM optimization for large arrays.
      What you're asking doesn't really make sense. The location of an array is determined either by its definition (if it is static) or the functions used to allocate it (if it is dynamic).
    • J
      Probably not accurate, the basic Teensyduino code is pretty rigid and based around powers-of-2 resolution. A 528MHz CPU clock would run the bus clock at 132MHz, which could be divided by 4 to give 33MHz... A while ago I did discover FlexPWM...
    • J
      How to generate a 32MHz square wave on pin 1: analogWriteFrequency(1, 32000000); // 32 MHz analogWrite(1, 128); // 128 / 256 = 50% duty cycle
    • J
      As far as keeping your changes while updating cores, using git with a separate branch for your changes and rebasing whenever there's an update makes it very easy.
    • J
      jmarsh replied to the thread Time library returns WRONG year..
      If it helps, the copy of makeTime() included in the cores library (in Time.cpp) is the one that has issues calculating leap days while the version in TimeLib works as expected.
    • J
      jmarsh replied to the thread UART logic level.
      You're much better off using either a unidirectional shifter or one with directional control. TXS0108 is known to have problems detecting the direction of a signal when in push-pull mode. (Also why are there both pull-up and pull-down resistors...
    • J
      It's possible, but you'd have to learn a lot of stuff about both USB and SCSI (used to send commands/control the CD drive) to be able to do it. I wrote my own USB Host library for Teensy 4.x and included some sample code to handle CDs like...
    • J
      Even without knowing what thread library/implementation is being used, the part about the timer interrupt calling try_lock() sounds incorrect. Interrupt routines run outside of threads and should not be able to own mutexes.
    • J
      You need to clear the CPU's cache of adc_buffer_A/B/C before reading from them, e.g. arm_dcache_delete(adc_buffer_A, sizeof(adc_buffer_A));
    • J
      jmarsh replied to the thread Ram2.
      You create "new" objects on the stack simply by declaring them inside functions.
    • J
      jmarsh replied to the thread Updated 8x8 and 16x16 audio.
      This doesn't look right: // TODO: needs optimization... static void memcpy_tdm_rx(uint32_t *dest1, uint32_t *dest2, const uint32_t *src) { uint32_t i, in1, in2; for (i=0; i < AUDIO_BLOCK_SAMPLES/2; i++) { in1 = *src; in2...
    • J
      jmarsh replied to the thread Please stop this spammer.
      slow clap for the stupidest spammer on the forum
    • J
      The frequency generated using PWM has to either be a multiple or integer factor of that module's clock source, so some values will be rounded up or down. analogWrite() sets the duty cycle of the signal, in this case 128 out of 256 time units per...
    • J
      jmarsh replied to the thread Please stop this spammer.
      These are practically all bots/spam accounts. Most of them aren't bothering to post messages, they're just filling their profile/'About" pages with links as a form of SEO. If the About pages could be turned off, would anyone really miss them?
      • Screenshot 2024-09-01 091208.png
    • J
      jmarsh replied to the thread Synchronizing teensies (again).
      I don't really understand how DMA can cause a recording delay? While its timing can be non-deterministic, it's typically only used to move recorded samples from one hardware buffer to RAM, while recording continues to another hardware buffer...
    • J
      Default pinmode is input so they are floating. digitalWriteFast() has to be used (to set the output level before setting the output mode) because historically with Arduino boards, using digitalWrite() when a pin is configured for input toggles...
    • J
      Probably. Use digitalWriteFast() to set the output value high before activating output mode.
    • J
      It's handled at the partition level, so all open files from the same partition.
    • J
      jmarsh replied to the thread Pyro channel circuit validation.
      I'm certainly not an expert but shouldn't the load be on the high side of the MOSFET, since the switching (gate) voltage is relative to S? Also, you want to put ~5V into VIN on the Teensy rather than 3.3V. Anywhere between 3.6-5.5 will probably...
    • J
      jmarsh replied to the thread Inexplicable error T4-1.
      The name of "mProgramChange" sounds like it is a member function of a c++ class, if that is the case it can't be used as a callback and should give a compilation error unless there is an explicit cast being used. Again, it would really help to...
    • J
      jmarsh replied to the thread Inexplicable error T4-1.
      What is the value of fptr? Are you sure that's not where the crash is happening?
    • J
      Yes the SD library only caches one sector at a time (512 bytes), so if you switch back and forth between concurrent files it improves performance a lot to keep file writes/reads at a multiple of that size.
    • J
      How do you figure that? uint32_t cycles = ((600000000>>16) * 6) / (1000000000UL>>16); simplifies to: uint32_t cycles = ((9155) * 6) / 15258; which evaluates to 3. This code is only intended to delay for a period of time, not any specific...
    • J
      Can you post a photo of how it is wired up, the schematic shows a Teensy 3.2 and no part numbers for U1/U2.
    • J
      Seems doubtful. At 200fps, the pixel rate at a resolution of 720p is ~184MHz and the maximum speed of the Teensy's IO pins is roughly 200MHz... so they're not likely to be able to keep up.
    • J
      Displayed on what?
    • J
      jmarsh replied to the thread First instruction execution.
      Is the unencrypted startup shim signed? If not, what stops someone overwriting it with their own code to dump the decrypted program?
    • J
      jmarsh replied to the thread First instruction execution.
      It's technically possible to boot from any address rather than the ROM by changing the initial VTOR address in GPR16. But then you have to manually take care of all the startup stuff that the ROM usually does (and GPR16 will always revert to...
    • J
      jmarsh replied to the thread First instruction execution.
      The processor has a built-in ROM which is the very first code that gets executed on startup. It checks the built-in fuses and/or the current status of some of the GPIOs to decide how to attempt loading an executable image. In the case of the...
    • J
      myFile.seek(64*32, SeekSet); // set myFile current position to 64*32
    • J
      It may require interrupts, it depends how much data is currently being queued. delay() doesn't disable interrupts so it's not a concern. I haven't used it myself but several people on the forum regularly recommend TyCommander for serial monitoring.
    • J
      On some machines the Arduino IDE serial monitor can be flaky after a restart. Closing it and reopening it usually helps.
    • J
      jmarsh replied to the thread Synching two Teensy 4.0.
      The idea would be that you use the GPS signal as a clock source to ensure they are synchronized (GPS isn't only useful for location). Could you measure the round-trip latency instead? So one Teensy would signal the other, which would then signal...
    • J
      Yes. The only common factor here is you and your equipment.
    • J
      jmarsh replied to the thread OV7670 XCLK Timing/Wiring.
      You can use shift registers 0 and 1 in logic mode to "clone" input signals on FlexIO3 D2 to D4 and D3 to D5. So that gives you 8 consecutive input signals on D4-D11 (logic modes update asynchronously so all signals would be in sync). That leaves...
  • Loading…
  • Loading…
Back
Top