UC3-A3 -- how to map timer waveform output to a physical pin?

Go To Last Post
8 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hi,

 

From the datasheet description, I see that I can configure timers in waveform mode, and TIOA and TIOB become outputs for the generated waveform (e.g., see Figure 28-5 on page 758 of the complete datasheet).

 

However, I cannot find documentation about how to map TIOA or B to a physical pin.  Are there designated pins?  I was expecting to find TIOA and TIOB in table 3-1 on page 9, but I don't see them there.

 

Any help/pointers will be appreciated.

 

For context:  I want to generate a 4 or 8MHz square-wave signal that will be the clock for an external peripheral chip.  (I have the 12MHz crystal for the UC3-A3 internal oscillator)

 

Thanks,

Cal-linux

--

 

This topic has a solution.
Last Edited: Thu. Sep 28, 2017 - 01:44 PM
This reply has been marked as the solution. 
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I don't know anything about AVR32 devices, this is the AT32UC3A3256, right?

 

Page 750 says:

The pins used for interfacing the compliant external devices may be multiplexed with I/O lines.
The user must first program the I/O Controller to assign the TC pins to their peripheral functions.

 So fortunately, this is somewhat similar to Atmel SAM ARM MCUs, which I'm more familiar with. You need to see, first, in table 3-1 to which pins the timer outputs can be mapped, for example PX14, which is GPIO #65. You see this corresponds to function C of the pin.

 

Then, you go to chapter 20, page 386 and use the formula to see which 32 bit port you need to configure. In this case would be port 2, pin 1. The base address for the configuration registers for port 2 is 0x0200.

 

Finally, you configure GPER of port 2 so that the peripherals controls pin 1, and PMR0 and PMR1 of port 2 so that function C is selected for pin 1.

 

Hopefully, the timer now controls the selected pin.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 1

There are 2 timer modules, each with 3 channels, so the multiplexing table uses a TCmodule-A/Bchannel naming scheme, eg. TC0-A1, TC1-B0, ...


To generate an external clock it would be simpler to use a Generic Clock (see Power Manager (PM) section).

Last Edited: Wed. Sep 27, 2017 - 11:17 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Thanks El Tangas,

 

This is a very detailed and useful reply --- I have to add, the manual seems quite unintuitive;  if it wasn't because you spelled it out bit by bit, I'm not sure I would have figured it out  (and that's not good;  I don't normally expect this much, and am quite happy with just the pointer to the right place).  I guess even though I do have quite a bit of experience with other AVRs, I'm completely new to the UC3-A3s and in general to the AVR32.

 

Anyway, I just thought I'd throw this bit of ranting!   Regardless, thank you so much for your detailed and helpful reply!

 

Cheers,
Cal-linux

--

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I gave a detailed answer because it took me quite a while to figure it out for the SAMD10, which has a similar configuration, so why let others suffer through all that? And the SAMD datasheet is actually better organized, if I didn't have that prior knowledge I'm not sure I could figure it out, either.

 

These 32 bit devices are just much more complex than the 8 bit ones.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

mikech wrote:
To generate an external clock it would be simpler to use a Generic Clock (see Power Manager (PM) section).

 

Interesting.  Here too, I'm finding the manual unintuitive/incomplete (as pointed out in my reply to El Tangas).  I figure Table 7-2 on page 51 would give me the required information;  but it refers to GCLK0 -- GCLK3 pins;  I can't find these identifiers anywhere else in the document.  Is that what, e.g., TC0 - CLK0 is?  (function C of pin PX20 / GPIO #71).   Since there is no TC0 - CLK3 to map to GCLK3, I suspect that's something else.

 

Can you give me some additional pointers to figure out the remaining pieces of the puzzle?

 

Thanks,
Cal-linux
--

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 1

You should look at that table carefully, maybe just print it (I hate looking at pdfs). They appear as PM - GCLK[0], ..., PM - GCLK[3].

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

El Tangas wrote:
They appear as PM - GCLK[0], ..., PM - GCLK[3].

 

D'oh!!  Thanks for pointing this out!!

 

I'm actually quite the opposite w.r.t. you when it comes to looking at PDFs on the screen vs. looking at a printout.  I find just too many advantages with the PDF --- you can zoom in as much as you need to (and at an age above 40, I do need to zoom in a lot!), a computer searches much faster and more reliably than our eyes  (big exception for situations like the subject of this sub-thread!!  if I had seen GCLK[0], I would have immediately known; the PDF software didn't! --- still, in the general case I find that searching on an electronic document is more efficient).

 

Cheers, and thanks again!

Cal-linux

--