Comments (13)
from atsamd.
Just got back from out of town, I'll take a look at it in the next couple days here.
from atsamd.
I've added (and tested) Pwm2
to my fork (36afab5) which makes use of TC2
.
As far as using multiple pins, the datasheet seems to imply it's possible:
Timer/Counter -> 24.8 Signal Description
Refer to “I/O Multiplexing and Considerations” on page 13 for details on the pin mapping for this peripheral. One signal can be mapped on several pins.
I believe it is possible to use TCC0
as well. However, unless I'm mistaken, in both cases our pwm!
macro needs to be modified as it currently expects a single TCxPinout
as well as a TCx
parameter.
@sajattack , am I on track here? The pinout
member in the $TYPE
struct does seem kind of like magic and doesn't appear to be read anywhere yet is still working as expected, so I'm clearly missing something there.
from atsamd.
One signal can be mapped on several pins.
The thing I'm aiming for is to have 4 separate PWM counters. From a not-too-careful reading of the datasheet, it seems like this might be possible with TC{1,2}/WO{0,1}. I might be misunderstanding the way the WO channels work - the datasheet says Waveform output channels for TC : 2
, whereas it says Waveform output channels per TCC : 8
. I'm not sure if this means 2 WOs per TC or 2WOs total shared across both TCs. If it's the latter, I think I would have to use TCC0.
from atsamd.
The mode we use the WO in uses 2 channels for one pwm output.
from atsamd.
One thing that's confusing me about the rust API is that the definition of atsamd11c14a::tcc0
seems to be missing some stuff compared to what's mentioned in the datasheet/C snippets. E.g. it seems like cc
should have some additional structure to account for the fact that there are 4x compare channels. All of this stuff is autogenerated right?
from atsamd.
Could've been missing from the SVD
from atsamd.
Got it, thanks. So what's the best way forward here? Manually edit the SVD file? Ask the manufacturer? Just give up and write everything in C?
from atsamd.
FWIW, I was able to get this working for my needs via the C FFI. So no longer any urgent desire on my end. Still probably worth fixing though.
from atsamd.
I don't think our HAL supports TCCs yet anyhow so we can worry about it later.
from atsamd.
Sorry, had a busy week. Glad you got a solution figured out.
I have started trying to adapt the pwm!
macro to use TCC0
instead of TCx
, just as a proof-of-concept. If/when I get it working maybe there can be some discussion on how to move forward.
from atsamd.
Can this be closed now?
from atsamd.
Sure, although Jesse, let me know if you want me to reopen so you can track adding TCC0 support here
from atsamd.
Related Issues (20)
- Is the ATSAMDA1 micro supported? HOT 3
- wio-terminal Wi-Fi examples broken by #542 HOT 13
- Read state of EIC pin HOT 1
- Example for standalone usage? HOT 7
- I2C slave mode support HOT 4
- Wrong GCLK used for Metro M4 and Grand Central Express USB
- Non-working implementation of eic::pin::ExternalInterrupt::id() HOT 2
- RTC peripheral can be used without configuring the RTC clock
- PACs need to be regenerated to remove lint diagnostic
- How can I use usb function on 0.15.0 or higher HOT 3
- `Spi` implementation relies on fragile timing HOT 4
- Add support for SAMC2x ? HOT 11
- Correct alternate for USB pins on some M4 BSPs? HOT 4
- `hal::sercom::uart::Config` could potentially check for the correct sercom clock HOT 2
- Allow a way to get >1 `impl Delay` type HOT 8
- pybadge support HOT 2
- How to keep the device in bootloader mode? HOT 3
- atsamd21e18a I2C HOT 6
- Unable to use cargo flash in the feather_m0 repo HOT 2
- Wio Terminal, eRPC communication, USART Overflow
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 atsamd.