Search results

  1. E

    WDT_T4 - Watchdog Library for Teensy 4

    middle_hook seems to be used (error message when trying to use it). early_hook (only using registers in Flashmem) did not work reliable at least at short times. Deactivating WDT3 in Callback works great.
  2. E

    WDT_T4 - Watchdog Library for Teensy 4

    ChatGPT told me after some discussion to wait before writing to the registers. So I added in the Callback: WDOG3_CNT = 0xD928C520; // Unlock while (!(WDOG3_CS & WDOG_CS_ULK)) { // Warten bis entsperrt } WDOG3_CS &= ~WDOG_CS_EN; WDOG3_TOVAL = 0xFFFF; WDG3 can run well below 1 ms...
  3. E

    WDT_T4 - Watchdog Library for Teensy 4

    I need a watchdog with a very short timeout of only a few milliseconds. Therefore, I'm using WDOG3, since it supports an appropriately low timeout (the comment in the example appears to be incorrect—the timeout values are actually given in milliseconds). Because the watchdog remains enabled...
  4. E

    Teensy 4.1 with MCP4725 DAC

    Thanks for the code. Use the I2C-scanner to find out the address. Mine was 0x60. Wire.h allows to change the I2C speed, which did not work with the drivers from the example.
  5. E

    Is there an async/non blocking I2C lib for Teensy 4.1?

    To answer my own question: Yes, teensy4_i2c works and can perform async transfers. The following code reads data from an AS5600 every 75 µs, which is twice the internal rate and is not blocking for the time of transfer. A check if new data is available could be done by if...
  6. E

    Is there an async/non blocking I2C lib for Teensy 4.1?

    I found this topic from 2021 and there were no suggestions. I found old discussions to the topic, too, but nothing new and it doesn't seem to be implemented in Teensduino yet. A simple RequestFrom with only two bytes at 1 MHz takes about 25 µs, which is long on a 600 MHz processor. Is it so...
  7. E

    Teensy 4 option for 100 kohm or 47 kohm pull-up setting instead of 22 kohm default

    Adding all available Pullup resistors to Teensduino As I needed other values as pullup resistors, I added in core_pins.h: (directory: ...\AppData\Local\Arduino15\packages\teensy\hardware\avr\1.58.1\cores\teensy4) #define INPUT_PULLUP47k 6 #define INPUT_PULLUP100k 7 and in digital.c at...
  8. E

    Teensy 4.x H/W Quadrature Encoder Library

    I want to use the QuadEncoder + Interrupts on PinA and PinB. It seems that switsching the Pins (2 and 3) with the XBAR to the encoder disabled the interrupts and vice versa, attaching interrupts to the Pins, disables the QuadEncoder. The later blocks the former. Any idea to habe Filtering of...
  9. E

    Large SPI Transfers on Teensy

    Thanks for the great information. I am looking for one more feature: SPI on the Teensy has SPI.transfer with the eventResponder and SPI.transfer32 (without event). Is there a simple way to combine 32 Bit transfer and enabling the event_Responder? Best regards
  10. E

    Using XBAR_INOUT for input and output at the same time

    Thanks for this hint. Works nice! :) CCM_CCGR2 |= CCM_CCGR2_XBAR1(CCM_CCGR_ON); //turn clock on for xbara1 //CCM_CCGR3 |= CCM_CCGR3_AOI1(CCM_CCGR_ON); xbar_connect( XBARA1_IN_AOI1_OUT0, XBARA1_IN_IOMUX_XBAR_INOUT06); //This connects XBAR1_AOI1 to XBAR1_OUT6...
  11. E

    Using XBAR_INOUT for input and output at the same time

    Actually, one pin as input and output would work, but this is not what I want to do. My problem is that I want to use one signal (not actually at a PIN, but somewhere inside the processor) for several outputs. I hoped to use LOGIC_LOW, LOGIC_HIGH for one input of XBAR and use the output of this...
  12. E

    Using XBAR_INOUT for input and output at the same time

    Hi, in order to synchronize resets I wanted to use one XBAR_InOut for several signals and put the state with LOGIC_LOW, LOGIC_HIGH for one XBAR_InOut, which is than routed to all the other signals. But it seems that I have to choose if I use any InOut as input or output, but not both at the...
  13. E

    Large SPI Transfers on Teensy

    -> KurtE This is realy great stuff! Thanks for the post Edmund
  14. E

    SPI on Teensy 4.0

    As the ISP program compiled without errors on a different computer, I made a complete new installation and it works.
  15. E

    SPI on Teensy 4.0

    I try to use SPI on Teensy 4.0. I installed the library SPI-master from github, but I get error messages when compiling: C:\Users\Koch\AppData\Local\Temp\arduino_build_47759\sketch\SPI_Test.ino.cpp.o: In function `setup': C:\Users\Koch\Documents\Arduino\Teensy\SPI_Test/SPI_Test.ino:31...
  16. E

    PWM Interrupt on Teensy 4.0

    Thanks Paul, FLEXPWM2_SM0STS |= FLEXPWM_SMSTS_RF; // Clear Reload was missing in the IE-Routine. Clearing is done by writing a 1 to the bit, a little strange but explained on page 3100 in the Processor Reference Manual.
  17. E

    PWM Interrupt on Teensy 4.0

    I wanted to trigger an interrupt each time the PWM is reloaded. Therefore, I added the interrupt routine void TIMER() { ie++; asm("dsb"); } and the following lines at the end of setup: attachInterruptVector(IRQ_FLEXPWM2_0, TIMER); NVIC_ENABLE_IRQ(IRQ_FLEXPWM2_0); FLEXPWM2_SM0INTEN...
  18. E

    Teensy 4 synchronize ADC sampling with flexPWM timing

    Wonderful job. That saved me probably days of looking at the different registers. Routing the trigger and setting up the trigger to the ADC needs some steps, but allows many, many options. Some small corrections: The output for the PWM-signal is not configured. The PWM ratio is 100%, so no...
Back
Top