Comments (14)
Well after some hang about this issue i discovery that Tc3 library is bugged, also its marked as legacy already. So far looks like TCC0 library work as expected but i didnt conduct some deep tests to make sure, any way i think the best solution will be to port the usage of TCx or TCCx for directly register access, that will probrably be usable on a wide range of SAMDxx.
I was looking at https://github.com/khoih-prog/TimerInterrupt_Generic wich looks good to use as port but it requires the user to make patches before use the library, wich i want to avoid.
The reason i decide to make the whole port based on register handling is because the uCtrl makes use of Tc3 while uClock makes use of TCC0 on uMODULAR environments.
I will send news as soon as i get something done!
Once again thanks for the research over samd timers.
from uclock.
well the ideia was just to get the part of the code that handles the Timer(form SAMDx) at register level to implement a call at uClock to initialize the timer and to change the frequency but not to incorporate the whole library, but i just give up when i've check that this library still needs a patch per microcontroler arch.
But honestly deals with specific registers to get it running make it no portable at all and could give a lot of headache on maintain side.
from uclock.
hey @m-r-m-s , thanks for the implementation details! i will try to incorporate it to the uClock as soon as possible.
from uclock.
Well looking to all the docs you've found so far i think the best approach is the first one, to have the support out-of-the-box. i will open a branch with some changes here and let you know!
from uclock.
- What value should
#define TIMER_INTERVAL_MS
be?
This is used only for AVRs, i think i will start to divide files per port.
from uclock.
its the same mcu used by arduino zero by the way:
https://github.com/adafruit/Adafruit_ZeroTimer/
and also for GEMMA M0 and Trinket M0 boards
so it looks like a lots of new devices supported by this port
from uclock.
@midilab Thanks for looking into additional porting for uClock. Sounds like it is too much hassle unfortunately. I really appreciate the time trying to make it work! I think I can just work with just adding the TCC0 and TC3 helper libraries to Adafruit Arduino Core like I did when testing.
Well i think it worth to take a note at README about this hacky way to use it with QT Py M0 for those who wish to.
I will update a note with your description of how to do it.
My guess is that soon or later a timer library will be officially integrated into their SDK for Arduino.
Thanks for the research too! it is always good for a project to grow and extend as much as possible.
The whole goal behind uClock and uCtrl is exacly that, make it portable on Arduino platform to as many board as we can.
from uclock.
Thanks for testing out @m-r-m-s ! in case of any updates on a official library please open another issue for integration.
from uclock.
Hey @midilab, a small update: I have successfully gotten the Adafruit QT py M0 board to work with uClock!
It is a workaround where I included the TCC0
and TC3
libraries from the Seeed Xiao Arduino core (https://github.com/Seeed-Studio/ArduinoCore-samd/tree/master/libraries) to the Adadfruit Arduino core libraries with a slight modification to the #ifdef
for both of those libraries.
Here is the modified version of TimerTCC0.cpp
which supports multiple SAMD boards:
https://gist.github.com/m-r-m-s/8727b900a8814028781509814de3db1f#file-timertcc0_modified-cpp-L10
This modification works with the uClock.cpp
#if defined(SEEED_XIAO_M0)
because __SAMD21G18A__
is also a MACRO for the Seeed Xiao. Hope that makes sense.
It would be great to add QT Py M0 to the list of supported hardware but I think this method is a bit opaque =)
from uclock.
Well looking to all the docs you've found so far i think the best approach is the first one, to have the support out-of-the-box. i will open a branch with some changes here and let you know!
Sounds good and thank you!
from uclock.
Tbh. I see this library usefull in an application but not in a library like uClock. The timerinterrupt_generic doesn't seem to play well, if you are already using timer stuff in your application. Having now a dependancy to uClock which depends on tc_generic would force you, to change your app to also use tc_generic (from what I understood)
Also there are a lot of prerequisites using tc_generic like patching the sdk and some files for different boards - from what I have seen in a quick read.
Maybe I'm wrong and would have to see this in a dedicated fork.
from uclock.
@midilab Thanks for looking into additional porting for uClock. Sounds like it is too much hassle unfortunately. I really appreciate the time
trying to make it work! I think I can just work with just adding the TCC0 and TC3 helper libraries to Adafruit Arduino Core like I did when testing.
from uclock.
Sounds good. Thank you for including the workaround in the readme description. And yes let's hope there is better timer integration in the SDK in the near future 🙌
from uclock.
Hi @midilab - I wanted to provide another update. I have done some additional testing and I am not confident that this workaround for the QT Py M0 board is working correctly with uClock. While it would be nice to have an additional board option, I think we will have to wait until a timer library is officially integrated into their SDK for Arduino as you mention above.
from uclock.
Related Issues (20)
- uClock supported by Raspi pico ? HOT 6
- Renaming the default branch from master HOT 4
- Update Platformio library registry to latest uClock version? HOT 4
- potential bug in TeensyUsbSlaveMidiClockMonitor example HOT 30
- Support for the ESP32/ESP32S2/ESP32S3 platforms HOT 37
- Teensy support? HOT 5
- External clock and send midi notes not in sync HOT 5
- Could uClock be adapted to work on STM32F4? HOT 23
- TeensyUsbMasterMidiClock no name.c HOT 2
- ESP32/ESP32-s3 crash Guru Meditation Error: Core 1 panic'ed (Interrupt wdt timeout on CPU1). HOT 14
- Shuffle implementation HOT 11
- 'IntervalTimer' does not name a type - Seeed Xiao samd21 m0 HOT 10
- Clock bug on Arduino board? HOT 12
- What external signal can I sync to? HOT 2
- Intermittent freeze on Teensy 4.1 when trying to send CC from inside loop()? HOT 7
- uclock 96PPQN query/help HOT 10
- Possible to use concurrently with the USB_Host_Shield_2.0 library? HOT 17
- uClock support for Seeeduino XIAO? HOT 54
- Multiple warnings when compiling uClock for Arduino HOT 8
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from uclock.