View previous topic :: View next topic |
Author |
Message |
Davide
Joined: 25 Sep 2005 Posts: 93
|
Posted: Fri Oct 16, 2020 2:17 pm Post subject: Frequency output from timer XMEGA |
|
|
Hello All,
I did find any message on this topic, is it possible to have 1/4 internal clock to pin PE3. I use Xmega32.
Thanks
Davide
(BASCOM-AVR version : 2078 , Latest : 2.0.8.3 ) |
|
Back to top |
|
|
MWS
Joined: 22 Aug 2009 Posts: 2262
|
Posted: Fri Oct 16, 2020 3:47 pm Post subject: Re: Frequency output from timer XMEGA |
|
|
Davide wrote: | is it possible to have 1/4 internal clock to pin PE3. I use Xmega32. | You need to read the data sheet.
XMega32AU:
Quote: | CLKOUT = Peripheral Clock Output
CLKOUT can optionally be moved between port C, D and E and between pin 4 and 7. | PortE.3? No.
Quote: | Port E - alternate functions.
...
PE3 OC0D |
With suitable settings, TCE0 will output a sysclock/4 signal on PE3. |
|
Back to top |
|
|
Davide
Joined: 25 Sep 2005 Posts: 93
|
Posted: Fri Oct 16, 2020 4:16 pm Post subject: |
|
|
Hello MWS,
I select PE3 because I red the datasheet )
I am sure about the meaning of OC0D - The timer should be TCE0 according the datasheet but how to activate the output.
Is the sintax correct:
Config TCE0 = Freq , Prescale = 4
Do we have to enable the timer?
How we adress the PE3 output ?
Davide |
|
Back to top |
|
|
MWS
Joined: 22 Aug 2009 Posts: 2262
|
Posted: Fri Oct 16, 2020 6:46 pm Post subject: |
|
|
See XMEGA_easy_Frequency_Generation.bas from Samples\XMEGA\Counter Timer.
Have no way to test, but this should do:
Code: | Config PortE.3 = Output
Config TCE0 = Freq , Prescale = 2 , CompareD = Enabled , Resolution = 16
TCE0_CCD = 0 |
|
|
Back to top |
|
|
Davide
Joined: 25 Sep 2005 Posts: 93
|
Posted: Sat Oct 17, 2020 3:06 pm Post subject: |
|
|
Hello MWS,
I tried and it works fine.
Many thanks
D. |
|
Back to top |
|
|
|