Forum - MCS Electronics

 

FAQFAQ SearchSearch RegisterRegister Log inLog in

Frequency output from timer XMEGA

 
Post new topic   Reply to topic    www.mcselec.com Forum Index -> BASCOM-AVR
View previous topic :: View next topic  
Author Message
Davide

Bascom Member



Joined: 25 Sep 2005
Posts: 93

italy.gif
PostPosted: Fri Oct 16, 2020 2:17 pm    Post subject: Frequency output from timer XMEGA Reply with quote

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
View user's profile
MWS

Bascom Member



Joined: 22 Aug 2009
Posts: 2262

blank.gif
PostPosted: Fri Oct 16, 2020 3:47 pm    Post subject: Re: Frequency output from timer XMEGA Reply with quote

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
View user's profile
Davide

Bascom Member



Joined: 25 Sep 2005
Posts: 93

italy.gif
PostPosted: Fri Oct 16, 2020 4:16 pm    Post subject: Reply with quote

Hello MWS,

I select PE3 because I red the datasheet Wink)

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
View user's profile
MWS

Bascom Member



Joined: 22 Aug 2009
Posts: 2262

blank.gif
PostPosted: Fri Oct 16, 2020 6:46 pm    Post subject: Reply with quote

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
View user's profile
Davide

Bascom Member



Joined: 25 Sep 2005
Posts: 93

italy.gif
PostPosted: Sat Oct 17, 2020 3:06 pm    Post subject: Reply with quote

Hello MWS,

I tried and it works fine.
Very Happy

Many thanks

D.
Back to top
View user's profile
Display posts from previous:   
Post new topic   Reply to topic    www.mcselec.com Forum Index -> BASCOM-AVR All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum