Search results

  1. J

    SPI1 & CS on 0 (pin 2)

    Just a suggestion, but it's easy to find working libraries for common ADCs and DACs. For example, if you google "github Arduino MCP3202", you'll find the one below, which looks very simple and probably works.... https://github.com/souviksaha97/MCP3202
  2. J

    SPI1 & CS on 0 (pin 2)

    As far as I know, the SPI drivers don't use SPI's built-in chip selects. You can assign any pin that is configurable as a digital output. Probably a good idea to show a simple test program.
  3. J

    FlasherX OTA update to a Teensy3.5 on Serial1 fails in the presence of a 'live' USB connection

    Your function CheckForUserInput() processes whatever characters arrive on either Serial or Serial1 as user input. You just need to decide where your input is coming from so that you interpret it correctly. If you look at the original FlasherX code, you'll see functions that take Stream*...
  4. J

    Teensy 4.1 bootloader MCU and direct RT1062 Serial Downloader

    T4.1 is a really complex device, and maybe not the best choice to learn embedded "from the ground up". If you start with something simpler, you'll have fewer features and less code to understand, and you can work you way up in complexity. SAMD21 and SAMD51 (formerly ATMEL, not MICROCHIP) are...
  5. J

    Happy little incident #11

    Which AI are you using? I've been using Claude so far, and I've been impressed by its ability to analyze code and find bugs.
  6. J

    Looking for Teensy 3.6 DEV-14058

    That is the part number for T3.6 with pins.
  7. J

    Can't see SD card files on PC using MTP_Teensy

    I don't know why your sketch doesn't work, but the sketch below does. When I run your sketch, it does not reliably complete logging, and rather than figure out why, I went back to one of my own sketches. This one started from the 1MSPS logger by @mborgerson. I added MTP. When the sketch runs, it...
  8. J

    Can't see SD card files on PC using MTP_Teensy

    Can you please post your modified sketch that uses MTP.reset() ?
  9. J

    Can't see SD card files on PC using MTP_Teensy

    Pretty sure this is not correct (i.e. that documentation is obsolete), because I've done it successfully with the latest TeensyDuino. Let me see if I can break it out into a working sketch.
  10. J

    Can't see SD card files on PC using MTP_Teensy

    Add a call to MTP.reset() beefore entering the loop that calls MTP.loop(). I don't know the internals, but I think it causes the host to update its directory listing. Glad to see you are using RingBuf and preAllocate() and checking file.isBusy() before writing to SD, but increase your write...
  11. J

    Teensy 4.1 UDP causes reboot after upgrading Teensyduino from 1.56.2 to 1.62.0

    Claude says it's undefined behavior, as opposed to strictly being an error. It says a lot more about why, but I'm not comfortable repeating what AI says. There is a compiler option to promote the warning to an error.
  12. J

    Teensy 4.1 FreqCount GateInterval

    Perhaps I should have said it's an unexpected difference in the FreqCount library between T3 and T4. I think there is at least one example sketch the mentions the use of usec for T4 versus msec for T3.
  13. J

    Teensy 4.1 FreqCount GateInterval

    You are correct about millisec for T3 and microsec for T4. I would say it's not well documented.
  14. J

    Teensy 4.1 UDP causes reboot after upgrading Teensyduino from 1.56.2 to 1.62.0

    May I suggest: try one of the NativeEthernet UDP examples try one of the QNEthernet UDP examples NativeEthernet has not been supported/updated by the author in quite a few years, whereas QNEthernet has active support/development. You might need to switch from NativeEthernet to QNEthernet with...
  15. J

    A new and more modern way to access and modify registers

    @shawn, are you working through the T4.x peripheral set? Can you summarize which you've implemented so far? The timer peripherals are really the ones where I've done any significant work at the register level.
  16. J

    Teensy 4.1 Sensed bit length dropped to half after update and rebuild

    This should be repeatable and about as good as you can do. static inline void delayCycles(uint32_t cycles) { uint32_t begin = ARM_DWT_CYCCNT; while (ARM_DWT_CYCCNT - begin < cycles) ; // wait }
  17. J

    Application Update via SD

    Good input. I will keep that in mind for the next updates.
  18. J

    Teensy 4.1 Sensed bit length dropped to half after update and rebuild

    I think when he says "libraries", he means Teensy4 core. There don't seem to be any libraries being used, even those included with TeensyDuino. Yes, if he's going to use a spin delay for timing, he should use delayNanoseconds().
  19. J

    Teensy 4.1 Sensed bit length dropped to half after update and rebuild

    Are you saying you had to add the line of code below? What are the units of "BitLen"? BitLen = 7.97; // was 14.07f; Also, can you tell us what encoder you are using? Manufacturer and part number? I'd be curious to know what is the protocol and whether perhaps you could use one of the T4...
  20. J

    Application Update via SD

    Sure. I just need to go back and remind myself of the issues that need fixing.
  21. J

    Application Update via SD

    Y You're right. The files in the main branch are version 2.3, which was my last update in October 2022. I'm really bad at using github, but I'll try to fix what is in the 2.3 release zip file.
  22. J

    BUG: Teensy 3.x serial data corruption when addMemoryForRead() grows the buffer past 256 bytes (uint8_t ring indices)

    Note that my test program will show a problem on a UART with or without a FIFO. Your program shows that with a FIFO, problems can occur even when sending/receiving relatively small "packets".
  23. J

    BUG: Teensy 3.x serial data corruption when addMemoryForRead() grows the buffer past 256 bytes (uint8_t ring indices)

    I confirmed that your program yields the same result on my T3.6. After that, I tried to simplify it, getting it down as small as possible while showing the issue. I found that your program only shows a problem if there is a call to delay() after write(), and the delay is long enough for all of...
  24. J

    BUG: Teensy 3.x serial data corruption when addMemoryForRead() grows the buffer past 256 bytes (uint8_t ring indices)

    I haven't tried yet. May be able to do that today. I have a couple of applications that do a lot of serial comm, and started on T3.5 before moving to T4.1, but I never used the add_memory feature to increase buffer size. Do I understand correctly that your test will fail if add_memory makes...
  25. J

    BUG: Teensy 3.x serial data corruption when addMemoryForRead() grows the buffer past 256 bytes (uint8_t ring indices)

    Okay, I do see the assignment statements in cores\TEENSY3 that seem problematic. When you say burst, you mean use of write with a length parameter, like below? If so, it's not hard to imagine prior tests using single-byte writes. I wouldn't call that "burst", though. Just call it a multi-byte...
  26. J

    BUG: Teensy 3.x serial data corruption when addMemoryForRead() grows the buffer past 256 bytes (uint8_t ring indices)

    Have you confirmed this with a test? I'm sure a lot of people are using the add_memory_for_read/write() functions, so it's hard to imagine this problem could have escaped detection. The added buffer is not contiguous with the original, build-time buffer, and tx_buffer_head/tail variables are...
  27. J

    Rust, Embassy, Zephyr - Ready for Prime Time?

    Thanks, that's interesting. It's not clear to me what Rust tools you are using. Have you created your own development environment? What was your starting point?
  28. J

    Rust, Embassy, Zephyr - Ready for Prime Time?

    Can you say a little about the application, and why a T4 for each of those functions? Curious.
  29. J

    Drawing graphics with ILI9341_t3.h breaks FreqMeasure.h EDIT: Looks specific to a T4.0

    You should try it again. Your existing code is not okay.
  30. J

    Drawing graphics with ILI9341_t3.h breaks FreqMeasure.h EDIT: Looks specific to a T4.0

    First thing I would try is changing loop() to be as shown below. With your original code, you may not include all of the freqMeasure data that is available. void loop() { //delay(5); while (FreqMeasure.available()) { sum = sum + FreqMeasure.read(); count = count + 1; } if...
  31. J

    ARM_DWT_CYCCNT

    which is about 7 seconds at 600 MHz
  32. J

    High-speed break-beam velocity flatlining on Teensy

    You could try using the cycle count register ARM_DWT_CYCCNT instead of micros(), but you would do better to do input capture with one of the timers. With input capture, the rising edge triggers the timer to save its counter value, so you get an exact measurement. If both of your signals were...
  33. J

    Midi 2.0

    I know nothing about Midi, but this looks like nice work.
  34. J

    PTP (IEEE 1588) Library

    Thanks for posting your fixes
  35. J

    Future Teensy Wish List in Haiku Form

    Software is complex Include testing in your plan Design first, then code
  36. J

    PTP (IEEE 1588) Library

    Did you mean to put 500M in your call in Setup()? You only put 50M. The only advice I can give is to look at Teensy-NTP and review its code. It does input capture using the 1588 timer but it must reduce its frequency to 25 MHz
  37. J

    PTP (IEEE 1588) Library

    The only application I know of that uses the 1588 timer is Teensy-NTP. In that application, the 1588 clock frequency is 25 MHz, which I think may be the default. I don't think it could be 1 GHz. You could determine the approximate frequency by read the running timer at some interval (1 sec) and...
  38. J

    Teensy 4.1 Generating stepper motor pulses using interrupts

    The TMR is used in PWM mode. The high time is updated on each PWM period, so the signal goes high at the start of the period and then goes low at the end of the high time.
  39. J

    Teensy 4.1 Generating stepper motor pulses using interrupts

    There's a thread where I made some updates to TeensyStep4 that was enough to get some useful examples working. It was not enough to satisfy the desire of users of TeensyStep(3), but it would be worth reading through. Just search for TeensyStep4 and messages from me.
  40. J

    FlasherX buffer size is 4k issue

    Yes, it takes a while. Yes, it could. Yes, it would. If you use more than the default 64 sectors of Flash for EEPROM, or if you use LitteFS, or if you install a very large program at some point, or you do something custom to write to high flash, any of those could leave unerased flash in the...
  41. J

    FlasherX buffer size is 4k issue

    Frank, that’s exactly what FlasherX does. After your 15 sec erase, install app, and update with FlasherX, whst was the reported buffer size? It should have been close to 8 MB less FLASH_RESERVE less the size of your sketch.
  42. J

    SD.open()?

    I’m not. See the BBEdit help or use google.
  43. J

    SD.open()?

    You said you use BBEdit. It has multi-file search capabilities, so you can use it to easily search through all of the Teensy core files on your own machine.
  44. J

    HardwareSerial read() suggestion for large reads

    I did a little searching and found there is a popular (1500 stars on github) open-source ring buffer called "lwrb" (lightweight ring buffer) that provides these capabilities. The features list says it is thread-safe and interrupt-safe for Cortex-M, and is MIT licensed. Would it make sense to use...
  45. J

    FlasherX buffer size is 4k issue

    The base address is not set. What FlasherX does is start at the TOP (highest address) of flash and work downward. First, it skips over the FLASH_RESERVE. You said you had that set to 64 sectors, and if so, that's enough to get past the EEPROM area. Then it walks downward, checking to make sure...
  46. J

    FlasherX buffer size is 4k issue

    Frank, if you're working on multiple computers, check to make sure that you have the FLASH_RESERVE macro set to 64 sectors (or larger if you are using LittleFS) on all of them.
  47. J

    FlasherX buffer size is 4k issue

    @jmarsh, when I was working on FlasherX, the bootloader always erased the entire Flash except for EEPROM or LittleFS, if they were in use. FlasherX works well if you start with a full erase, install your sketch via the bootloader, and thereafter do your updates via FlasherX, which is how I use...
  48. J

    FlasherX buffer size is 4k issue

    FlasherX can work in different ways. The demo program receives Hex records via USB or UART serial, parses each one as it arrives, and writes only the binary data to the buffer (in Flash or RAM). I think there is also a demo program where the Hex file can be on the SD, and once again it is parsed...
  49. J

    Teensy 4.0 Frequency Counter

    You should use a schmitt trigger. T4 is very fast and needs very sharp edges to count accurately. Since you are using 1000 us in your call to FreqCount::begin(), available() will be true every 1 ms. If your display code takes longer than 1 ms to run, your program won't keep up with the data and...
Back
Top