View previous topic :: View next topic |
Author |
Message |
andro
Joined: 12 Mar 2007 Posts: 94 Location: Ljubljana
|
Posted: Fri Aug 29, 2014 10:21 am Post subject: xmega E5 config timer problem |
|
|
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 |
|
|
albertsm
Joined: 09 Apr 2004 Posts: 5913 Location: Holland
|
Posted: Fri Aug 29, 2014 9:55 pm Post subject: |
|
|
the reason is that there is no tcd0 in this micro.
Only tcc4,tcc5 and tcd5 _________________ Mark |
|
Back to top |
|
|
andro
Joined: 12 Mar 2007 Posts: 94 Location: Ljubljana
|
Posted: Fri Aug 29, 2014 10:07 pm Post subject: |
|
|
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 |
|
|
albertsm
Joined: 09 Apr 2004 Posts: 5913 Location: Holland
|
Posted: Fri Aug 29, 2014 10:29 pm Post subject: |
|
|
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 |
|
|
andro
Joined: 12 Mar 2007 Posts: 94 Location: Ljubljana
|
Posted: Fri Aug 29, 2014 10:44 pm Post subject: |
|
|
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 |
|
|
andro
Joined: 12 Mar 2007 Posts: 94 Location: Ljubljana
|
Posted: Fri Aug 29, 2014 10:46 pm Post subject: |
|
|
|
|
Back to top |
|
|
|