Search results

  1. D

    Should SIM_SCGC7_DMA be changed to 0x00000002?

    Yeah, it's enabled by default. Have a look at the reset line for field 1 in section 12.2.11 of the manual. At reset that field is set to 1 ("Clock enabled").
  2. D

    Problem with "multitasking". Only works for the first 32 seconds [Arduino IDE]

    My guess would be that temperatureMillis and switchPinMillis overflows. Try declaring them as unsigned long. That is also what millis() returns. Then it will overflow after approximately 50 days :) unsigned long temperatureMillis = 0; unsigned long switchPinMillis = 0; (Haha, what mlu said)
  3. D

    Teensy 3.1 port->pin mapping

    http://forum.pjrc.com/threads/24634-Teensy-3-1-amp-Teensyduino-1-17-Released?p=38379&viewfull=1#post38379
  4. D

    Teensy 3.1 & Teensyduino 1.17 Released

    This is fantastic, congratulations! It's very nice to see the upgrade to two ADC:s. I noticed there is still only 1 PDB timer. Is it only one of the ADC:s which get hardware triggering or will you be able to control both ADC:s from that one timer?
  5. D

    Read RC Reciever with Teensy 3

    If you want to read the pulse width of the PWM signal you could use the function pulseIn. char pin = 2; void setup() { Serial.begin(9600); while (!Serial); pinMode(pin, INPUT); } void loop() { Serial.println(pulseIn(pin, HIGH)); Serial.println(pulseIn(pin, LOW)); delay(500); }...
  6. D

    Should SIM_SCGC7_DMA be changed to 0x00000002?

    I have a question about SIM_SCGC7_DMA defined in mk20dx128.h Section 12.2.11 of the manual says the DMA Clock Gate Control is set in bit number two of the SIM_SCGC7 register. Currently SIM_SCGC7_DMA is defined as 0x00000020. I wonder if that is a mistake and if it shouldn't be changed to...
  7. D

    teensy 3.0 memory to memory DMA -- help

    Never mind, it's working now! (See http://forum.pjrc.com/threads/24611-Problem-with-DMA-interrupt)
  8. D

    Problem with DMA interrupt

    Thank you duff! That works great! My mistake was overwriting the whole control and status register, where the interrupt setting lives. To keep any other bits intact as well it might be even better to change the line to DMA_TCD1_CSR |= DMA_TCD_CSR_START;
  9. D

    teensy 3.0 memory to memory DMA -- help

    Hi! I'm struggling to get the interrupts to work when starting the channel from software. You don't have some code to share showing how you configured your DMA?
  10. D

    Problem with DMA interrupt

    I have still not figured out how to get the interrupt to trigger, but now I am using a synchronous workaround. You can wait for the DONE bit of the channel to get set and then you know the transfer is complete. // Start transfer DMA_TCD1_CSR = DMA_TCD_CSR_START; // Then wait while...
  11. D

    Problem with DMA interrupt

    Hi! I would like to use the direct memory access (DMA) controller to transfer some values between two arrays and then run a interrupt on end-of-major loop. The data copying works fine but I can't get the interrupt to run. Below is an example sketch to demonstrate my problem. The B buffer fills...
  12. D

    Using the PDB on Teensy 3

    A quick update and a question I've now gotten the DMA to work together with the ADC and PDB! The DMA code is essentially the same Paul shared, but I will post it below in case anyone finds it useful. Currently the PDB triggers the ADC every second. Once a conversion is finished the ADC requests...
  13. D

    Using the PDB on Teensy 3

    Thank you for sharing! Your code was very helpful. Now I got it to work! My mistake was writing the TOS and EN settings to the PDB_CH0C1 register in the wrong way. Wrong: PDB0_CH0C1 = 1 | 2; Correct: PDB0_CH0C1 = 0x0101; I was actually going to dive in to the DMA chapter in the manual next...
  14. D

    Using the PDB on Teensy 3

    So, the interrupts are working great but now I would like to actually trigger the ADC with the PDB timer. Controlling the ADC and its interrupt separately works fine. The trouble I'm having is hooking it up to the PDB. I've enabled the hardware trigger mode of the ADC (ADC_SC2_ADTRG) and...
  15. D

    Using the PDB on Teensy 3

    Thanks for the tip! I now have a PDB blink example going :) The NVIC_ENABLE_IRQ(IRQ_PDB); is certainly needed, but apart from that I'm not quite sure what makes my previous code fail. The LED turns on if I remove PDB0_SC |= PDB_SC_LDOK; (and PDB0_MOD = 9600; since it does nothing in that case I...
  16. D

    Using the PDB on Teensy 3

    I've also tried using NVIC_ENABLE_IRQ(IRQ_PDB); but with no luck.
  17. D

    Using the PDB on Teensy 3

    Hi, I have plans to use the PDB (Programmable Delay Block) on my Teensy 3 for some sound sampling, but I'm having trouble getting it to work. As I understand it you can trigger the PDB from software and have it run an interrupt service routine. This is what I set out to do as a first test...
  18. D

    ADC on Teensy3 compared to Arduino Due

    I finally got my Teensy this week! I made some simple tests of the ADC read speed (average over 100 reads): CPU-speed (MHz) 48 48 48 48 48 48 96 96 96 96 96 96 analogReadResolution 16 10 8 16 10 8 16 10 8...
  19. D

    ADC on Teensy3 compared to Arduino Due

    Thanks for the reply! I just ordered a Teensy to give it a go! I might post some results here after I get it. Does the analogReadResolution(16); affect the speed? If lower resolution is not an issue this could be reduced right? What are the accepted values? I'll definitely look in to...
  20. D

    ADC on Teensy3 compared to Arduino Due

    Hi! I'm working on a project where I need to sample audio on 5 channels. The resolution is not of great concern but I'd like to sample as fast as possible. I aim for 40 kHz per channel but faster is better. I found a really through post evaluating, among other things, the speed of the Arduino...
Back
Top