Forum Rule: Always post complete source code & details to reproduce any issue!

Search:

Type: Posts; User: mborgerson

Page 1 of 4 1 2 3 4

Search: Search took 0.00 seconds.

  1. Within the limits of my 60MHz oscilloscope, it...

    Within the limits of my 60MHz oscilloscope, it seems you get pretty good square waves when you request an analogWriteFrequency() which divides into 150MHz an even number of times:

    150/6 = ...
  2. Offhand, I'm not sure about the Teensy 3.5, but...

    Offhand, I'm not sure about the Teensy 3.5, but on the T3.6, you can have your ADC pins use an internal 1.2V reference. This reference will not be affected as much by the the current spikes from SD...
  3. Replies
    3
    Views
    135

    It would help a bit if you defined what you mean...

    It would help a bit if you defined what you mean by "random values". Do you get values from 0 to 1023 (the full scale for 10-bit resolution), or random over some smaller range near the expected...
  4. I dug up some code from earlier forum posts and...

    I dug up some code from earlier forum posts and figured out how to switch pin 0 (GPIO1_3) as pixel clock to a slow-mode port pin. It does give a faster interrupt response--the time from clock...
  5. According to the app note at : ...

    According to the app note at : https://www.nxp.com/docs/en/application-note/AN12078.pdf

    It should only take about 12 clock cycles. However, I followed the methodology in the app note and found...
  6. I think I've measured the time required to enter...

    I think I've measured the time required to enter and exit an empty ISR. That time is 103 clock cycles. I arrived at this number as follows:

    In a tight loop, read the ARM clock counter in two...
  7. I guess that means that to meet the OV7670...

    I guess that means that to meet the OV7670 waveform specs you would need to limit the clock to 25MHz (3 cycles on , 3 cycles off). If you set up the pixel clock that way, the time between pixels is...
  8. If you want to speed up your pizxel processing...

    If you want to speed up your pizxel processing you can get your pixels directly from the GPIO6 data register and do some bit manipulation. The direct read version in the attached code runs about 7...
  9. Have you run across this thread that shows how to...

    Have you run across this thread that shows how to read a CMOS camera using the CMOS Sensor Interface (CSI) of the IMhttps://forum.pjrc.com/threads/62038-Teensy-4-1-CSI-Example

    The code is not for...
  10. Replies
    5
    Views
    158

    My original values worked OK for 500Hz. If you...

    My original values worked OK for 500Hz. If you want to go down to 100Hz, you need larger resistors and capacitors. It will also depend on the value of the internal pullup resistors on Pin 17. I...
  11. Replies
    5
    Views
    158

    I don't think you'll have much luck finding a...

    I don't think you'll have much luck finding a software-only solution as the FreqMeasure library needs signal transitions and I think those transition thresholds are fixed in the hardware of the I/O...
  12. Replies
    47
    Views
    1,733

    The code in Post #26 writes the ADC data to the...

    The code in Post #26 writes the ADC data to the PSRAM at a speed determined by the ADC conversion speed settings---which is not exactly 1MSamples/second. The code in Post #45 writes to the SD Card...
  13. That is the basis of my question about the...

    That is the basis of my question about the validity of micros() if interrupts have been disabled for more than a millisecond. If a systick() interrupt is missed, by disabling interrupts, will...
  14. I have had no problems using micros() inside an...

    I have had no problems using micros() inside an interrupt handler---as long as the handler executes in less than a millisecond.

    The code in post #1 shuts off interrupts for the duration of...
  15. Replies
    47
    Views
    1,733

    A Quick Note: I was able to run the demo code...

    A Quick Note: I was able to run the demo code in post #45 on a Teensy 3.6 by reducing the buffer sizes a bit and setting the sampling rate to 240KSamples/second. The T3.6 uses the PDB delay block...
  16. Replies
    47
    Views
    1,733

    Trapped indoors by wildfire smoke in the...

    Trapped indoors by wildfire smoke in the Willamette valley, I decided to revisit this issue. I came to several conclusions:

    1. You can collect a single channel of ADC data at 1.000 MHz without...
  17. Replies
    27
    Views
    571

    One way to get a pulse at each change in a clock...

    One way to get a pulse at each change in a clock is to use an XOR circuit like the one shown below. You delay one of the inputs with an RC network to set the pulse width. As others have pointed...
  18. Replies
    27
    Views
    571

    While I appreciate the need for speed in some...

    While I appreciate the need for speed in some applications, it seems that you may be running up against hardware limits, both in pin drive and cpu instruction cycles.

    Where are you getting the...
  19. UhClem is correct. I looked in the SDFat 2.0b...

    UhClem is correct. I looked in the SDFat 2.0b code and interrupts are masked in only one place and that for about two instructions. That would not account for any sampling jitter.

    I think the...
  20. Replies
    7
    Views
    2,997

    You may also run into issues when you try to run...

    You may also run into issues when you try to run the SCK to multiple SPI devices. If the SCK (or any of the other signals) are connected directly from the Teensy to all the devices with only...
  21. Rather than RS-485, you might consider a pair of...

    Rather than RS-485, you might consider a pair of 915MHz transceivers. They should handle 200 feet unless one or both ends of the link are RF-shielded. You can probably find a pair of transceivers...
  22. LOL! According to the EPA the "Hazardous" air...

    LOL! According to the EPA the "Hazardous" air quality index ends at 500. There's even a link on the AirNow.gov web site about what to do when the index goes off scale above 500: ...
  23. The Honeywell HPMA115 sensor in my setup is...

    The Honeywell HPMA115 sensor in my setup is usually within 10% of the EPA sensor about a mile away. Unfortunately, the EPA sensors seem to go off line and return "ND" at very high concentrations. ...
  24. I think we've stepped into the twilight zone...

    I think we've stepped into the twilight zone here. While I've acquired and stored a lot of ADC data at high rates with the T4.1, it has never been with a 16-bit parallel interface. I've used the...
  25. I've had a Honeywell particulate sensor connected...

    I've had a Honeywell particulate sensor connected to a T3.5 data logger for a while now. I used the PM10 data to keep track of allergens--grass pollen is a real problem here in the Willamette valley...
  26. UPDATE 2: After a few interesting hours with...

    UPDATE 2:

    After a few interesting hours with the IMXRT1062 manual and the PWM.c source, I figured out that you can do the generation of the complementary outputs in the FlexPWM hardware with a bit...
  27. UPDATE: * If I pick pins 6 and 9, which are...

    UPDATE:

    * If I pick pins 6 and 9, which are on the same FlexPWM timer, the rising edges occur at the same time----and you lose the phase inversion.

    * If I mix up FlexPWM and QuadTimer pins,...
  28. The following code seems to work, according to my...

    The following code seems to work, according to my oscilloscope. It seems almost too simple to be real, so please test it carefully before running it on the robot you've spent the last 6 months of...
  29. You might meet that requirement with a...

    You might meet that requirement with a modification of the simple multi-channel PWM code I posted in the General discussion forum:
    https://forum.pjrc.com/threads/62857-Simple-multi-channel-PWM
    ...
  30. It's pretty simple to do the same thing with just...

    It's pretty simple to do the same thing with just one interval timer and about 50 lines for the PWM and another 50 for setup and generating the ramp up and down part. Since it doesn't involve any...
  31. Replies
    0
    Views
    141

    Simple multi-channel PWM

    In response to a thread discussing issues with the interval timer in the "Suggestions and Bug Reports" forum:
    ...
  32. I'll taka a look at your example. In the ...

    I'll taka a look at your example. In the meantime, it seems very risky to me to call timer.begin inside an interrupt handler for the timer. The begin() function messes about with the internal...
  33. My simple test program seems to confirm that...

    My simple test program seems to confirm that using mytimer.end(), mytimer.begin(newinterval) can cause a long interval between interrupts:

    Output results are intervals between timer interrupt...
  34. I wonder if calling mytimer.end(), then...

    I wonder if calling mytimer.end(), then mytimer.begin(newinterval) is not guaranteed to result in one longer interval between calls to the timer's interrupt handler. Will the sequence look like...
  35. I guess this all goes to show the advantages and...

    I guess this all goes to show the advantages and disadvantage of the "Always post complete source code" warning at the top of the forum. If you condense the source to something that doesn't...
  36. I added some port output pulses to show the...

    I added some port output pulses to show the timing of your receive program. They seem to show that the problem is not that Serial2.available() is not responding, but that the USB Serial output is...
  37. Your receive test program has a very fast loop...

    Your receive test program has a very fast loop with no delays. Could it be that your loop needs an occasional call to yield() or to a delay that will internally call yield? I don't have the...
  38. If read/write performance is an issue, you should...

    If read/write performance is an issue, you should be using Bill Greiman's SDFat 2.0b and the built-in SD card on the T3.6 or T4.1. I've found SDFat to be very stable and with MUCH higher...
  39. Replies
    50
    Views
    968

    I just notice that the code I posted last night...

    I just notice that the code I posted last night had " analogReadAveraging(4);", which would account for the slower data collection times.

    I'm also seeing about 49523 counts for my 2.5V source,...
  40. Replies
    50
    Views
    968

    I updated my test code with the following...

    I updated my test code with the following 'features':
    1. You can switch between simulated normally-distributed data with the 'a' key.
    2. The simulated data has a variable std deviation, which...
  41. Since the original photo showed a T3.2, perhaps...

    Since the original photo showed a T3.2, perhaps the user intended to use the ADC with the internal 1.2V reference. In that case, 0.6V is the midpoint of the ADC range.
  42. Replies
    50
    Views
    968

    If the errors are in the ADC, not in the input...

    If the errors are in the ADC, not in the input multiplexers, you could get better performance on the T3 by using two spare channels, one for a stable 2.5V reference and another for the same...
  43. Replies
    3
    Views
    233

    In my SD card startup routine, I have the...

    In my SD card startup routine, I have the following:

    if (!sdf.cardBegin(SD_CONFIG)) {
    Serial.println("cardBegin failed");
    }
    if (!sdf.volumeBegin()) {
    Serial.println("volumeBegin...
  44. Replies
    50
    Views
    968

    OOPS! I copied the code before I changed the...

    OOPS! I copied the code before I changed the data type for rawsamples from float to uint16_t. The following code should work, and I updated some of the histogram routines to make sure the max...
  45. Replies
    50
    Views
    968

    The difference between the mean and median...

    The difference between the mean and median algorithms gets worse when I collect from a voltage divider source consisting of two 50K resistors.


    Avg: 32719.75 P-P : 92.62 St.Dev: 13.380 ...
  46. Replies
    50
    Views
    968

    I updated the test code I posted yesterday based...

    I updated the test code I posted yesterday based on jonr's post. This version is set up to use the 16-bit setting on the T3.6 ADC, so no dithering is involved. Once again, I used a NIMH cell with...
  47. Replies
    50
    Views
    968

    When I look at the data I collected and consider...

    When I look at the data I collected and consider that the 12-bit samples are distributed between just two or three 12-bit values, it's no surprise that assumptions about a normal distribution are...
  48. I think I've been overthinking this...

    I think I've been overthinking this problem--partially because @waynegal didn't post enough code to show what will be done with the measured frequency.

    If the frequency is just to be used for a...
  49. Did you miss post #2? if (count = 0) {...

    Did you miss post #2?

    if (count = 0) {
    running[ant].Frq = 4000000;
    FreqCount.end();
    FreqCount.Begin();
    }


    if(count = 0) will allways evaluate to FALSE and the next three statements never...
  50. Replies
    50
    Views
    968

    I modified jonr's code and ran some tests. I...

    I modified jonr's code and ran some tests. I made the following changes: (Code at bottom)

    1. in the dithering, I switched random(-800, 800) to random(-800,801) as the second parameter to random...
Results 1 to 50 of 190
Page 1 of 4 1 2 3 4