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

# Search:

Type: Posts; User: Jp3141

Page 1 of 10 1

1. ## Thread: amplify signal to 10V

by Jp3141
Replies
15
Views
879

### You might have an oscillation. You'll never...

You might have an oscillation. You'll never observe an opamp's settling time with a multimeter -- it's in the us range at worst.
You don't really need the extra input resistor anyway; opamp input...
2. ## Thread: Teensy 4.1 ADC Accurecy

by Jp3141
Replies
9
Views
759

### Yes. The input signal is the resistance. You can...

Yes. The input signal is the resistance. You can power the sender from any voltage -- the 3.3 V supply on Teensy is convenient. In any automotive system, you need to protect against transients and...
3. ## Thread: LM324 op-amp output to Teensy 3.2 analog input reads 0.00. Meter shows 2.96v. Help?

by Jp3141
Replies
9
Views
734

### You don't really need an opamp. If you don't...

You don't really need an opamp.

If you don't need perfect accuracy, connect 2 resistors in series between the +3.3 V and -3.3 V line that you want to measure. Connect the junction to the ADC...
4. ## Thread: Timing a pulse train of microsecond events on a 15Hz period

by Jp3141
Replies
13
Views
761

### for this part - "Also, the 1/15Hz = 66,666 us....

for this part - "Also, the 1/15Hz = 66,666 us. (mark of the devil!) which is > 65,536." --could you have a timer for 1/30 Hz and then in the callback just skip every 2nd one ?
5. ## Thread: Teensy4 ADC pin switching speed

by Jp3141
Replies
6
Views
393

### Try this -- connect one input to VDD (3.3 V), and...

Try this -- connect one input to VDD (3.3 V), and the other to GND. Then run a small sketch that reads alternately between the two inputs -- see how slow you have to go to only (mostly) see codes...

by Jp3141
Replies
51
Views
2,654

### The reference for the ADC is the VDD (3.3 V)...

The reference for the ADC is the VDD (3.3 V) supply -- from a TLV75733P. This only has 1.5 % accuracy, about 200 uV p-p noise in the BW you are using, and probably a change of a few mV over the...
7. ## Thread: Confused with the recommended circuitry for ADC on teensy.

by Jp3141
Replies
13
Views
724

### Yes, that spike could be bad. Add 1k in series...

Yes, that spike could be bad. Add 1k in series with the input, or just in series with the 10 uF.

You don't need to use 1k & 220 Ω -- they make the cutoff frequency too high for audio (10 uF &...
8. ## Thread: Confused with the recommended circuitry for ADC on teensy.

by Jp3141
Replies
13
Views
724

### Be careful -- a very large DC offset on the input...

Be careful -- a very large DC offset on the input (say 5 V) could damage the Teensy when it is initially plugged in because the initial step as the 10 uF is charged will be driven straight into the...
9. ## Thread: 1 MSPS on a T4? Is this possible...

by Jp3141
Replies
57
Views
5,250

### I looked at interrupt-driven ADC conversions some...

I looked at interrupt-driven ADC conversions some more. Using this ISR:

FASTRUN void ADC_loop(void) {
10. ## Thread: 1 MSPS on a T4? Is this possible...

by Jp3141
Replies
57
Views
5,250

### At 8 bits, quantization errors possibly make...

At 8 bits, quantization errors possibly make STDEV analysis inaccurate -- you may have a DC input that falls well within an ADC conversion step, thus giving 0 STDEV (even with some noise on the...
11. ## Thread: 1 MSPS on a T4? Is this possible...

by Jp3141
Replies
57
Views
5,250

### @borgerson -- yes, it compiles; I don't think the...

@borgerson -- yes, it compiles; I don't think the variable sizes are the problem. What seems to be happening is that at > 10 bits resolution, I can't run 1 ADC at 1 MHz - I need 500 kHz for 12 bits,...
12. ## Thread: IntervalTimer interrupt priority

by Jp3141
Replies
9
Views
477

### Thanks all. It seems like ...

Thanks all. It seems like

NVIC_SET_PRIORITY(IRQ_PIT, 1);
and
myTimer.priority(1); // set high priority

have the same effect of raising the priority.

Furthe looking through my code, it...
13. ## Thread: 1 MSPS on a T4? Is this possible...

by Jp3141
Replies
57
Views
5,250

### @mborgerson, I can't get your 1st post to work on...

@mborgerson, I can't get your 1st post to work on a T4.1 (with a PSRAM also) at anything other than 8 bits. Am I missing something simple ?

I have tried changing these lines:

...
14. ## Thread: IntervalTimer interrupt priority

by Jp3141
Replies
9
Views
477

### But how can I find what other interrupts are...

But how can I find what other interrupts are using priority 0 and move them to (say) 8 ?
15. ## Thread: IntervalTimer interrupt priority

by Jp3141
Replies
9
Views
477

### But how do I do that specifically ? I don't know...

But how do I do that specifically ? I don't know the interrupt number.

I tried NVIC_SET_PRIORITY(IRQ_PIT, 1);?

and ...,0); -- that helps and reduces the jitter from 10's of us to about 1us. I...
16. ## Thread: IntervalTimer interrupt priority

by Jp3141
Replies
9
Views
477

### IntervalTimer interrupt priority

I have a simple demo on Teensy LC that generates an interval timer interrupt nominally each 10 ms and toggles a pin. However the interrupts (or pin toggling) don't come at precise intervals. Here is...
17. ## Thread: 5v power on USB and 5v PIN

by Jp3141
Replies
2
Views
378

### It probably won't damage anything -- the '5 V'...

It probably won't damage anything -- the '5 V' will rise to the highest of the USB voltage and the external supply. In the worst case, the USB power supply will current limit or shutdown (in some...
18. ## Thread: turning a collins Aerospace RMI-36 VOR/compass display into a clock

by Jp3141
Replies
22
Views
993

### Where did digitalToggleFast() come from ? I can't...

Where did digitalToggleFast() come from ? I can't even find it on Google. What other useful functions am I missing ?
19. ## Thread: turning a collins Aerospace RMI-36 VOR/compass display into a clock

by Jp3141
Replies
22
Views
993

### Given that it is driving a mechanical system, the...

Given that it is driving a mechanical system, the requirement to have the phase change smoothly by 'x' ns every single cycle isn't real -- it just requires that the average does this.

It still...
20. ## Thread: turning a collins Aerospace RMI-36 VOR/compass display into a clock

by Jp3141
Replies
22
Views
993

### There is only a single DAC output on the...

There is only a single DAC output on the Teensy's. But your VOR probably doesn't really need a sine wave -- likely a square wave will do, and you can generate those from PWM signals -- to get your...

by Jp3141
Replies
35
Views
1,914

### There has been some interest in this question. I...

There has been some interest in this question. I setup a test with a Teensy_LC where I supplied an external DC signal, and monitored it with both the Teensy and an Agilent 34410A DVM using USB for...

by Jp3141
Replies
5
Views
445

23. ## Thread: Self-print code for documentation ?

by Jp3141
Replies
9
Views
994

### My favourite tool :D For Windows users -...

My favourite tool :D

For Windows users - here's a copy of AWK: https://sourceforge.net/projects/ezwinports/files/gawk-5.1.0-w32-bin.zip/download
24. ## Thread: Self-print code for documentation ?

by Jp3141
Replies
9
Views
994

### I'm back on this again. I created a simple script...

I'm back on this again. I created a simple script that I run manually to generate a #include file. The script is:

awk 'BEGIN{print "Serial.println( F( \\"}{gsub("\"","\\\"");print "\"" \$0...
25. ## Thread: teensyduino -> USB Type: Keyboard + serial

by Jp3141
Replies
4
Views
1,370

### Can someone please post an example of how to do...

Can someone please post an example of how to do this ?

I'm confused over the number of endpoints I need; where the unique number is for each interface (is it 'PRODUCT_ID') ? Is DEVICE_CLASS...
26. ## Thread: Flexible Array in Arduino ?

by Jp3141
Replies
7
Views
1,251

### Thanks -- that works, but I agree it's quite...

Thanks -- that works, but I agree it's quite twisted; I'll wait until I am really out of memory.
27. ## Thread: Flexible Array in Arduino ?

by Jp3141
Replies
7
Views
1,251

### Thanks @JarkkoL -- that's closer to what I was...

Thanks @JarkkoL -- that's closer to what I was aiming for, but I was hoping (for clarity) to have it all on one line without having to invent new names for all the intermediate variables like...
28. ## Thread: Flexible Array in Arduino ?

by Jp3141
Replies
7
Views
1,251

### Flexible Array in Arduino ?

I am trying to initialize an array as part of a structure variable, but the compiler options in place on Arduino seem to require that the array size is predefined. Is there a way around this ?...
29. ## Thread: Measuring PWM current

by Jp3141
Replies
2
Views
1,415

### If you are just interested in the average...

If you are just interested in the average current, then most measurement systems will actually do this by default -- they don't (instantaneously) sample the signal and then digitize it. For instance,...
30. ## Thread: Self-print code for documentation ?

by Jp3141
Replies
9
Views
994

### I do that too, but with many computers of...

I do that too, but with many computers of different vintages and locations, it's not unique enough for me.

I'd like something like (I know this won't work) where the #include basically loads the...
31. ## Thread: Self-print code for documentation ?

by Jp3141
Replies
9
Views
994

### Self-print code for documentation ?

I suspect this is not possible, but is there a way (in the Arduino environment) to have a program print its own source code for documentation purposes ? I'd like to be able to do this as part of the...
32. ## Thread: Trying to make LEDs light up at random intervals

by Jp3141
Replies
4
Views
1,906

### what works really well is to run through the...

what works really well is to run through the array, and with a probability p, change it from off to on. If you want 10 % of the LEDs on (on average), then p is 0.1 etc. This keeps the whole set of...
33. ## Thread: Automotive power supply for Teensy

by Jp3141
Replies
7
Views
3,446

### 15 V might be a little too low for the TVS -- as...

15 V might be a little too low for the TVS -- as the battery goes bad (but not failed), the voltage could approach 15 V -- together with the TVS tolerance, it could cause some current to flow and it...
34. ## Thread: Multiple AnalogRead Pins Measuring the Same Wire

by Jp3141
Replies
3
Views
1,341

### You can't connect the 'A0 COM' connections...

You can't connect the 'A0 COM' connections together from the multiple rotary switches -- you won't be able to read the switches independently (or correctly). You can connect multiple Teensy analog...
35. ## Thread: FreqMeasure stops reporting values after a few seconds

by Jp3141
Replies
4
Views
1,857

### If you have problems with signal amplitude, you...

If you have problems with signal amplitude, you could use this. It uses the analog comparator in the Teensy and can detect 200 mV 10 MHz signals.

Put your signal on pin23, and connect the...
36. ## Thread: analogRead potentiometer jitter help

by Jp3141
Replies
3
Views
3,081

### 1) jitter: you can't easily remove this. If you...

1) jitter: you can't easily remove this. If you 'just' remove the last bit, you'll still have errors when the result crosses the next-to-last. For instance, say the numbers were 1..1000, and you had...
37. ## Thread: analogRead potentiometer jitter help

by Jp3141
Replies
3
Views
3,081

### You are asking too much. 1) The ADC can always...

You are asking too much.

1) The ADC can always have a jitter of +/- 1 count -- imagine the input voltage is just on the border between two conversion codes -- depending on noise etc, it might...
38. ## Thread: Teensy resolution - measuring low voltage

by Jp3141
Replies
3
Views
1,702

### 0.1 mV for a 100 mV signal requires 10 bit...

0.1 mV for a 100 mV signal requires 10 bit resolution (log2(100 mV/0.1 mV)) -- the ADC can do that (it has 16 bits. but realistically only ~ 13 are 'good'). With a 1.2 V reference, the LSB is 0.14...

by Jp3141
Replies
4
Views
1,753

### There is a sufficient amount of digital IO on T...

There is a sufficient amount of digital IO on T 3.2 etc. This IO is 5 V tolerant -- i.e. it survives 5 V being applied, but can only output 3.3 V. The ROM uses 5 V, but the datasheet indicates that...
40. ## Thread: Curious stuff about the Flex Timer Module in Teensy 3.x (3.1 at least)

by Jp3141
Replies
14
Views
5,920

### See my code in thread...

See my code in thread https://forum.pjrc.com/threads/30822-Teensy-3-1-and-Flextimer(s)-Counting-external-pulses-accurately -- checking for 24 h with 15 MHz on pin3 and 20 Hz on pin A2 shows no...
41. ## Thread: Teensy 3.1 and Flextimer(s) - Counting external pulses accurately

by Jp3141
Replies
7
Views
4,726

### I think I have this figured out. When the FTM...

I think I have this figured out. When the FTM overflows and an input capture occurs nearly simultaneously, it is difficult to know which occurred first, and therefore if the pre-overflow or post...
42. ## Thread: Curious stuff about the Flex Timer Module in Teensy 3.x (3.1 at least)

by Jp3141
Replies
14
Views
5,920

### Thanks @robsoles. I see what you are doing, but...

Thanks @robsoles. I see what you are doing, but that won't work for me -- I trigger a capture with the FTM Channel 0. I am leaning towards not generating an interrupt with a Channel 0 event, just...
43. ## Thread: Teensy 3.1 and Flextimer(s) - Counting external pulses accurately

by Jp3141
Replies
7
Views
4,726

### @TelepnoneBill -- I am trying to do nearly the...

@TelepnoneBill -- I am trying to do nearly the same thing, but I am not confident about the CH0 part. In your code, you can't guarantee that the CH0 event detect in the loop occurred before or after...
44. ## Thread: Curious stuff about the Flex Timer Module in Teensy 3.x (3.1 at least)

by Jp3141
Replies
14
Views
5,920

### @robsoles -- I am also puzzled about the...

@robsoles -- I am also puzzled about the FlexTimer. I am trying to build a 32-bit counter with it (10 MHz input on its clock, 1 Hz on channel 0). What I am stuck on is how to synchronize my overflow...
45. ## Thread: very simple sine generator algorithm

by Jp3141
Replies
3
Views
1,952

### Be careful if you run this loop for long...

Be careful if you run this loop for long durations -- because of roundoff error in the multiplication, the amplitude may not remain precisely constant. For some frequencies, it may grow to overflow...
46. ## Thread: Convert Teensy DAC Single Ended Output to Differential Output

by Jp3141
Replies
15
Views
5,473

### I re-read your original post. If you need two...

I re-read your original post. If you need two signals, each from -5 V to +5 V (so a differential of +/- 10 V), you will need two opamps. There are many ways to do this; here's one:

7252

Use 2...
47. ## Thread: Convert Teensy DAC Single Ended Output to Differential Output

by Jp3141
Replies
15
Views
5,473

### Since the DAC uses the same 3.3 V, you can use...

Since the DAC uses the same 3.3 V, you can use that for the reference also.

Resistor tolerances affect how precise your common-mode voltage needs to be. You can basically have two types of errors...
48. ## Thread: Convert Teensy DAC Single Ended Output to Differential Output

by Jp3141
Replies
15
Views
5,473

### You can split R1 into two resistors in series,...

You can split R1 into two resistors in series, each twice the original value. Connect one end to GND, the other end to 3.3 V, and the junction to the opamp's inverting input ('-').

Basically this...
49. ## Thread: POR and LVD on Teensy

by Jp3141
Replies
3
Views
1,344

### some ideas: Does this occur if the LEDs are...

some ideas:

Does this occur if the LEDs are already powered up and you just power the Teensy ?
If you don't have a Teensy connected to the LEDs, do they flash ?
To confirm that it's not your...
50. ## Thread: Max DMA Buffer Size ?

by Jp3141
Replies
4
Views
2,490

### Thanks. With 16 word loops, does this still pump...

Thanks. With 16 word loops, does this still pump data to the DAC at a uniform and constant rate, or does it go in bursts ?
Results 1 to 50 of 488
Page 1 of 10 1