Search results

  1. ProfHuster

    Can't compile and upload ADC examples

    There is definitely some magic in the code, like in adc_dma if ((uint32_t)pbuffer >= 0x20200000u) arm_dcache_delete((void*)pbuffer, sizeof(dma_adc_buff1)); This frees some memory, but pbuffer is a pointer returned by pabdma->bufferLastISRFilled();, so the allocation must be done by pabdma...
  2. ProfHuster

    Can't compile and upload ADC examples

    Thanks for the quick reply. I will check this morning.
  3. ProfHuster

    Can't compile and upload ADC examples

    OK. Got out my windows machine, Win 10, Teensyduino 1.55, Arduino 1.8.16. EXACTLY the same results. Uploading Examples -> Examples for Teensy 4.0 (or 3.1/3.2) -> ADC -> adc_dma Errors C:\Users\mhust\AppData\Local\Temp\arduino_build_608341\sketch\adc_dma_my_3_2.ino.cpp.o: In function `setup'...
  4. ProfHuster

    Can't compile and upload ADC examples

    I've spent six hours trying to get the Teensy 3.2 and 4.0 ADC examples going. I reinstalled Teensyduino 1.8.19, Teensy Loader = 1.56 on my MacBook Pro (14-inch, 2021), MacOS Monterey12.3.1 I need to do timed dma two channel ADC for a project with a sample rate of 320 kHz. I am using a Teensy...
  5. ProfHuster

    Remote weather station, first hardware project

    Time Domain Phase Measurement I am building an ultrasonic anemometer too. I decided I had to use a Teensy 4.0 to get a high enough sample rate on the pulses. The sensors work at 40 kHz, I sample at 320 kHz. First I tried time of flight. After digitizing, I demeaned the pulse, squared it and...
  6. ProfHuster

    Bug in Teensyduino 1.53? ADC examples not working

    Ok. The above worked. But if the code in Examples were fixed, it would have saved me two hours.
  7. ProfHuster

    TeensyTimerTool

    The problem is NOT in the repetition rate. The total length of a single train of 8 pulses jitters by 2.5 us. In the other thread I took a suggestion and tried the IntervalTimer. Much better results. 50 ns jitter in the length of the pulse train and a frequency of 39.8 kHz which is closer to 40...
  8. ProfHuster

    How to Make a Pulse Train of Exactly N pulses?

    I modified the code to repeat at 10 Hz. I found that this gives very stable pulse trains with a total jitter on the length of about 50 ns using a Teensy 3.2. And the frequency is accurate. I got a period of 25.1 us. In contrast when I used the TeensyTimerTool and a Teesny 3.2 the length of the...
  9. ProfHuster

    TeensyTimerTool

    Jumped Threads I changed loop to repeat the pulse train with a delay of 100 ms. void loop() { delay(100); cnt = 0; timer.begin(pulse, 2 * 40_kHz); } where cnt is a global volatile. With a Teensy 3.2 I get about 2.5 us jitter in the length of the whole pulse train, 1.25 %. (NOT the rep...
  10. ProfHuster

    Predefined Macros

    Thank you!
  11. ProfHuster

    Predefined Macros

    I can not find a list of what macros or definitions there are in the Arduino IDE. For example, Examples code has lines like #if defined(KINETISL) (Some code) #elif defined(KINETISK) (Alternate code) #else (Different alternate code) #endif What KINETISL and KINETISK stand for? I think it is...
  12. ProfHuster

    TeensyTimerTool

    Apparently only for Teensy 4.X. For Teensy 3.2 I might have to live with 41.7 kHz.
  13. ProfHuster

    TeensyTimerTool

    Is it safe to use a delay function in an ISR?
  14. ProfHuster

    TeensyTimerTool

    Ahhh. So inside my isr I could delay 500 ns? A hack. So I could calculate the extra nanoseconds I need and store it in a global volatile int, and the isr could delay that many ns. (I hate coding for a fixed frequency and having a "magic" number buried in an isr.) Thanks for the idea!
  15. ProfHuster

    How to Make a Pulse Train of Exactly N pulses?

    Thanks Joe, There are other tasks going on, ADC, filtering, and serial output, so I can't use polling. I also have a Teensy 4.0 if I need to switch, but I'd like to stick with the 3.2. If you have time, how would I set up an ISR on the RF event for that particular module, submodule, channel?
  16. ProfHuster

    TeensyTimerTool

    I need a 40 kHz pulse train so I used a timer at 12.5 us and toggled the output on and off, but the PeriodicTimer only uses integer microseconds. I searched this forum for "submicrosecond" and "nanosecond" and did not find hits. I was using a Teensy 3.2, but switched to a 4.0. Using the...
  17. ProfHuster

    How to Make a Pulse Train of Exactly N pulses?

    I am programming an ultrasonic distance sensor and I need a pulse train of exactly eight 40 kHz pulses at 50% duty cycle. I have tried several approaches and can't get what I want. First I used an IntervalTimer that counted down then ended the timer. I got some double pulses. BUT, here is my...
  18. ProfHuster

    Future Teensy features & pinout

    I used DMA and a timer.
  19. ProfHuster

    Future Teensy features & pinout

    Thanks for the answer. I was wondering *why* the DAC wasn't exposed, so you answered my question; there is no DAC.
  20. ProfHuster

    Future Teensy features & pinout

    I want to upvote the posts about using the on-chip DAC. I am doing some high speed modulation, so the forum solutions of using external audio dacs will not help me. For example I would like to create a user specified sinewave in the 1+ MHz range. It is possible with the 3.2 using the direct...
  21. ProfHuster

    Problem Connecting Teensy to Raspberry Pi with USB

    I will try the solution posted by `crees` and the modification suggestion by `defragster`.
  22. ProfHuster

    Problem Connecting Teensy to Raspberry Pi with USB

    Paul, Thanks again for the time. I look forward to the T4! Meanwhile I'll keep plugging along. If I find a solution, I will update the thread.
  23. ProfHuster

    Problem Connecting Teensy to Raspberry Pi with USB

    Ok. I didn't want to create a time sink, so I will keep trying on my own. But to clarify a point that is not Raspberry Pi specific: I know the `stty` command, but how do I use it to reset the Teensy? None of the documentation on `stty` or `termios` can tell me how to reset the Teensy. That is...
  24. ProfHuster

    Problem Connecting Teensy to Raspberry Pi with USB

    I have searched there and found that Arduinos work ok, but Teensy's are a problem. For example, I switched to an Adafruit Metro Mini (uses the Genuino/Arduino "device" in the IDE) and I do not have a problem. So for that reason I think it is a Teensy problem with the Teensy's.
  25. ProfHuster

    Problem Connecting Teensy to Raspberry Pi with USB

    Back to the Thread My situation is that I am setting up a remote sensing box, so I can't use the Arduino IDE. I need to connect from the Raspberry Pi to the Teensy using python, or bash, or C, with python preferred. I can't find documentation on how to do the low level setting the "helper...
  26. ProfHuster

    Problem Connecting Teensy to Raspberry Pi with USB

    I'm going crazy trying to communicate to a Teensy 3.2 from a Raspberry Pi. I want to read from (and in another application, write to) the Teensy. Python code that works fine between a Mac & Teensy or a laptop running Linux Mint and a Teensy, fails on a Raspberry Pi. Yesterday one of my students...
Back
Top