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. Replies
    27
    Views
    444

    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...
  2. Replies
    27
    Views
    444

    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...
  3. 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...
  4. Replies
    7
    Views
    2,965

    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...
  5. 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...
  6. 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: ...
  7. 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. ...
  8. 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...
  9. 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...
  10. 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...
  11. 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,...
  12. 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...
  13. 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
    ...
  14. 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...
  15. Replies
    0
    Views
    129

    Simple multi-channel PWM

    In response to a thread discussing issues with the interval timer in the "Suggestions and Bug Reports" forum:
    ...
  16. 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...
  17. 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...
  18. 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...
  19. 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...
  20. 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...
  21. 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...
  22. 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...
  23. Replies
    50
    Views
    784

    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,...
  24. Replies
    50
    Views
    784

    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...
  25. 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.
  26. Replies
    50
    Views
    784

    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...
  27. Replies
    3
    Views
    211

    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...
  28. Replies
    50
    Views
    784

    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...
  29. Replies
    50
    Views
    784

    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 ...
  30. Replies
    50
    Views
    784

    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...
  31. Replies
    50
    Views
    784

    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...
  32. 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...
  33. 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...
  34. Replies
    50
    Views
    784

    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...
  35. Replies
    50
    Views
    784

    I'll give that code a try. I do have a few...

    I'll give that code a try. I do have a few problems with the code as is and I may modify it:
    1. Since the code uses the standard Arduino analogRead() instead of the ADC object, I will have to do...
  36. Replies
    50
    Views
    784

    The reason I asked about what is connected to the...

    The reason I asked about what is connected to the ADC input:

    [OLDFART MODE]
    In my first job at an oceanographic instrument company my boss was a cranky old fart who taught me most of what I know...
  37. Replies
    50
    Views
    784

    Your oversampling by 32x will theoretically give...

    Your oversampling by 32x will theoretically give you an extra 2.5 bits of resolution. I think the Teensy rand() function produces pretty good white noise for the dithering. I've used rand() with...
  38. Replies
    50
    Views
    784

    How do you extend the resolution of 12-bit data? ...

    How do you extend the resolution of 12-bit data?

    If you multiply the data by 16, to get 16-bit data, you have a wider range between the min and max, but you've also multiplied the quantization...
  39. Replies
    50
    Views
    784

    It would be very simple and fast to find the mode...

    It would be very simple and fast to find the mode once you have sorted the data into the bins with binMedians()


    modeval = 0;
    maxbinval = 0;
    for(i=0; i<numbins; i++){ // find index of bin with...
  40. Replies
    50
    Views
    784

    A few more questions: Were your numbers for...

    A few more questions:

    Were your numbers for P-P on mean and median taken after you multiplied by 16 to make the data 16 bits? If so, your P-P figures of 9 and 38 counts should be divided by 16...
  41. Replies
    50
    Views
    784

    I'm not sure what your numbers mean. Mean and...

    I'm not sure what your numbers mean. Mean and median are single numbers and different from peak-to-peak. Is 9 the peak-to-peak value or the median? Did you calculate the mean and median from the...
  42. Can't send from Serial Plotter to Teensy

    At the bottom of the Serial Plotter on Arduino 1.8.13, there is a text entry box and a 'Send' button, as well as a widget to select line endings. In a recent program I added code to plot histogram...
  43. Replies
    50
    Views
    784

    Checking ADC noise

    During the thread on megasample collection with the T4X https://forum.pjrc.com/threads/60299-1-MSPS-on-a-T4-Is-this-possible we discussed various ways to evaluate noise and the best estimate of a...
  44. Replies
    43
    Views
    1,407

    The possibility of collecting the ADC data with...

    The possibility of collecting the ADC data with DMA is intriguing. I will have to look at that. The DMA approach also raises some questions:

    1. How can you save other than ADC data? (such as...
  45. Replies
    43
    Views
    1,407

    I suspect that your occasional error of 40nSec...

    I suspect that your occasional error of 40nSec occurs when your interrupt routine gets delayed by the SysTick interrupt. That interrupt occurs at priority 0, so you can't avoid it with elevation of...
  46. Replies
    43
    Views
    1,407

    I agree that quantization effects can render Std....

    I agree that quantization effects can render Std. Deviation less useful when quantization effects are likely. One good way to look at the data is to look at a histogram. I did that for slow 12-bit...
  47. Replies
    43
    Views
    1,407

    I ran some tests with a stable voltage source...

    I ran some tests with a stable voltage source (NIMH battery with 1K current limiting resistor and 10UF from ADC port to ground) and got the following results:



    ADC rate
    Bits
    Mean V
    Std....
  48. Replies
    43
    Views
    1,407

    @jonr:The most recently posted code does exactly...

    @jonr:The most recently posted code does exactly what you suggest in your last sentence. The interrupt used is the ADC end-of-conversion interrupt, not a timer interrupt. The interrupt that...
  49. Replies
    43
    Views
    1,407

    What do you mean by " Does it compile OK?...

    What do you mean by "


    Does it compile OK?
    Do you collect any data?
    Do you get unexpected data back?

    I recommend that you avoid data types like 'int'. An int can be 16 bits on some systems...
  50. Replies
    43
    Views
    1,407

    I was definitely looking at ADC counts. But...

    I was definitely looking at ADC counts. But isn't 1 count equal to 1 LSB?

    If the noise is coming from the fact that the ADC reference is the 3.3V rail, reducing the input impedance from the port...
Results 1 to 50 of 174
Page 1 of 4 1 2 3 4