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

# Search:

Type: Posts; User: Nominal Animal

Page 1 of 5 1

1. ## Thread: How to Make a Pulse Train of Exactly N pulses?

by Nominal Animal
Replies
15
Views
402

### It's simpler than it seems. The English...

It's simpler than it seems. The English Wikipedia Noise shaping article contains a very good Operation chapter, describing the basic idea behind noise shaping.

Essentially, whenever you produce...
2. ## Thread: How to Make a Pulse Train of Exactly N pulses?

by Nominal Animal
Replies
15
Views
402

### Using SPI, you could also use DOUT (pin 7 or pin...

Using SPI, you could also use DOUT (pin 7 or pin 11) with a 16-bit write (0b0101010101010101 = 0x5555 = 21845, or 0b1010101010101010 = 0xAAAA = 43690), with the SPI clock double the desired...
3. ## Thread: What happens if a Teensy 4.1 is powered via Vin and USB ast the same time?

by Nominal Animal
Replies
4
Views
413

### You can always cut the VIN-VUSB trace at the...

You can always cut the VIN-VUSB trace at the back, and use two Schottky diodes with their cathodes connected to the VIN pin, one anode to VUSB pin, and one anode to your external power. That way...
4. ## Thread: FIR design (or, how was lopass_1000_44100.h calculated?)

by Nominal Animal
Replies
6
Views
495

### Sure. Why do we multiply by 32768? Because the...

Sure.

Why do we multiply by 32768? Because the function that applies the FIR filter is arm_fir_fast_q15(), and that uses Q15 fixed point format, which has a sign bit and 15 fractional bits.
The...
5. ## Thread: Don't blow your Teensy 4.1 Ethernet PHY when using passive PoE

by Nominal Animal
Replies
16
Views
1,731

### I haven't seen any magjacks that'd expose the...

I haven't seen any magjacks that'd expose the RJ45 side pins for TVS use (LC03-3.3BTG).

If you look at say Abracon ARJM11 104 model RJ45 with magnetics – noting that compared to TI tidues1a...
6. ## Thread: Analog voltage when teensy power off

by Nominal Animal
Replies
5
Views
381

### I'd use a 74LCV1T45...

I'd use a 74LCV1T45 in say SOT-23 (TI SN74LVC1T45DBV*) for this, with pin 1 (VCCA) connected to Teensy 3.3V, pins 2 (GND) and 5 (DIR) to ground, pin 3 (A) to Teensy input pin, pin 4 (B) to LBO, and...
7. ## Thread: FIR design (or, how was lopass_1000_44100.h calculated?)

by Nominal Animal
Replies
6
Views
495

### I have no idea which tool Paul Stoffregen used,...

I have no idea which tool Paul Stoffregen used, but the sources include screen captures.

The FIR filter coefficients are in signed fixed-point 16-bit format. The actual coefficient values are 21...
8. ## Thread: Buydisplay 7" RA8875 ft5206 800 x 480 display jumper re-configuration

by Nominal Animal
Replies
5
Views
781

### You're welcome! And sorry, I didn't realize...

You're welcome!

And sorry, I didn't realize you only needed to know the resistor sizes. Me fail English...

Another option is to contact BuyDisplay/EastRising at...
9. ## Thread: Buydisplay 7" RA8875 ft5206 800 x 480 display jumper re-configuration

by Nominal Animal
Replies
5
Views
781

### You'll want the 4-wire serial mode (easier SPI...

You'll want the 4-wire serial mode (easier SPI mode, with Chip Select (CS), Data (MOSI/DO), Clock (CLK), and the fourth pin is a generic I/O pin that determines Command/Data mode), right?

For...
10. ## Thread: Buydisplay 7" RA8875 ft5206 800 x 480 display jumper re-configuration

by Nominal Animal
Replies
5
Views
781

EastRising/BuyDisplay has a LOT of different modules, so it is very important to be precise about which product you're talking about.
11. ## Thread: Max File Size Readable by Teensy 4.1 Built-In SD

by Nominal Animal
Replies
6
Views
1,161

### The original FAT filesystem only supports file...

The original FAT filesystem only supports file names with at most 8 characters, followed by a dot, followed by at most 3 characters.

The way Windows added support for longer file names is via...

by Nominal Animal
Replies
37
Views
4,375

### Thanks, vjmuzik! I know exactly why that...

Thanks, vjmuzik! I know exactly why that happens. Indeed, it is very similar to what happens on Firefox; just with a much more noticeable delay.

I think I'll have to do a test page with sixty or...

by Nominal Animal
Replies
37
Views
4,375

### Yup, no worries; I can definitely understand why...

Yup, no worries; I can definitely understand why the IT folks said that. (I used to be one. I don't use Chrome either, and have a completely fake/dedicated email address to use with Google stuff –...

by Nominal Animal
Replies
37
Views
4,375

### Thanks a lot, Mark! I think replacing the bullet...

Thanks a lot, Mark! I think replacing the bullet character with a small image would help with that cursor issue. You don't happen to use Chrome, do you? (Although that version of Edge already uses...

by Nominal Animal
Replies
37
Views
4,375

### I have played with various ways to implement the...

I have played with various ways to implement the interactive pinout card on a self-contained web page, but most approaches feel too clunky for me; that's why the long delay. However, I finally found...

by Nominal Animal
Replies
42
Views
3,223

### I'm just glad to be of help. I've got another...

I'm just glad to be of help. I've got another project going on – Teensy 4.0 and 4.1 interactive pinouts in a browser – so I'll concentrate on that for now. If you'd like me to try and find the bug...

by Nominal Animal
Replies
42
Views
3,223

### As far as I can tell, we hit the kernel bug when...

As far as I can tell, we hit the kernel bug when Teensy resets, and there is still data begin sent to the Teensy. If we could ensure the reset packet is the last one we try to send, immediately...

by Nominal Animal
Replies
42
Views
3,223

### It's the same kernel use-after-free bug. When...

It's the same kernel use-after-free bug. When the Teensy resets, some of the URB sent from the host to the Teensy need to be canceled. (acm_kill_urbs() in the oops, in this case.)

by Nominal Animal
Replies
42
Views
3,223

### To me, it looks like an actual Linux kernel bug,...

To me, it looks like an actual Linux kernel bug, that occurs when an USB URB is canceled (because the device reset or vanishes).

There is a relatively recent possibly related bug report on the...
20. ## Thread: Teensy 4.0 Joystick with 40+ buttons

by Nominal Animal
Replies
4
Views
798

### If you are referring to the 32-button limit per...

If you are referring to the 32-button limit per USB Joystick, I recommend making your Teensy an USB Keyboard + Joystick pair, with the extra buttons producing standard keypresses.

by Nominal Animal
Replies
4
Views
694

### The effects in instruction timing (for Cortex-M4,...

The effects in instruction timing (for Cortex-M4, PDF) you are seeing is a result of pipelining instructions within the Cortex-M4 core itself; i.e., at the lowest hardware level in the...
22. ## Thread: Exponential Moving Average - How does it work?

by Nominal Animal
Replies
41
Views
3,932

### (I haven't found any, and can't even find...

(I haven't found any, and can't even find instruction timings for ARMv7 or FPv5 used on the i.MX RT1062 on Teensy 4.0 and 4.1.
As far as I know, one would have to microbenchmark the various...
23. ## Thread: Exponential Moving Average - How does it work?

by Nominal Animal
Replies
41
Views
3,932

### Floats (Binary32) have 23 bits of precision, but...

Floats (Binary32) have 23 bits of precision, but a 254-bit range.
32-bit integers have 32 bits of precision and a 32-bit range, of course.
If the absolute maximum signal range is known, then 32-bit...
24. ## Thread: Exponential Moving Average - How does it work?

by Nominal Animal
Replies
41
Views
3,932

### For that particular case, yes. On 32-bit...

For that particular case, yes.

On 32-bit microcontroller, it makes sense to use the 32-bit filter implementation only.
On 8-bit microcontrollers, it makes sense to use the 16-bit filter if it...
25. ## Thread: Exponential Moving Average - How does it work?

by Nominal Animal
Replies
41
Views
3,932

### In C (as opposed to C++), one can use the...

In C (as opposed to C++), one can use the following pattern. First, filter16.h:

#if !defined(FILTER_NAME)
#error Define FILTER_NAME as the name of the filter.
#elif...
26. ## Thread: Exponential Moving Average - How does it work?

by Nominal Animal
Replies
41
Views
3,932

### Note: It looks like the state has to be an...

Note: It looks like the state has to be an exact-width type (so uintN_t and not uint_fastN_t), as any extra bits will mess up the modulo arithmetic.

The 16-bit state is intended for input samples...
27. ## Thread: Exponential Moving Average - How does it work?

by Nominal Animal
Replies
41
Views
3,932

### Do ignore my post #7: when I wrote that, I was...

Do ignore my post #7: when I wrote that, I was obviously confusing a sliding window filter with the exponential moving average. (I'd edit it to correct it, but the grace period is over.)

I...
28. ## Thread: Exponential Moving Average - How does it work?

by Nominal Animal
Replies
41
Views
3,932

### Here's a simple Python3 test bench anyone can...

Here's a simple Python3 test bench anyone can experiment with:

from random import Random
from math import sin, pi

class Source:
__slots__ = ('prng', 'phase')

def __init__(self,...
29. ## Thread: Exponential Moving Average - How does it work?

by Nominal Animal
Replies
41
Views
3,932

### Perhaps that was your intention, but fact is, the...

Perhaps that was your intention, but fact is, the C++ implementation includes the rounding operation.

Code to implement the above is different: you need to calculate average in fixed point as...
30. ## Thread: Exponential Moving Average - How does it work?

by Nominal Animal
Replies
41
Views
3,932

### Eh, what? I was describing a mathematical...

Eh, what? I was describing a mathematical formula, not suggesting code.

There is an important distinction here, by the way.

The often used mathematical form

state = (1 -...
31. ## Thread: Exponential Moving Average - How does it work?

by Nominal Animal
Replies
41
Views
3,932

### Exponential decay filtering,         average =...

Exponential decay filtering,
average = C·sample + (1-C)·average
(where C is a real coefficient smaller than 1) is different to exponential moving average.

Their main difference is that...
32. ## Thread: Exponential Moving Average - How does it work?

by Nominal Animal
Replies
41
Views
3,932

### No, OP's code is not right. A correct...

No, OP's code is not right. A correct implementation would be

constexpr int_fast16_t fractional_bits = 2;

{
...
33. ## Thread: which part of this switch/case function determines each cases run-length?

by Nominal Animal
Replies
6
Views
623

### It is a common programming pattern for "animator"...

It is a common programming pattern for "animator" functions to take a number as a parameter, describing the progress along the animation.

However, looking at the code, neither drawRunAnim() nor...

by Nominal Animal
Replies
37
Views
4,375

### Those are literally the same images;...

Those are literally the same images; teensy41-sides.html links to the ones hosted here.

True. I was thinking of the case when considering a pin on one side, and having to connect it from the...

by Nominal Animal
Replies
37
Views
4,375

### OK! The first test is at...

OK! The first test is at https://nominal-animal.net/teensy41/teensy41-pins.html, and the turning test at https://nominal-animal.net/teensy41/teensy41-sides.html.

To repeat, the idea is that while...

by Nominal Animal
Replies
37
Views
4,375

### Here's what I meant: 21007 saved as...

Here's what I meant: 21007 saved as teensy-sides.html .
(I realized I could make the SVG canvas a standard size, and reference the pin locations to that, then scale and rotate the JPEG images to...

by Nominal Animal
Replies
37
Views
4,375

### I mean, if I add a button that changes the side...

I mean, if I add a button that changes the side of the board shown –– and yes, pin positions will change, and effectively left and right side labels etc. swap places –– the image jumps, because the...

by Nominal Animal
Replies
37
Views
4,375

### I know, defragster; the issue is that it is...

I know, defragster; the issue is that it is slightly different size to the back one, so swapping them in place creates a jarring "jump" effect.
I'd like big enough pictures I could rotate and scale...
39. ## Thread: which part of this switch/case function determines each cases run-length?

by Nominal Animal
Replies
6
Views
623

### If draw_state is some unsigned integer type, then...

If draw_state is some unsigned integer type, then (draw_state >> 3) == (draw_state / 8), and ((draw_state & 7) == (draw_state % 8)) (modulo, i.e. remainder if divided by 8).

draw_state │...

by Nominal Animal
Replies
37
Views
4,375

### Does anyone have higher-resolution front and back...

Does anyone have higher-resolution front and back images of Teensy 4.1? I don't have one (yet), so I can't take my own pics either.
I'd like to crop/rotate/scale them so that they match, and make...

by Nominal Animal
Replies
37
Views
4,375

### I was too lazy to add more than the GND and SPI1...

I was too lazy to add more than the GND and SPI1 pins, but at least you can see how this would work.
I rotated https://forum.pjrc.com/teensy41_2.jpg, cropped it, and saved as a 199×704 pixel JPEG...

by Nominal Animal
Replies
37
Views
4,375

### You know, I'd be happy to try and whip up an...

You know, I'd be happy to try and whip up an example interactive page (client-side/browser only, will work fine even if saved as a local file) to show the different options, with tooltips/rollovers...
43. ## Thread: Teensy 4.0 strange "resets/reboots" driving a Pololu DRV8825

by Nominal Animal
Replies
15
Views
1,408

### Unfortunately, like I already mentioned most of...

Unfortunately, like I already mentioned most of the motor controller drivers (including DRV8825) and even CNC/3D printer boards like SmoothieBoard use a common ground for motors and logic.

The...
44. ## Thread: Poll: Binary floating point txfr from t3.5, 4.x to host?

by Nominal Animal
Replies
5
Views
664

### There is no issue, as long as you explicitly...

There is no issue, as long as you explicitly specify which byte order you use in the transfers.

On some host hardware architectures, accessing an unaligned float may not work, and byte order...
45. ## Thread: Teensy 4.0 strange "resets/reboots" driving a Pololu DRV8825

by Nominal Animal
Replies
15
Views
1,408

### Ground potential difference (and thus a ground...

Ground potential difference (and thus a ground loop) is a likely culprit.

A simple fix is to get yourself a cheap ADuM3160-based USB isolator between Teensy and the host computer. It will limit...
46. ## Thread: Teensy 4.1 Random Number Generator

by Nominal Animal
Replies
14
Views
2,687

### I mean 3 distinct APIs. Whether you want it all...

I mean 3 distinct APIs. Whether you want it all in one library, or split the crypto hash to a separate one, I do not know.

With a tested ISAAC-based PRNG, I'd be happy with a single one.

The...
47. ## Thread: Which direction to put the diodes in a matrix?

by Nominal Animal
Replies
5
Views
675

### (I am not ashamed to admit that I use K to remind...

(I am not ashamed to admit that I use K to remind me which side is the cathode, and A to remind me which side is the anode, in a diode or a LED.)

(I haven't found a good one for polarity yet. The...
48. ## Thread: Teensy 4.1 Random Number Generator

by Nominal Animal
Replies
14
Views
2,687

### For non-cryptographic work, I recommend using one...

For non-cryptographic work, I recommend using one of the Xorshift variants; many of them are as random as Mersenne Twister, but much faster. In fact, my preferred one, using only the 32 high bits of...
49. ## Thread: Serial Communication Problems Teensy 4.0

by Nominal Animal
Replies
19
Views
2,104

### My ping-pong...

My ping-pong test shows that Teensy 4.0 has issues at high-bandwidth 1024-byte messages, but it does not tell us where the problem is.

When you suggested testing transfers in just one direction...
50. ## Thread: Serial Communication Problems Teensy 4.0

by Nominal Animal
Replies
19
Views
2,104

### No worries! Anyway, here is the Teensyduino...

No worries! Anyway, here is the Teensyduino sketch for Teensy 4.0 with USB Serial: