Search results

  1. D

    USB Triple Serial as loopback modem / null modem

    Answering my own question with https://www.pjrc.com/store/teensy41.html#communication // Per https://forum.pjrc.com/threads/72519-USB-Triple-Serial-as-loopback-modem-null-modem // code modified from https://docs.arduino.cc/built-in-examples/communication/SerialPassthrough // Teensy4 USB Triple...
  2. D

    USB Triple Serial as loopback modem / null modem

    OSX makes it difficult (or expensive) to make ptys, and I was curious if the Teensy could act like a loopback modem / null modem. In the IDE I see that there is a Tools/USB Type/"Triple Serial" and in the code I see USB_TRIPLE_SERIAL and USB_DUAL_SERIAL ...
  3. D

    confuse in edit in " Usb_desc,h file "

    USB_TRIPLE_SERIAL CDC, CDC2, CDC3 = what in a sketch? I see that one could choose Tools/USB Type/"Triple Serial" in the IDE, but then what do you do in a sketch to refer to the three different serial ports? /* Teensyduino Core Library * http://www.pjrc.com/teensy/ * Copyright (c) 2017...
  4. D

    Marlin on Teensy 4.0 / 4.1

    Looks like there is support in mainstream Marlin for Teensy 4.0 and 4.1 at https://github.com/MarlinFirmware/Marlin/tree/2.0.x/Marlin/src/HAL/TEENSY40_41
  5. D

    Metal detectors & ground penetrating radar

    I haven't done it yet, but I really like the looks of the Pulse Injection metal detector circuit on https://www.lammertbies.nl/electronics/pi-metal-detector combined with the curve-fitting method on https://www.mathworks.com/matlabcentral/answers/386038-time-constant-of-exponential-decay using...
  6. D

    How can I generate an assembler listing when compiling Teensy LP.

    You can get a hint at where the Arduino/Teensyduino architecture-specific objdump program is by enabling "Show verbose output during:" "compilation" in Teensyduino preferences and inspecting the last command line of output where it calls the architecture-specific size program. For example, from...
  7. D

    Web site could use a few updates :)

    The referral to the Bounce documentation on https://www.pjrc.com/teensy/td_libs_Bounce.html to the https://playground.arduino.cc/Code/Bounce/ is a bit confusing because the playground.arduino.cc is frozen, and refers folks to the Bounce2 with maybe a redirect, which in turn deprecates the...
  8. D

    Teensy 4.1 Analog Noise

    The http://www.team221.com/robotopen/product.php?id=155 sensor is not a digital quadrature device, it uses magnetic sensors to produce an analog encoded absolute output.
  9. D

    Teensy 3.2 difference vs Uno: pinmode() detaches attachInterrupt()

    I saw that bit of code, but I think the difference is in the pinMode() code -- AVR's code twiddles 1-2 bits but ARM has more options and more bits to handle, and PJRC's code re-writes the register: .../Java/hardware/arduino/avr/cores/arduino/wiring_digital.c void pinMode(uint8_t pin, uint8_t...
  10. D

    T4.0 ISR Rising Edge Voltage Trigger Level?

    1/400Hz is 2.5ms, 2500us or 1500000 cycles on a 600MHz machine. You could do some software debouncing by ignoring too-fast changes: void REFRISE() { RPMPulse1 = micros() - RPMPulse2; if (RPMPulse1 >10 ){ // debounce for 10uS RPMPulse2 = micros(); RPM = 20000000 / RPMPulse1; }...
  11. D

    Teensy 3.2 difference vs Uno: pinmode() detaches attachInterrupt()

    I copied some tachometer code from https://www.homemade-circuits.com/tachometer-using-arduino/ which had an attachInterrupt() before setting the pinMode() and discovered that on the Teensy 3.2, different from the Uno, setting the pinMode after the attachInterrupt seems to detach the interrupt...
  12. D

    Problem using PIND on teensy 3.1

    Here's a table derived from .../Java/hardware/teensy/avr/cores/teensy3/core_pins.h with some cutting, pasting and sorting of the Teensy 3.1/3.2 defines (see "#if defined(__MK20DX128__) || defined(__MK20DX256__)" in the core_pins.h) that shows how to choose pins that correspond to bits in a...
  13. D

    Problem using PIND on teensy 3.1

    Maybe update the tutorial advice on https://www.pjrc.com/teensy/pins.html for the differences between different Teensy architectures? It currently focuses on PIND and the 21 pin Teensy. Is there something like these: digitalPinToPort(pin) digitalPinToBit(pin) digitalPinToBitMask(pin)...
  14. D

    using a rotary encoder

    CLK and DATA are normal names for encoder signals. If you read DATA on the rising edge of CLK, it tells you whether you turned one detent left or right. CLK and DATA match up exactly with a flip-flop, or other digital circuitry. High resolution readers like the encoder library can trigger or...
  15. D

    Encoder and interrupts

    Are you using an encoder with detents? The detents are often set at a particular point in the quadrature cycle, so if you disable interrupts and happen to only poll read() when the encoder is at detents, the state of the pins doesn't appear to change, and you won't get counts.
  16. D

    Encoder Library w/ ENCODER_DO_NOT_USE_INTERRUPTS to 2x or 1x count?

    I own a 1000 Line-Per-Revolution/ 1000 Pulse Per Revolution / 4000 A/B edges Per Revolution optical encoder that looks like it tops out around (100Kint/sec)/(4000int/rev)*60sec/min = 1500RPM if I hook to interrupt-capable pins on a 16MHz Uno or Teensy 2.0. I'd like to downgrade the resolution...
  17. D

    Barometer using Teensy2.0, BMP085 and LCD

    Hi All, I made a simple barometer for my son's Cub Scout belt loop: The code is on github at https://github.com/drf5n/BarometerLCD I really liked powering the sensor and LCD directly from the Teensy to do minimal extra wiring. Driving the LCD's contrast input with a PWM on DIO14 was fun...
  18. D

    Teensy3.0 with Txtzyme/Arduinozyme to bypass PWM fan control on a broken motherboard

    I used a Teensy 3.0 to save replacing a Sun Ultra 40 M2 375-3476 motherboard ($500 refurbished) when the fan speed controllers seemed to be shorted out. By cutting three the blue PWM control wires out of the Sun 371-0703 fan assembly and hooking them to pins 3,4,5 of a Teensy 3.0 loaded with...
  19. D

    Differenciating in udev rules a Teensy 2 from a Teensy 3?

    If you change the last rule of 49-teensy.rules to read: KERNEL=="ttyACM*", ATTRS{idVendor}=="16c0", ATTRS{idProduct}=="04[789]?", MODE:="0666" \ , SYMLINK+="cu.teensy.p$attr{idProduct} cu.teensy.s$attr{serial}" you'll get '/dev/cu.teensy.p0483' and '/dev/cu.teensy.s23140' -like...
  20. D

    Uisng ifdef to differentiate between teensy 2.0, teensy 2.0++, and teensy 3.0

    And for the Teensy 3.1 the compiler flag is -D__MK20DX256__ so for teensy 3.0 and 3.1 specific code you could wrap it in: #if defined(__MK20DX256__)|| defined(__MK20DX128__) ... #endif
  21. D

    Teensy loader for Raspberry Pi?

    https://www.pjrc.com/teensy/loader_cli.html has the sources files.
  22. D

    Teensy Command Line loader build on OSX 10.9 Mavericks

    This worked on mine: $ OS=MACOSX SDK=/Developer/SDKs/MacOSX10.6.sdk make cc -O2 -Wall -DUSE_APPLE_IOKIT -isysroot /Developer/SDKs/MacOSX10.6.sdk -o teensy_loader_cli teensy_loader_cli.c -Wl,-syslibroot,/Developer/SDKs/MacOSX10.6.sdk -framework IOKit -framework CoreFoundation $ and $...
  23. D

    Teensy 3 MicroSD guide

    I took the PJRC SD adaptor and put a 7-pin right-angle header on it with the two extra pins extending beyond MISO, I then connected the +5V to the pin adjacent to MISO and the pad next to the 'V' in '3V' to the other pin. I can use the same adapter with both 5V and 3V systems without...
  24. D

    Teensy 3.0 ADC details

    Some small details for the Teensy 3.0: The internal reference is 1.2V, can be read with analogRead(39). The internal reference may be chosen with analogReference(INTERNAL), analogReference(INTERNAL1V1), analogReference(INTERNAL1V2) or reset to external with analogReference(DEFAULT) or...
  25. D

    DHT11 & Teensy 2.0

    The library at http://playground.arduino.cc/main/DHT11Lib worked for me with a Teensy 3.0: #include <dht11.h> // from http://playground.arduino.cc/main/DHT11Lib dht11 dht; // Plug DHT11 in adjacent to pins 0-3 #define DHTPWR 0 // +5 or +3.3 #define DHTDATA 1 // Data (Worked w/o...
  26. D

    remote programming with openwrt

    On the older thread, Madox pointed to some hints that might help make the relatively unmaintained USBIP work without the BSOD.
  27. D

    USB/IP WiFi programming with openwrt

    I think Ian started the thread as http://forum.pjrc.com/threads/23741-remote-programming-with-openwrt but it looks like the issue might be that USB/IP cli connects a specific remote USB to a local USB on invocation, but perhaps USB/IP isn't re-connecting as needed.
  28. D

    Does Teensy have a processor ID?

    There seems be one in (SIM_UIDH,SIM_UIDMH, SIM_UIDML, SIM_UIDL). Note that this sketch sometimes seems to hang/or kill the USB serial on my teensy3 after powerup or reload after the '...'. I'm not sure why. With repeated closing-openings of the Serial monitor, sometimes it picks up and goes...
  29. D

    Does Teensy have a processor ID?

    @taskman: I seem to crash my teensy at the FTFL_FSTAT = FTFL_FSTAT_CCIF; line in the setup()->read() code below. If I comment out the initiation of the flash command in read(), it produces the full (but boring) output and loops, but if i leave it in, I only see a variable number of iterations...
  30. D

    Teens3 Makefile

    http://www.pjrc.com/teensy/loader_cli.html version 2.0 doesn't look like it supports Teensy 3.0 http://www.pjrc.com/teensy/beta/load_linux_only.c looks like it does Teensy 3.0, but linux-only. I think the teensy_loader_cli.c -r rebooter flag triggers a second properly-programmed teensy to...
  31. D

    How to set priority for systick?

    OT--SysTick documentation: I thought that since this SysTick stuff in doesn't seem to be in the MK20DX128 reference manual at http://www.pjrc.com/teensy/datasheets.html, folks might want to look at the SysTick documentation at...
  32. D

    Blink a led in x time

    Blend the ReadASCIIString example and the Blink example.
  33. D

    Understanding the make process

    Teensy 3.0 Makefile and "Hello world!" over USB in plain C I've been working on porting a c (non-c++) program to Teensy 3.0 and found this to work to get to a fairly plain hello world response: mkdir JUNK cd JUNK cp -a...
  34. D

    Understanding the make process

    The Makefile doesn't process .ino files into C or C++ files, so I think that all you are getting is a bare 0x4f4 byte file based solely on the mk20128dx.ld file. You are missing a main() routine and the rest of the "copy the resources from these # locations and edit the pathnames." I think you...
  35. D

    Uisng ifdef to differentiate between teensy 2.0, teensy 2.0++, and teensy 3.0

    Paul, Would it be good to add a -D__MK20DX128__ to in the CPPFLAGS in the Makefile to make it consistent with the Arduino compile? Or maybe in mk20dx128.h add a #define __MK20DX128__ or an #ifndef __MK20DX128__ #warning or #error for processors where it doesn't apply? It would be nice to...
  36. D

    AVR-like ISR()

    Thanks. That helps a lot. I'm sort of messing with porting some ISR()-using code, and I'm happy to not have to mess with it. Maybe pasting your message on http://www.pjrc.com/teensy/interrupts.html for Teensy 3.0 would be nice.
  37. D

    Uisng ifdef to differentiate between teensy 2.0, teensy 2.0++, and teensy 3.0

    CORE_TEENSY seems to be defined during Makefile compilations, but not during default Arduino compilations. I modified the above sketch to check for CORE_TEENSY. Edit: if I #include "WProgram.h" in a sketch, then CORE_TEENSY is defined during Arduino compilations as part of core_id.h, but...
  38. D

    Uisng ifdef to differentiate between teensy 2.0, teensy 2.0++, and teensy 3.0

    That works in Arduino, but it doesn't seem to get defined using the Makefile. With verbose Arduino compliation output, I see that it is set. And the command line option seems to be set on my Mac in...
  39. D

    Uisng ifdef to differentiate between teensy 2.0, teensy 2.0++, and teensy 3.0

    What's the best way to test for the chip/device being compiled & maybe provide for alternate code for programs on the the teensy 3.0? I saw some tests in https://github.com/triffid/Teacup_Firmware/blob/master/arduino.h Here are some ARM-related #defines from a teensy3 compile: f$...
  40. D

    AVR-like ISR()

    If I put that into main.cpp and try to compile it with a Makefile, I get warnings that the attributes are ignored: main.cpp:44:1: warning: 'signal' attribute directive ignored [-Wattributes] main.cpp:44:1: warning: '__INTR_ATTRS' attribute directive ignored [-Wattributes] If I compile your...
  41. D

    Teensy 3.0 and interrupts

    FTM and interrupts. I think the mk20dx128.c & mk20dx128.h files now have the appropriate lines to let you set up your own interrupts without modification . The only one that isn't predefined as a weak alias to 'unused_isr' is systick_isr, which is a a weak alias to systick_default_isr...
  42. D

    PITimer: PIT (Periodic Interrupt Timer) library for Teensy 3.0

    Non-periodic timing with FTM1 If one needed non-periodic interrupts, like for coordinated-axis stepper motor control as in https://github.com/triffid/Teacup_Firmware/blob/Gen7/timer.c#L85, would trying to use FTM1 (and sacrificing PWM on pins 2&3) be reasonable?
  43. D

    Using Differential ADC atmega32U or at90usb1286 (Teensy or Teensy++) w/Thermocouple

    Here's another differential ADC code for the Teensy and Teensy++: #define MUX_1V1 0b011110 // works for both #define ADMUX_MASK 0b11111 // MUX4..0 in ADMUX works for both #define ADSCRB_MUXMASK (1<MUX5) // MUX5 in #define AREF_VCC (1<<REFS0) #define AREF_2V56 ((1<<REFS0) | (1<<REFS1))...
  44. D

    Video Compression

    640x480*10fps at 8 bits/pixel = 3Mbyte/sec. To get it down to 2Mbit/sec, you'd have to compress it more than 12:1, so you'd have to do all your input, processing, compression, and transmission in less than 30 cycles/byte of raw input. I think you'll need a tinier, or much slower video feed.
  45. D

    Using Differential ADC atmega32U or at90usb1286 (Teensy or Teensy++) w/Thermocouple

    From the measurements above, it looks like my alligator-clip-breadboard circuit has about 8 counts of noise. At x200 gain and 2.56V AREF, 1 count is 2.56/512/200=25uV, so that's already sub-millivolt at <200uV. It would be interesting to see what is in the external circuit and what is internal...
  46. D

    Using Differential ADC atmega32U or at90usb1286 (Teensy or Teensy++) w/Thermocouple

    I've been fiddling with the x1 X10 and X200 gain differential ADC on the Teensy++ and hooked it up to a Type K thermocouple. Here's my code so far: /* SPICE-ish Connections: USBcable Teensy2.0++ Computer # direct connection to computer Vth A0 A1 # type K thermocouple, 41 uV/C */ //...
Back
Top