Forum - MCS Electronics

 

FAQFAQ SearchSearch RegisterRegister Log inLog in

xmega E5 config timer problem

 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    www.mcselec.com Forum Index -> BASCOM-AVR Archive
View previous topic :: View next topic  
Author Message
andro

Bascom Member



Joined: 12 Mar 2007
Posts: 94
Location: Ljubljana

slovenia.gif
PostPosted: Fri Aug 29, 2014 10:21 am    Post subject: xmega E5 config timer problem Reply with quote

Hi!

Trying to switch from xmega32a4 to xmega16e5 I have a problem with this statement:

Code:
Config Tcd0 = Normal , Prescale = 64


Resulting this error:

Error : 46 Line : 166 Assignment error [TCD0_CTRLA: 0 &H05: 112]


I read E5 data sheet, saying it has timer/counter type4 an type5.

Might there be a problem with xmega16e5def.dat?

Thanks !!

BR
Andrej

(BASCOM-AVR version : 2.0.7.7 )
Back to top
View user's profile
albertsm

Administrator



Joined: 09 Apr 2004
Posts: 5928
Location: Holland

blank.gif
PostPosted: Fri Aug 29, 2014 9:55 pm    Post subject: Reply with quote

the reason is that there is no tcd0 in this micro.
Only tcc4,tcc5 and tcd5

_________________
Mark
Back to top
View user's profile Visit poster's website
andro

Bascom Member



Joined: 12 Mar 2007
Posts: 94
Location: Ljubljana

slovenia.gif
PostPosted: Fri Aug 29, 2014 10:07 pm    Post subject: Reply with quote

Hi Mark,

I already tried this:

Code:
Config Tcc4 = Normal , Prescale = 64  


but then i got this 2 errors:
Error : 12 Line : 166 Unknown CONFIG parameter [TCC4]
Error : 12 Line : 166 Unknown CONFIG parameter [PRESCALE]

In your help on Config TCxx, ther is a description:
The possible timer names are : TCC0, TCC1, TCD0, TCD1, TCE0, TCE1, TCF0 and TCF1.

I'm afraid, I do not understand that.

BR
Andrej
Back to top
View user's profile
albertsm

Administrator



Joined: 09 Apr 2004
Posts: 5928
Location: Holland

blank.gif
PostPosted: Fri Aug 29, 2014 10:29 pm    Post subject: Reply with quote

tcc4 should work. The timers from the help are the first xmega timers. had no idea that atmel would create variants later.
The E5 serie is a bit different. The timers are indeed different. When support for E5 was added there was no full support of the new timers. I thought they were implemented in 2077 but i just had a look why it worked for me :
I see in the upcoming release notes : xmegaE5 timers 4/5 support added. that means it will compile in the next update.
for now you need to configure the registers manual.

;##### CONFIG TCC4 = NORMAL , PRESCALE = 64
TCC4_CTRLA = &H05

_________________
Mark
Back to top
View user's profile Visit poster's website
andro

Bascom Member



Joined: 12 Mar 2007
Posts: 94
Location: Ljubljana

slovenia.gif
PostPosted: Fri Aug 29, 2014 10:44 pm    Post subject: Reply with quote

hI,

I tried this, and it went through without any errors now:

Code:
'**************************************************************************************************
'********************** TIMER CONFIG **************************************************************

';##### Config Tcc4 = Normal , Prescale = 64
Tcc4_ctrla = &H05
Tcc4_per = 2550                                             'perioda 5ms; 2550*256=652800 ciklov

'**************************************************************************************************

On Tcc4_cca Compared0_int
Enable Tcc4_cca , Lo

'**************************************************************************************************
'**************************************************************************************************

Mark, many thanks again for all your effort!

And now, I can go to bed... I gues, i'll dream of XmegaE5 family

 
 :D

BR
Andrej
Back to top
View user's profile
andro

Bascom Member



Joined: 12 Mar 2007
Posts: 94
Location: Ljubljana

slovenia.gif
PostPosted: Fri Aug 29, 2014 10:46 pm    Post subject: Reply with quote

Very Happy
Back to top
View user's profile
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    www.mcselec.com Forum Index -> BASCOM-AVR Archive 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