Search results

  1. M

    T4 Pixel Pipeline Library

    If your IMXRT_NEXT_PXP_t structure definition is available to the user, that could be the structure used to set up the PXP. Initializing the PXP then becomes simple matter of setting the PXP_NEXT register with a pointer to your structure. If you want to keep a local copy of the structure...
  2. M

    T4 Pixel Pipeline Library

    I used that technique in my years-old OV7670 camera libraries: CSI-Frame Capture IRQ -> Sets up and Starts PXP to convert YUV422 to RGB565 and shrink for ILI9341 PXP-End IRQ -> Sets up starts Async transfer to LCD This sequence captured VGA frames in a circular buffer in EXTMEM to...
  3. M

    T4 Pixel Pipeline Library

    I saw several post in different forums that indicate that a maximum of 5 arguments is an 'industry standard'. Seventeen arguments (if I counted right) seems to beg for a defined structure and passing a single pointer. In the good old days, with dumber compilers and processors, passing...
  4. M

    Attaching Event Responder inside class

    Mods to the Lepton driver were straightforward and work as expected. Both SPI and the EventResponder are now contained in the driver class. Thank you for your help! The mustache hides the smile of the happy programmer!
  5. M

    Attaching Event Responder inside class

    For now, I've decided to test @jmarsh's second option: make my class a derivative of EventResponder and override EventResponder.triggerevent. I think it has several advantages: 1. Minimal changes to source and no significant change in object code size. 2. No need to separately define an...
  6. M

    Attaching Event Responder inside class

    I am using the SPI EventResponder to good effect in receiving SPI data packets in the background from a Lepton 3.5 thermal imaging camera. The driver receives data frames as fast as the Lepton can send them (~9 frames per second due to ITAR limitations). It's all done in the background and...
  7. M

    Issue with 16-bit ADC (ADS8354) communication with Teensy 4.1

    I just checked the SPI.begintransaction code and it seems that the clock delay has been incorporated into the TD1.59 version of the SPI library. LPSPI_CCR_PCSSCK(div/2) has been added to the SPI _csr setup value. Perhaps, if the SPI clock is 20MHz, (div/2) does not provide enough...
  8. M

    Issue with 16-bit ADC (ADS8354) communication with Teensy 4.1

    I ran into some issues with SPI timing a few years ago. Here is one of the posts where it wax discussed: SPI MOSI pulled low too late on Teensy 4.0 Perhaps the ADS8364 has a similar sensitivity to SPI timing.
  9. M

    Tips on how to remove remembered devices from Windows, particularly handy when changing a Teensy device name in usb_desc.h

    I've been using a Windows App called Device Cleanup. It will find all the unconnected devices and allow you to remove them.
  10. M

    Pulse counter using Teensy 4.0

    Are the input pulses occurring at regular intervals? If not, you have to worry about stretched input pulses blocking incoming new pulses that occur soon after the first pulse. I got schooled on this issue when designing a radon scintillation detector as one of my first embedded microprocessor...
  11. M

    What could be my problem, is it the ADC code, MATLAB code or the functional generator settings

    Let's be clear: You CAN NOT collect and plot data faster than about 300 samples per second and plot it in real time. Neither the IDE plotting routines nor the human visual system can respond to more than about 30 data frames per second. You can receive and store a few hundred samples and...
  12. M

    What is 'State of the Art' for IMU + GPS on teensy 3.x 4.x

    LOL! I worked on a military guidance and control application some years ago where our results with UBlox systems were very good at our test site in Arizona. I kept telling the management to adjust their expectations if the system was used outside the continental USA. The answer was usually...
  13. M

    Simple code to show T4.1 ADC sampling rate is 1MSPS

    This code from the referenced thread should prove that the T4.1 can collect at 1Million samples per second: /******************************************************* 1.0 MegaSample T4.1 ADC using ADC timer to trigger the ADC collection. This version saves histogram data for timing...
  14. M

    USBHost_t36 slow reception of incoming data

    I did a bit of research on hubs. It seems that USB 3.0 hubs maintain two separate data paths: one for USB 2.0 with 480Mb/Sec capability and one with USB 3.0 5Gb/Sec capability. I verified that a USB 2.0 hub gives the same improvement in SerialHost read speeds. With an old, unpowered USB...
  15. M

    USBHost_t36 slow reception of incoming data

    I made an interesting discovery this morning: If I put a powered USB 3.0 hub between the Lepton T3.2 and the Host Serial port of the T4.1, the data upload speed increases dramatically! Without the hub, the upload of a 38400-byte frame takes about 300mSec. With the hub in between, the...
  16. M

    USBHost_t36 slow reception of incoming data

    I'm having other issues with the HostSerial receive that are puzzling. The T3.2 device sends good frames to my PC, but when I try to read with HostSerial, I get lots of garbage data or no data at all in the destination buffer. I think I may switch over to a simpler block-mode driver. There...
  17. M

    USBHost_t36 slow reception of incoming data

    I tried using the BigBuffer version. It didn't help. After a bit more research, I've come to two conclusions: 1. The availability of just two buffers for transactions may be a limiting factor. Making the buffers larger with BigBuffer doesn't help. 2. The internal code for block transfers...
  18. M

    USBHost_t36 and FTDI device - so close!

    You might try your tests using just "USBSerial serial(myusb);". I suspect that the FTDI is only a Full-Speed link, not the 480Mb/second High-Speed for which USBSerial_BigBuffer was designed. Just today, I found that BigBuffer will crash the T4.1 if you don't add the ",1" after 'myusb', when...
  19. M

    USBHost_t36 slow reception of incoming data

    I am working on a driver for the FLIR Lepton camera. As part of the testing, I send frames of 38400 bytes to a PC host for display. The driver is running on a custom T3.2 connected to the Lepton. It receives Lepton data over SPI using DMA, and transmits to the PC using the T3.2 USB Serial...
  20. M

    T4 Pixel Pipeline Library

    The PXP can be very useful for some applications. A little over 3 years ago, I used it to manipulate images for a slide show app. The PXP made possible things like fade-in, fade-out, moving transitions, and Ken Burns effect (combination of translation and scaling). A search of the forum...
  21. M

    T4 ADC high speed sampling - how to?

    Unless you have a WFI (Wait For Interrupt) instruction somewhere in your code, adding or removing interrupts shouldn't change power dissipation significantly. Adding more peripheral devices to your program can increase power dissipation if it turns on clocks that would otherwise be...
  22. M

    T4 ADC high speed sampling - how to?

    I'm not sure you need to add the complexity of DMA to do this. If 25000 samples (what you get at 250K sampling for 1/10th second), you only need 50KBytes for the ADC samples. You could put those in DMAMEM, standard ITCM or in EXTMEM, if you can't spare the standard ram. You will need EXTMEM...
  23. M

    [solved] Teensy 3.2 SPI speed decreasing over time

    After many months in T4.X land, I'm now embarked on a Teensy 3.2 project. I have to keep reminding myself that the T3.2 DOES NOT have a hardware floating point unit---much less one that does double-precision calculations with a 600MHz system clock. The thought of doing floating-point sine...
  24. M

    Glitches when using EXTMEM circular buffer for USB Host writes and reads by SD Driver

    The SD Controller does not necessarily use DMA. It can use either DMA or code which directly copies bytes: // From the SDIOteensy.cpp source code: bool SdioCard::writeData(const uint8_t* src) { DBG_IRQSTAT(); if (!waitTransferComplete()) { return false; } const uint32_t* p32 =...
  25. M

    Glitches when using EXTMEM circular buffer for USB Host writes and reads by SD Driver

    If the EXTMEM driver can handle 30MB/sec long term, that would explain why the EXTMEM handles the 18MB/sec 99.99% of the time, but sometimes gets address bits mixed up during the circular buffer wraparound. One problem I face is that, once the host has requested a response packet, it has no...
  26. M

    Glitches when using EXTMEM circular buffer for USB Host writes and reads by SD Driver

    In my current WIP project, implementing USB Test and Measurement Class (USBTMC) drivers for Teensy 4.1 hosts and devices, I have encountered an issue that may concern other developers who depend on EXTMEM for large buffers. In my case, I use 4MB of extmem as a circular buffer to handle incoming...
  27. M

    Increasing buffer size for Teensy 4.1

    A 64-byte buffer was probably a good choice in the days before the T4.x. For T4 systems, perhaps 512 bytes would be a better choice. Any T4 program that can't spare a few KB for buffers is probably so large or uses so much memory for data that it may have problems with stack space. However...
  28. M

    In Need of Teensy 4.1 Data Transfer Debug Help

    I should add that I quit using binary uploads a year or two ago when the MTP library matured and was much better integrated into TeensyDuino. A key feature is the MTPReset function, which updates the Teensy internal MTP directory so that your PC can see the most recent additions to your SD Card...
  29. M

    In Need of Teensy 4.1 Data Transfer Debug Help

    I did two things differently when I was uploading files to a Python script a few years ago. 1. I set up the T4.1 to use Dual Serial USB then used Serial1 exclusively for the binary transfers. 2. I used a much larger buffer, 51200 bytes (100 512-byte file blocks). For what it's worth, here is...
  30. M

    Is there a faster alternative to Serial1.write? (4.1)

    You can increase like this: sample timer.priority(64); // increase priority of sample timer interval timer Lower priority numbers actually mean higher priority. Think of it this way: higher numbers have to wait longer than lower numbers. Priority 64 should mean that your timer interrupt...
  31. M

    Teensy 4.1 serial USB crash

    You may think your PC program is only sending one frame every 50mSec, but are they actually arriving at the Teensy 50mSec apart? A 42-KB frame can be sent to the T4.1 in about 3milliSeconds if the PC really wants to pack the bytes into high-speed microframes! There's a lot going on under...
  32. M

    Teensy 4.1 serial USB crash

    OK,, since the OP specified 300 LEDs, it seems that each update is going to take about 9 milliseconds. Since the show() function starts with while (update_in_progress) ; If you have multiple frames of data, after the first call, each subsequent call to show() is going to take about...
  33. M

    Teensy 4.1 serial USB crash

    I'm not familiar with the Octo-Leds, but I have done a lot of high-speed comms between PC and Teensy. In one of your earlier posts you noted that the problems disappeared if you commented out leds.show(). For me, that immediately raised the question: How long does it take for leds.show()...
  34. M

    T4 ADC high speed sampling - how to?

    After thinking about your goal--collecting RMS voltage data, I decided to try a software aproach that relies on a single ADC channels collecting data at 50KSamples/second. Other than the ADC channel (using timer-controlled ADC collection), and a few resistors and a capacitor, there is no other...
  35. M

    Suggested ADC component

    The code at that link isn't quite a Teensy-compatible library. It does show how to use the hardware to collect analog data. With a wrapper to handle the Teensy SPI transactions, it might save a lot of work. A complete library should have an LT1867L object and encapsulate things like the...
  36. M

    Suggested ADC component

    I have used the Linear Technology LTC1867L in several projects over the last decade. ltc1863l-1867l.pdf This chip has been around since about 2005, but is still in stock at Digi-Key for about $20 at quantity 25. The LTC1867 runs off 5V, but its inputs are 3.3V compatible. You need to have...
  37. M

    T4 ADC high speed sampling - how to?

    I did some simple LTSpice modeling, and it looks like a simple capacitor and resistor divide may be adequate. For the 20 micro-farad capacitor could parallel a couple of 10uF ceramic caps. The output graph is hard to read, as the lines turned out to be too narrow. I used a relative voltage...
  38. M

    T4 ADC high speed sampling - how to?

    I've take a break from another project to look at your problem. There are several significant issues that need to be cleared up before I can come up with an algorithm: 1. What is the level of the signal output? I assume that, since it is an audio amplifier output, it has low output...
  39. M

    Teensy USB Host connecting to multiple devices

    Here's an update on the USBTMC project: After a few weeks lost to vacation time in a place sunnier than Western Oregon, I've gotten back to the USBTMC project. Progress has been better than I expected: 1. I have connected three Teensy USBTMC devices (1 T4.1 and 2 T4.0) to a T4.1 USBTMC Host...
  40. M

    T4 ADC high speed sampling - how to?

    If you want to sample the same signal with two different ADC channels, or even connect one signal to both an ADC input and a comparator input, you may need a couple of amplifiers to divide the signal into two (or more) parts, each having a low output impedance. The problem with simple...
  41. M

    USBTMC Callback functions

    My USBTMC (USB Test and Measurement Class) code has progressed to the point where I'm optimizing the data transfer functions that move data packets from the connected devices to the host. The USBTMC specification mandates request/response model where the host requests data packets of a specific...
  42. M

    T4 ADC high speed sampling - how to?

    Sorry about that. I'm in the middle of a cold caught on return from a family vacation trip. This link may be more useful Fast ADC sampling I'll look at your other questions the first morning after I get more than four hours of sleep!
  43. M

    NOUSB option for Teensy 2 OR a way to force Arduino IDE 2 to reload boards.txt

    At the top of the Boards.txt file is a reference to a workaround to make Arduino recognize changes to boards.txt. Boards.txt workaround the suggestion there is to delete the file "User Data" That file no longer exists in IDE 2.3.1. The solution is to delete the whole arduino-ide folder...
  44. M

    sampling arbitrary analog input at fixed samplerate

    Not entirely true. If you use the ADC timer functions in the ADC library, ADC Collection is started by the hardware. The response to the interrupt and the processing and storage of the results may be delayed a bit by other interrupts, but the sampling is good to a few CPU Clock cycles of...
  45. M

    There's more to adding a new USB device than editing usb desc.h

    This project is definitely going to be published---it's free of the NDAs that hinder the distribution of the FLIR Boson source code. It's a Work-In-Progress that will probably occupy a good part of my non-travel time over the next several months. I've just today gotten the Host T4.1 to get...
  46. M

    There's more to adding a new USB device than editing usb desc.h

    In a now-closed thread, @PaulStoffregen said: In the process of developing my USBTMC (USB Test and Measurement Class) driver, I have found it necessary to also modify usb_desc.c to insert the descriptor data from usb_desc.h into the executed code that sets up the usb devices. This involved...
  47. M

    T4 ADC high speed sampling - how to?

    There are some issues you need to consider: 1. How noisy is your input signal? This will determine how much hysteresis you will need in determining the zero crossing. 2. How often do you need to collect this data? 3. Will the results be used for real-time control of other processes? If...
  48. M

    Fix for boards.txt not updating is no longer valid

    Update: It seems you can make cosmetic changes to the USB type menu, and long as you don't change the number of items or their order. In boards.txt: teensy41.menu.usb.serial=Serial teensy41.menu.usb.serial.build.usbtype=USB_SERIAL teensy41.menu.usb.serial.upload_port.usbtype=USB_SERIAL...
  49. M

    Fix for boards.txt not updating is no longer valid

    At the top of boards.txt for TD 1.59 there is this: # Solution for Arduino IDE 2.0 recognizing changes to this file: # https://github.com/arduino/arduino-ide/issues/1030#issuecomment-1152005617 The solution at GitHub from @per1234 is: I'll share the workaround: Select File > Quit from the...
  50. M

    FFT not working properly

    I shouldn't do these things late at night! There's a bug in the code to extract the fft samples from the buffer. It should be: vReal[ j ] = adc_volt[start+j ]; vImage[ j ] = 0; // still not sure if this needs to be done more than once!
Back
Top