View previous topic :: View next topic |
Author |
Message |
Tubeampman
Joined: 27 Feb 2006 Posts: 100 Location: Bodo
|
Posted: Sun Mar 09, 2014 5:50 pm Post subject: Atmega1284P timer 3 |
|
|
Hi
Can someone please help me With the timer 3 on an Atmega1284P.
I need two 16bit Counters, the timer 1 and 3 is 16bit
When i compile i get error on "TCNT3", maby timer 3 isnt supported in bascom?
Here is the testprogram i use:
$regfile= "m1284pdef.dat"
$crystal=4000000
Config Timer1 = Counter , Edge = Rising
enable TIMER1
Config Timer3 = Counter , Edge = Rising
enable TIMER3
dim A as word
dim B as word
waitms 100
cursor off
CLS
do
A = TCNT1
B = TCNT3
locate 1,1 : lcd "Val A= "; A
locate 2,1 : lcd "Val B= "; A
loop
Best Regards
Øyvind
(BASCOM-AVR version : 2.0.7.7 ) |
|
Back to top |
|
|
Frankeman
Joined: 11 Aug 2004 Posts: 948 Location: the Netherlands
|
Posted: Sun Mar 09, 2014 7:18 pm Post subject: |
|
|
hi,
The word TCNT3 don't become red in the IDE.
This means that it is not recognised.
I think the M1284PDEF.DAT file is not correct.
Write to support fot help.
Frank. |
|
Back to top |
|
|
MWS
Joined: 22 Aug 2009 Posts: 2262
|
Posted: Sun Mar 09, 2014 8:50 pm Post subject: |
|
|
Either add it into the dat yourself, it belongs in the [WIO] section, or use it the classic way:
Code: | A = Timer1
B = Timer3 |
|
|
Back to top |
|
|
Evert :-)
Joined: 18 Feb 2005 Posts: 2156
|
Posted: Sun Mar 09, 2014 9:01 pm Post subject: |
|
|
If you open the m1284pdef.dat and go to the [WIO] section, add there below the TCNT1 line;
Code: |
TCNT3 = $94 ; MEMORY MAPPED
|
_________________ www.evertdekker.com Bascom code vault |
|
Back to top |
|
|
Tubeampman
Joined: 27 Feb 2006 Posts: 100 Location: Bodo
|
Posted: Sun Mar 09, 2014 10:26 pm Post subject: |
|
|
Hi
Thanks to all that took the time to look into my problem.
I did as MWS and Evert sugested, it did the trick
Øyvind |
|
Back to top |
|
|
|