Search results

  1. B

    Pulse width measurement using T4.1 qtimer

    Sorted - a whisker-joint hardware problem, also with the "compare to FFFFh" overflow fix I had to clear both TMR_CSCTRL_TCF1 and TMR_SCTRL_TCF interrupt flags.
  2. B

    Pulse width measurement using T4.1 qtimer

    Thanks for the tip re ERR050194 - I wasn't aware of that. (The SCTRL issue was a missed change as I did try to see if the system would work any better with the Ch 0 input used as secondary input for Ch1 - there's a reference in the manual for the PCS "NOTE: A timer selecting its own output...
  3. B

    Pulse width measurement using T4.1 qtimer

    I am trying to use a T4.1 to measure the pulse width produced by a TCS230 color light-frequency converter. I am trying to do this using QTIMER ch 1 in Capture mode, with primary source the internal clock and secondary source the sensor output, connected to QTIMER1_TIMER0 on pin 10 (ALT 1)...
  4. B

    Teensy 4.1 GPT compare output reset

    I have managed a "fix" - change the compare pin mode to "set on compare", force it with FO2/FO2, then change back to "clear on compare": void gpt2_isr() { uint32_t srtmp = GPT2_SR; // GPT2_SR &= 0x3F; // clear all set bits if (srtmp & GPT_SR_OF1) { GPT2_CR ^= (GPT_CR_OM2(0b011) |...
  5. B

    Teensy 4.1 GPT compare output reset

    I'm working on using a 4.1 to drive RC servo using PWM. For simplicity I would like to use GPT2, with COMPARE_1 resetting the count, and COMPARE_2 and COMPARE_3 giving me 2 channels of PWM. I have used manitou48's "gptisr3" as a starting point. I want to set OP2 and OP3 on the start of a...
  6. B

    Teensy 3.2 NVIC_ENABLE_IRQ not setting transmit interrupts

    I guess one of the things I need to come to grips with is that with the Teensy 3.2 etc there isn't quite the need to conserve memory and cycle time as there is with the chips I've been working with!
  7. B

    Teensy 3.2 NVIC_ENABLE_IRQ not setting transmit interrupts

    I have looked at the existing code and seen how it handles the registers. Because I'm dealing with messages that are only 6 bytes long, and am not using the read side of the serial port, I have no need for the circular buffers (at least with Serial1). I want to dump 6 bytes into the FIFO, do a...
  8. B

    Teensy 3.2 NVIC_ENABLE_IRQ not setting transmit interrupts

    Paul - before I reply I'd like to express my appreciation for the time and effort you put in to the Teensy system. As someone who has been working with computers for over 50 years, one of my motives for working on things like this is to come to grips with the "hows" and "why"s of what is done...
  9. B

    Teensy 3.2 NVIC_ENABLE_IRQ not setting transmit interrupts

    @Frank _B - If I change my interrupt routine, it brings me back to my original problem - and I don't hit the interrupt handler. #define IRQ_PRIORITY 64 boolean uartFlag; void setup() { Serial.begin(115200); Serial.println(" Teensy3.2_uart_int_tests_1811a");Serial.println("...
  10. B

    Teensy 3.2 NVIC_ENABLE_IRQ not setting transmit interrupts

    I've done a lot more playing with this and think I've sorted the original problem. I now need advice on the correct procedure to use tailor-made interrupt functions with the Teensy. I think what was happening with the original issue was that I had the UART0_S1_TC bit set when I activated the...
  11. B

    Teensy 3.2 NVIC_ENABLE_IRQ not setting transmit interrupts

    That's what I thought. So why does the value of UART0_C2 not remain as set? Since my original post, I've tried setting it after the NVIC_ENABLE_IRQ line and still get the same result - 0x3C as opposed to 0xC8.
  12. B

    Teensy 3.2 NVIC_ENABLE_IRQ not setting transmit interrupts

    I'm testing a routine to transmit a string of characters using standard 2400_8N2 serial format on UART0, then immediately convert the Tx pin to receive a PWM response. As part of this I want to use the TC interrupt to indicate that the stop bits for the last character have been sent. #define...
  13. B

    Reading UART registers causes my program to hang - why?

    Loaded SIM_SCGC4 with 0x1C00 and got access. Now to get the rest of it going ... I did go through serial1.c but hadn't clicked that it was referring to UART0. Knew it had to be something pretty basic. Thanks again.
  14. B

    Reading UART registers causes my program to hang - why?

    Thanks for the quick responses, guys - the immediate problem was solved by referencing UART0 for Serial1, and I'll look into the clock gate controls.
  15. B

    Reading UART registers causes my program to hang - why?

    I'm just starting with Teensys, so apologies if this is a rudimentary question. I'm trying to port an app from Arduino to Teensy 3.2 so I can use the extra resources. My app involves sending a 6-byte serial 2400 8N2 message to a remote module, then receiving a response which is in a PWM-type...
Back
Top