Author Topic: [SAMC] TC in wave generation mode  (Read 3261 times)

0 Members and 1 Guest are viewing this topic.

Online SimonTopic starter

  • Global Moderator
  • *****
  • Posts: 17832
  • Country: gb
  • Did that just blow up? No? might work after all !!
    • Simon's Electronics
Re: [SAMC] TC in wave generation mode
« Reply #25 on: February 01, 2020, 01:09:47 pm »
I'm guessing there are various events of which one could be a pin state bu there is also a default pin that avoids the event system.
 

Offline ogden

  • Super Contributor
  • ***
  • Posts: 3731
  • Country: lv
Re: [SAMC] TC in wave generation mode
« Reply #26 on: February 01, 2020, 02:12:09 pm »
although the CTRLA register description sounds like indeed the WO pin could also be the input capture pin:
There is no such thing as WO pin. When you look in the port multiplex table, pin (function) labels are "TCCx/WO[z]", not just "WO".
« Last Edit: February 01, 2020, 02:25:03 pm by ogden »
 

Offline ataradov

  • Super Contributor
  • ***
  • Posts: 11294
  • Country: us
    • Personal site
Re: [SAMC] TC in wave generation mode
« Reply #27 on: February 01, 2020, 05:42:39 pm »
It looks like they actually improved it in SAM C. SAM D series did not have it as an input. In this case it does look like it can capture from an input directly. Hallelujah.

SAM D devices could only capture the actual events from the event system. And corresponding table reflects that.
Alex
 

Online SimonTopic starter

  • Global Moderator
  • *****
  • Posts: 17832
  • Country: gb
  • Did that just blow up? No? might work after all !!
    • Simon's Electronics
Re: [SAMC] TC in wave generation mode
« Reply #28 on: February 01, 2020, 05:47:08 pm »
Am i right to assume that if i can set the pin high/low in software the pin multiplexing has not taken effect?
 

Offline ataradov

  • Super Contributor
  • ***
  • Posts: 11294
  • Country: us
    • Personal site
Re: [SAMC] TC in wave generation mode
« Reply #29 on: February 01, 2020, 05:49:40 pm »
Yes, if you still have control over the pin via OUTSET/OUTCLR, multiplexing is disabled.  When peripherals are connected they take over the corresponding control lines.

Although there are examples where you may mistake control over the pin versus control over the pull-up. For example if you enable EIC, you still have control over the pull-up/pull-down resistor if the pin is configured as an input. Externally this can be mistaken for the control over the pin.
« Last Edit: February 01, 2020, 05:51:42 pm by ataradov »
Alex
 
The following users thanked this post: ogden

Online SimonTopic starter

  • Global Moderator
  • *****
  • Posts: 17832
  • Country: gb
  • Did that just blow up? No? might work after all !!
    • Simon's Electronics
Re: [SAMC] TC in wave generation mode
« Reply #30 on: February 01, 2020, 05:56:59 pm »
Well i am trying to set the pin to work with a TC so from what you say I should not be able to toggle it. Do i need to set it as an output or does the peripheral completely take over.
 

Offline ataradov

  • Super Contributor
  • ***
  • Posts: 11294
  • Country: us
    • Personal site
Re: [SAMC] TC in wave generation mode
« Reply #31 on: February 01, 2020, 05:59:53 pm »
All you need to set is PMUX value. TC specifically takes takes over. Although I'm not 100% sure with that new TC in SAM C, given that it also has direct inputs. So I would set it as an output.

I generally always explicitly set things as inputs or outputs even when I know that peripheral will take over, since it created a self-documenting code as well.
Alex
 

Online SimonTopic starter

  • Global Moderator
  • *****
  • Posts: 17832
  • Country: gb
  • Did that just blow up? No? might work after all !!
    • Simon's Electronics
Re: [SAMC] TC in wave generation mode
« Reply #32 on: February 01, 2020, 06:03:44 pm »
OK, just trying to make sure I do't create a conflict
 

Online SimonTopic starter

  • Global Moderator
  • *****
  • Posts: 17832
  • Country: gb
  • Did that just blow up? No? might work after all !!
    • Simon's Electronics
Re: [SAMC] TC in wave generation mode
« Reply #33 on: February 01, 2020, 08:17:56 pm »
16.8.3 clock generator

The divisor bits. Apparently gen 2-9 are 8 bits using bits 4:0, so which one is it? I assume a typo that should be 7:0 as 4 is below 7 and I can't see it being 5 bits.
 

Offline ataradov

  • Super Contributor
  • ***
  • Posts: 11294
  • Country: us
    • Personal site
Re: [SAMC] TC in wave generation mode
« Reply #34 on: February 01, 2020, 08:22:26 pm »
I think it should be DIV[7:0]. I'm pretty sure I used more than 5 bits.
Alex
 

Offline Lajon

  • Contributor
  • Posts: 31
  • Country: se
Re: [SAMC] TC in wave generation mode
« Reply #35 on: February 02, 2020, 12:58:06 pm »
16.8.3 clock generator

The divisor bits. Apparently gen 2-9 are 8 bits using bits 4:0, so which one is it? I assume a typo that should be 7:0 as 4 is below 7 and I can't see it being 5 bits.
Yes 8 bits. This is corrected in the current revision of the data sheet (which is very recent, from January).
/Lars
 

Online SimonTopic starter

  • Global Moderator
  • *****
  • Posts: 17832
  • Country: gb
  • Did that just blow up? No? might work after all !!
    • Simon's Electronics
Re: [SAMC] TC in wave generation mode
« Reply #36 on: February 09, 2020, 12:05:42 pm »
Right I'll look up the latest copy. I have the PWM output working now. I had not enabled the clock in the main clock controller.
 

Online SimonTopic starter

  • Global Moderator
  • *****
  • Posts: 17832
  • Country: gb
  • Did that just blow up? No? might work after all !!
    • Simon's Electronics
Re: [SAMC] TC in wave generation mode
« Reply #37 on: February 09, 2020, 12:45:08 pm »
woah they have dropped over 100 pages. I wonder what changed.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf