View previous topic :: View next topic |
Author |
Message |
moreau
Joined: 27 Jan 2005 Posts: 46
|
Posted: Wed Nov 25, 2015 11:21 am Post subject: rc5 backgorung and dcf77 |
|
|
Hello,i need use rc5 and dcf77 simultaneously but..
rc5 in background mode need timer1, dcf77 need timer1. test to use a 16 bit timer like timer3 won't work.
I'm using a atmega128 with ir connected to pe7 (ic3).
Config Rc5 = Pine.7 , Timer = 3 , Mode = Background ->.equ tifr3 not found
How to do to use timer3 for rc5 ? if possible.
Thank you
:roll:
(BASCOM-AVR version : 2.0.7.8 ) |
|
Back to top |
|
|
albertsm
Joined: 09 Apr 2004 Posts: 5913 Location: Holland
|
Posted: Thu Nov 26, 2015 4:47 pm Post subject: |
|
|
the m128 has a diffrent register name.
you could add this to the code :
CONST TIFR3=ETIFR
config rc5 .... _________________ Mark |
|
Back to top |
|
|
moreau
Joined: 27 Jan 2005 Posts: 46
|
Posted: Thu Nov 26, 2015 5:48 pm Post subject: rc5 and dcf |
|
|
thanks too much, you saved me
d. |
|
Back to top |
|
|
daro
Joined: 15 Nov 2010 Posts: 25
|
Posted: Sun Mar 12, 2017 9:15 pm Post subject: Background& Prescaler? |
|
|
I have also problem witch
Code: | Config Rc5 = Pine.7 , Timer = 3 , Mode = Background |
Using ATmega64, and compilator show error:
Error : 96 Line : 43 Prescale value must be 1,8,64,256 or 1024 [ 16] , in File : E:\!Elektronika\!Moje projekty\Dariusz Kloc\Aktualne, zaczęte, w trakcie opracowywania\Sterownik tablicy i zegara\Code Safe table\Safe_table_v_1.bas
When change Confor RC5 from old:
Code: | Config Rc5 = Pine.6 , Wait = 2000 |
to Background mode...
I used also Timer 1 but to countdown 1secounds but Timer1 also generated the same erros "prescale value must..."
Where is the problem?
There is all my configuration:
Code: | $regfile = "m64def.dat"
$crystal = 11059200 '
$hwstack = 192 'Stos Systemowy , Gosub , Interrup
$swstack = 192 'Sub , Function
$framesize = 192 'Byval , Local , Print , Lcd , Input
$prog &HFC , &HAE , &HC9 , &HFF ' generated. Take care that the chip supports all fuse bytes.
$lib "rc5.lib"
Config Adc = Single , Prescaler = Auto , Reference = Avcc
Config 1wire = Portg.0
Config Sda = Portd.1 'I2C RTC
Config Scl = Portd.0 'I2C RTC
Config Spi = Hard , Interrupt = Off , Data Order = Msb , Master = Yes , Polarity = Low , Phase = 0 , Clockrate = 4 , Noss = 1
Config Com2 = 115200 , Synchrone = 0 , Parity = None , Stopbits = 1 , Databits = 8 , Clockpol = 0
Open "com2:" For Binary As #2
'On Urxc Rs485_isr
Config Timer1 = Timer , Prescale = 256 , Clear Timer = 1 , Compare A = Disconnect , Compare B = Disconnect
Ocr1a = 43199
On Oc1a Countdown
Config Watchdog = 2048
Config Aci = On , Compare = Off , Trigger = Falling
On Aci Write_eeprom 'przerwanie od komparatora do zapisu po zaniku napięcia
'Config Rc5 = Pine.6 , Wait = 2000 'RC5
Const Tifr3 = Etifr
Config Rc5 = Pine.7 , Timer = 3 , Mode = Background
Config Int4 = Falling
On Int4 Rtc_int |
Bascom AVR ver 2.0.7.8 |
|
Back to top |
|
|
Evert :-)
Joined: 18 Feb 2005 Posts: 2156
|
Posted: Sun Mar 12, 2017 10:00 pm Post subject: |
|
|
according the help file you can only use timer 0(default) or timer 2 (if your chip has timer 2) and not timer 3.
Code: |
Config Rc5 = Pine.7 , Timer = 2 , Mode = Background
|
_________________ www.evertdekker.com Bascom code vault |
|
Back to top |
|
|
daro
Joined: 15 Nov 2010 Posts: 25
|
|
Back to top |
|
|
|
|
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
|
|