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

Search:

Type: Posts; User: gfvalvo

Page 1 of 7 1 2 3 4

Search: Search took 0.01 seconds.

  1. Replies
    2
    Views
    86

    If the duty cycle is fixed at 50%, how is it PWM...

    If the duty cycle is fixed at 50%, how is it PWM (Pulse Width Modulation)?
  2. Thread: DMA llibrary

    by gfvalvo
    Replies
    1
    Views
    81

    Have you looked at the DMAChannel class that...

    Have you looked at the DMAChannel class that comes with the Teensy core?
  3. Replies
    14
    Views
    332

    I'm currently driving APA102 LEDs programmaticly...

    I'm currently driving APA102 LEDs programmaticly with 24 MHz SPI (fastest possible on T3.2) -- no issues. The advantage of DMA is being able to update a buffer with the next display (ping-pong style)...
  4. Replies
    14
    Views
    332

    I’ll probably try to link 2 DMA channels to do...

    I’ll probably try to link 2 DMA channels to do the SPI TX part.

    The first channel will trigger from the SPI TX FIFO Not Full (TFFF) and will do a 16-bit transfer from the next buffer location to...
  5. Replies
    14
    Views
    332

    Well, I think I have an explanation for the noted...

    Well, I think I have an explanation for the noted behavior - at least a “Handwaving” one. It appears to me that the upper 16 bits of the PUSHR register (the command word) are not “sticky”. By this I...
  6. Replies
    14
    Views
    332

    I haven’t carefully quantified it yet, but the...

    I haven’t carefully quantified it yet, but the gap does vary when using DMA. Seemed to range from high 100’s to low 200’s (ns). I was only sending 151 bytes, so 32767 byte threshold did not come into...
  7. Replies
    14
    Views
    332

    So, the plot thickens. I switched over to the...

    So, the plot thickens. I switched over to the non-DMA overload of ‘transfer()’:

    void transfer(const void * buf, void * retbuf, size_t count);
    After this, two very interesting things happened:
    ...
  8. You can also instantiate an array of objects...

    You can also instantiate an array of objects directly:

    #include "Arduino.h"
    #include "MIDI.h"

    midi::MidiInterface<HardwareSerial> interfaceArray[] = {
    { Serial1 }, { Serial2 }, { Serial3 },...
  9. I know nothing of MIDI. But, using standard C++...

    I know nothing of MIDI. But, using standard C++ techniques, you can define your array of MIDI object pointers like this:

    #include "Arduino.h"
    #include "Audio.h"
    #include "MIDI.h"
    ...
  10. Replies
    14
    Views
    332

    Hi @KurtE. So, upon further examination of the...

    Hi @KurtE. So, upon further examination of the datasheet, things don't seem to be adding up. More specifically, they're not adding up to the amount of inter-frame gap shown in both of our...
  11. Replies
    14
    Views
    332

    Thanks again!!!

    Thanks again!!!
  12. Replies
    14
    Views
    332

    Thanks @KurtE. For my own edification, I'll dig...

    Thanks @KurtE. For my own edification, I'll dig into the SPI and DMA sections of the chip manual again. It's been a while. As far as you know, would a ~200ns gap be in the ballpark for 24MHz clock...
  13. Replies
    14
    Views
    332

    DMA SPI on T3.2

    Hi all. I decided to try driving an APA102 LED strip using DMA-based SPI on a T3.2. I’m using the standard SPI library that comes with Teensyduino. My code loads up the DMA buffer, calls...
  14. Here's an application where I synced the FTM to...

    Here's an application where I synced the FTM to an external signal - https://forum.pjrc.com/threads/55148-AC-Mains-Cycle-Phase-Control?highlight=phase
    It's a different application, but maybe you can...
  15. Replies
    2
    Views
    146

    Thanks Paul.

    Thanks Paul.
  16. Replies
    2
    Views
    146

    Can You "malloc()" DMAMEM?

    So, the DMAMEM directive is available to specify at compile-time time that a variable is to be stored in the lower RAM block. I'm wondering if there's a way to do the same thing with a dynamic...
  17. Replies
    12
    Views
    510

    OK, I just re-read your original post. I see...

    OK, I just re-read your original post. I see you're actually supplying a pointer to a HardwareSerial object. It was a little confusing since you named it "stream". I misread that as the class Stream....
  18. Replies
    12
    Views
    510

    That's fine, but the code to do that register...

    That's fine, but the code to do that register manipulation doesn't belong in your XXX class. Since the class deals with a Stream pointer, it should only do things that Stream knows about. The...
  19. Replies
    12
    Views
    510

    Trouble is, your starting philosophy is wrong....

    Trouble is, your starting philosophy is wrong. The purpose of the Stream class is to handle the I/O without regard to the underlying hardware (could be USB, HardwareSerial, SoftwareSerial, etc). The...
  20. Replies
    3
    Views
    235

    Since FTM0 has 8 channels, you could implement...

    Since FTM0 has 8 channels, you could implement similar capability on that (FreqCount uses the LPTMR). See the processor's Datasheet.

    EDIT:
    Sorry, that's wrong. The FreqCount technique clocks the...
  21. Replies
    16
    Views
    662

    Maybe try bypassing the analogWrite() function...

    Maybe try bypassing the analogWrite() function and instead manipulate the FTM directly? First, in your setup() function, configure the FTM for the appropriate frequency / resolution. Then configure...
  22. Replies
    36
    Views
    6,052

    So, I've been playing around with a T3.2 (only...

    So, I've been playing around with a T3.2 (only Teensy I have on hand right now). I still think @ jofre's problem statement is not completely defined. First, if the experiment can really produce even...
  23. Idea for FTM Application - Is a Race Condition Possible?

    Hi All.

    As I was thinking about a solution to a question posted in another thread, I wondered if it would be possible to extend the input capture capability of a T3.2/5/6’s FTM to 32-bit values...
  24. Replies
    36
    Views
    6,052

    I recommend using an FTM and asked several...

    I recommend using an FTM and asked several pertinent questions in @jofre's nearly identical thread on the same topic. So far, no reply to my questions.
  25. Might be time to put a scope on the SDA and SCL...

    Might be time to put a scope on the SDA and SCL lines.
  26. Thread: Photon Counter

    by gfvalvo
    Replies
    4
    Views
    282

    Don't know if will work, but I'd look into using...

    Don't know if will work, but I'd look into using the input capture capability of a T3.6 Flexible Timer Module (FTM).

    First though, your "Requirements Document" needs to be fleshed out quite a bit:...
  27. Replies
    0
    Views
    106

    T3.2 Power Fuse Rating

    Hi all, got a quick question. The schematic for T3.2 shows a fuse between the Micro-USB connector and the VIN / VUSB pins (as well as the voltage regulator):
    16614
    There are times, especially...
  28. Thread: String issue..

    by gfvalvo
    Replies
    12
    Views
    486

    I'm confused about why you would do this in the...

    I'm confused about why you would do this in the first place. What is the expected result of attempting to change a literal constant?
  29. You could have your Term class inherit from...

    You could have your Term class inherit from Stream and implement the special functions as required:

    #include "Arduino.h"

    class Term: public Stream {
    public:
    Term(Stream *p) :...
  30. It might be good if you told us what the traces...

    It might be good if you told us what the traces in the scope shot are along with the horizontal scale. Also, perhaps provide a schematic or block diagram. And, a clear drawing of what you want the...
  31. For that frequency, it looks like FreqCount...

    For that frequency, it looks like FreqCount is recommended. There's a link on the page to github where you can view the code. It uses counter / timer hardware resources on the chip. Which resource...
  32. Thread: Audio Sampling

    by gfvalvo
    Replies
    20
    Views
    1,001

    All of the Audio Library classes use the...

    All of the Audio Library classes use the audio_block_t type to get their input data samples from preceding blocks and send their processed data samples to subsequent blocks. The trick is what they do...
  33. Thread: Audio Sampling

    by gfvalvo
    Replies
    20
    Views
    1,001

    I stand corrected. I should have been more...

    I stand corrected. I should have been more specific by saying that simply adding the external SPI RAM chip would not allow you to increase the size of the 'granularMemory[]' array in the 'Granular...
  34. Thread: Audio Sampling

    by gfvalvo
    Replies
    20
    Views
    1,001

    I should have quantified "much easier". I meant...

    I should have quantified "much easier". I meant "much easier" in the sense that what you proposed to do is impossible. The processor on the T3.2 (like most stand-alone microcontrollers) does not have...
  35. Thread: Audio Sampling

    by gfvalvo
    Replies
    20
    Views
    1,001

    That's only because of the size defined for the...

    That's only because of the size defined for the 'granularMemory' array. You can make it larger.



    MUCH easier just to use a T3.5 or T3.6 with 256K RAM. Should be able to get >0.5 seconds with no...
  36. Replies
    5
    Views
    331

    The multiplexing is on a per-pin basis. There...

    The multiplexing is on a per-pin basis. There should be absolutely not problem using Pin 21 for PWM and Pin 27 for GPIO. If you're "seeing strange PWM behavior", it's due to some other reason.
  37. Replies
    11
    Views
    561

    No, the "extra clocks" required are a result of...

    No, the "extra clocks" required are a result of the APA102 protocol and are a totally separate issue. See: https://cpldcpu.wordpress.com/2014/11/30/understanding-the-apa102-superled/

    The issue is...
  38. Replies
    11
    Views
    561

    I’ve had pretty good success running APA102s...

    I’ve had pretty good success running APA102s (FastLED library) along with PJRC Audio Library -- including a fair amount of FFT number crunching. But, I’ve only gone up to about 120 or so LEDs. I...
  39. Yes, I realized that runt first pulses were a...

    Yes, I realized that runt first pulses were a possibility, but did not test it enough to observe any. I just did today. The trouble with resetting the counter is that it will screw up all other PWM...
  40. Here’s a slightly different technique that also...

    Here’s a slightly different technique that also works. It keeps the FTM enabled the whole time and just shuts down the output channel after the requisite number of pulses have been sent. Doing it...
  41. This worked for me on a T3.2: #include...

    This worked for me on a T3.2:

    #include "Arduino.h"

    uint8_t saveClockSource;
    volatile bool pwmRunning = false;
    volatile uint8_t numPulses = 1;
    volatile uint8_t pulseCount;

    void setup() {
  42. Try clearing the TOF flag BEFORE enabling FTM...

    Try clearing the TOF flag BEFORE enabling FTM interrupts in setup().
  43. "Equals Comparisons" are fine for integer-type...

    "Equals Comparisons" are fine for integer-type variables.
  44. Why are you calling attachInterrupt() on every...

    Why are you calling attachInterrupt() on every pass through loop?

    ‘comparatorState’ variable does not need to be ‘volatile’ or global, it can be local to ‘doOnClock()’. It also doesn’t need to be...
  45. Replies
    6
    Views
    473

    I wasn't able to quickly find a complete BC127...

    I wasn't able to quickly find a complete BC127 datasheet online. Perhaps you could attach one? So, as just a guess, I'd propose that the device is either set up for the wrong data format (PCM vs I2s)...
  46. Replies
    1
    Views
    162

    What you're trying to do seems quite convoluted...

    What you're trying to do seems quite convoluted and I can't imagine a reason for doing it. But, at least this compiles:

    #include <Arduino.h>

    struct dataStruct {
    uint8_t data;
    };

    class B...
  47. Replies
    3
    Views
    182

    Thanks for the info Paul.

    Thanks for the info Paul.
  48. Replies
    3
    Views
    182

    Which Boards Support FTM vs TPM?

    Hi. From my reading of the datasheets for the processors on T3.2 and T-LC, it seems to me that only the former supports the extended FTM functionality and the latter just supports the original TPM...
  49. Replies
    13
    Views
    678

    I'd look into using one of the LC's TPMs. You'd...

    I'd look into using one of the LC's TPMs. You'd need to use a combination of input capture and output match modes, switching between them at every interrupt as necessary.

    Use an output match...
  50. Did you try adding debug prints to see if the...

    Did you try adding debug prints to see if the actually gets the request?
Results 1 to 50 of 301
Page 1 of 7 1 2 3 4