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

Search:

Type: Posts; User: joepasquariello

Page 1 of 10 1 2 3 4

Search: Search took 0.01 seconds.

  1. Replies
    2
    Views
    41

    You might be trying to print some non-printable...

    You might be trying to print some non-printable characters that are doing unexpected things. Are you sure ASCII 31-91 are all printable? Make sure, modify if necessary, and try replacing:


    ...
  2. Victor, your program does run correctly, but if I...

    Victor, your program does run correctly, but if I simply comment out the checking for stack corruption, it does not run at all. This is what I have seen over and over with this issue. A working...
  3. Iím sure libcís malloc is in a separate file, so...

    Iím sure libcís malloc is in a separate file, so even though itís in a lib file, it should get replaced at link time.
  4. Hi Victor. My phone does not show message...

    Hi Victor. My phone does not show message numbers, so Iím not sure which one you mean. Is it the one with mutexes? I will try it later. If new uses malloc(), you can switch all allocations to...
  5. Replies
    1
    Views
    66

    May I suggest trying QNEthernet instead? I had...

    May I suggest trying QNEthernet instead? I had better luck and the developer (Shawn) is very responsive. Search the forum for th thread with releases.
  6. I think weíve shown that malloc is not reliable...

    I think weíve shown that malloc is not reliable from threads other than main on T3. Letís talk about why you need String in more than one thread. There is no reason to use multiple threads for...
  7. Replies
    0
    Views
    170

    Also need a few T3.5 boards

    Happy to pay a premium plus shipping. Prefer with pins, but without is fine. Located in Berkeley CA.
  8. I think that's correct. It's not just...

    I think that's correct. It's not just TeensyThreads, but rather any RTOS with a stack per task. And T4.x is okay because it uses smalloc() rather than malloc?

    I tried this malloc alternative...
  9. I tried a few more things, including having the...

    I tried a few more things, including having the thread stacks on the stack of the main thread, and I think the fundamental problem is the same. If you call malloc() with different stack pointers, you...
  10. Yes, itís very strange. Seems to act differently...

    Yes, itís very strange. Seems to act differently for changes that shouldnít matter.
  11. Doing some or occasional malloc from main thread...

    Doing some or occasional malloc from main thread seems to ďunlockĒ the heap for malloc by the other threads, but I donít think itís meant to work that way, and it works only ďaccidentallyĒ. It never...
  12. If you run the last program I posted, you can see...

    If you run the last program I posted, you can see that all of heap can eventually be used even without a large initial malloc by main thread.
  13. In my testing, there is nothing magic about a...

    In my testing, there is nothing magic about a preliminary allocation from main thread.
  14. It seems like even if it works, it's not going to...

    It seems like even if it works, it's not going to work as expected when the stack pointer for all threads other than the main thread is below the top of the heap. Can you comment on that? One of your...
  15. I had the same experience. Made a small, valid...

    I had the same experience. Made a small, valid change to a working program, and the program stopped working completely. What I think I see in the test results are that malloc() only works (for some...
  16. I guess I don't understand this part. In my test...

    I guess I don't understand this part. In my test program (update below), the blocks are allocated in order from lowest to highest address, but with some failures among threads other than the main...
  17. malloc() will report that no memory is available...

    malloc() will report that no memory is available if the requested allocation will collide with the stack, as defined by the value of the stack pointer at the time of the call to malloc(). With...
  18. Yes, many pitfalls. It seems like dynamic...

    Yes, many pitfalls. It seems like dynamic allocation will work only if it is limited to the main thread, where the stack pointer is the system stack pointer. Probably a good idea to also limit...
  19. malloc() works as expected in the main thread...

    malloc() works as expected in the main thread (loop), but not in the thread created via addThread(). Something to do with that thread's stack having been allocated from the heap?
  20. I also ran the code on 3.5 and got the error. If...

    I also ran the code on 3.5 and got the error. If I move the malloc() code from the thread function to loop(), it runs okay there until memory is exhausted, so there is something about how threads and...
  21. I think I began using the library below to reduce...

    I think I began using the library below to reduce code size associated with printf(), but the documentation makes a point to that it is not only small, but also thread-safe and does not use malloc()....
  22. Useful doc, thanks.

    Useful doc, thanks.
  23. Replies
    9
    Views
    173

    Others know more about this than me, but I think...

    Others know more about this than me, but I think the short answer is the T4 processor is a lot more complex than the one on UNO or DUE. See section 28.2 of the processor reference manual for a...
  24. Replies
    353
    Views
    59,478

    @luni, it looks to me like the new setPeriod() in...

    @luni, it looks to me like the new setPeriod() in your fixFTM branch will do what you want. Because you have FTMEN=0 in the FTMx_MODE registers, and you are using output compare, writes to the CV...
  25. Replies
    353
    Views
    59,478

    I checked the source code, and it looks like...

    I checked the source code, and it looks like setPeriod() is not implemented for FTM, so that may explain why that function is not doing what you want. It looks like t1.trigger() will do what you...
  26. Replies
    353
    Views
    59,478

    With a PeriodicTimer, the timer starts when you...

    With a PeriodicTimer, the timer starts when you call begin(), so you could call t1.begin() in the hw_interrupt function instead of in setup(), and then stop the timer after 10 calls to...
  27. I think that's a good idea. Nice to have the...

    I think that's a good idea. Nice to have the option of using the stable IDE 1.x, but get the faster build times, while IDE 2.0 is maturing.
  28. Installed IDE 2.0 for the first time last week...

    Installed IDE 2.0 for the first time last week (rc9) on Windows 7 64-bit. Today when I started IDE 2.0, it notified me that rc9.1 was available. Download/install was fully automatic, so that was...
  29. Replies
    57
    Views
    784

    You're welcome. Yes, it seems a good idea to be...

    You're welcome. Yes, it seems a good idea to be able to modify the output pulse width and also to be able to reinitialize the input period measurement. In this case we can do that with a single...
  30. Replies
    57
    Views
    784

    Hi Biff. Here's an update that does a couple of...

    Hi Biff. Here's an update that does a couple of new things. It processes serial input from the Arduino console and looks for valid numerical characters. When newline is found (user hits enter), the...
  31. Not sure if one is preferred. Either should work....

    Not sure if one is preferred. Either should work.



    memset() is a standard library function, defined as shown below. The address (s) is type void*, value (c) is type int, and size (n) is size_t...
  32. Thanks very much for the info. I've seen...

    Thanks very much for the info. I've seen preallocation mentioned in that other thread, so I'll have to read about it. Good luck at Salt Lake, and let us know how it goes.
  33. Replies
    57
    Views
    784

    You're welcome. I was kinda glad to have a reason...

    You're welcome. I was kinda glad to have a reason to understand the FTM module better. The way that I ended up doing it is not obvious in looking at the code. FTM0 ch4 (pin 6) does input capture on...
  34. Thanks for the insights. Just a great application...

    Thanks for the insights. Just a great application and must be a lot of fun to see it all work. There are some recent threads discussing best practice for SD logging, and that's something I need to do...
  35. Replies
    57
    Views
    784

    Please try this one. I might have been in the...

    Please try this one. I might have been in the middle of a change when I did my last copy/paste. I confirmed that this builds for T3.2, though I'm testing on T3.5


    ...
  36. Replies
    57
    Views
    784

    Okay. Try this one, which (I think) sync's the...

    Okay. Try this one, which (I think) sync's the output pulse on each rising edge of the input. However, if you do single triggers, you will likely get output pulses in between your input pulses. This...
  37. Replies
    57
    Views
    784

    @Biff, I figured out how to use the COMBINE mode...

    @Biff, I figured out how to use the COMBINE mode PWM on two FTM channels to generate the output signal without interrupts. The code below does that, and you can set the output width from 1% (or even...
  38. Very cool. Can you tell us a little about the...

    Very cool. Can you tell us a little about the hardware and software? I'm curious what is the control frequency, how many analog I/O, whether you are using on-board ADC or external, etc.
  39. Replies
    57
    Views
    784

    I'm guessing that's because you're really close...

    I'm guessing that's because you're really close to the boundary between OK and too short. I'm not sure exactly what variables exist from one run to the next, but I do think it's possible that the...
  40. Replies
    57
    Views
    784

    [QUOTE=Biff;309883]@joe, trying the 5% duty cycle...

    [QUOTE=Biff;309883]@joe, trying the 5% duty cycle works well at 50 kHz (see first figure below). But if I increase the frequency to 55 kHz, the duty cycle breaks, and becomes closer to 100% (see...
  41. Replies
    57
    Views
    784

    @Biff, glad that's working for you. The method I...

    @Biff, glad that's working for you. The method I had hoped to get down to 2% on the output was to use the COMBINE feature to couple together two FTM channels to produce both the rising and falling...
  42. Replies
    57
    Views
    784

    Here's a bug fix for the version that uses FTM...

    Here's a bug fix for the version that uses FTM input capture and output compare. The fix is that variable "input_period" must be 16-bit unsigned to avoid error on roll-over of the 16-bit FTM counter....
  43. Replies
    57
    Views
    784

    Updated version w/ more and better comments and...

    Updated version w/ more and better comments and elimination of a few "magic number" constants. Use variable "output_width_pct" to set output width as % of input period.

    EDIT: On further reading of...
  44. Replies
    57
    Views
    784

    Here is a program that does what you want, as I...

    Here is a program that does what you want, as I understand it. It uses 3 pins

    - pin 3 is 50 kHz PWM to simulate the 50 kHz input signal
    - pin 9 is the input signal (FTM0 ch2) and does input...
  45. Replies
    57
    Views
    784

    That helps. Tomorrow I'll take a shot at using...

    That helps. Tomorrow I'll take a shot at using FTM for both input (input capture on rising edge only) and output (output compare for rising/falling edges of output). We should only need the rising...
  46. Replies
    57
    Views
    784

    You said previously that the output rising edge...

    You said previously that the output rising edge could be at the same time or soon after the input rising edge. And now you're saying the output pulse width depends on something other than the input...
  47. https://github.com/mjs513/NewPing_t4

    https://github.com/mjs513/NewPing_t4
  48. Replies
    57
    Views
    784

    I take your sentence above to mean that the...

    I take your sentence above to mean that the RISING edge of the output pulse can start "any time after the (rising edge of the) input pulse". Can you say something about the requirements for the...
  49. Replies
    57
    Views
    784

    FreqMeasureMulti can definitely be used to...

    FreqMeasureMulti can definitely be used to measure the period and high time of the input pulse, but unless you modify the library, there is no hook into the rising/falling edge ISRs. If you brought...
  50. The frequency and high time of any PWM signal is...

    The frequency and high time of any PWM signal is based on a clock frequency. In the case of T4.0, the clock frequency of the PWM module is F_CPU/4, so for your F_CPU=528MHz, the PWM clock frequency...
Results 1 to 50 of 500
Page 1 of 10 1 2 3 4