View previous topic :: View next topic |
Author |
Message |
MHz
Joined: 28 Sep 2007 Posts: 123
|
Posted: Mon Feb 24, 2014 5:29 pm Post subject: config RC5 what wents wrong? |
|
|
my experience shows no effect definig different pins in
Config Rc5 = Pinb.1 , Timer = 1 , Mode = Background 'config RC5 receiver port
Config Portb.1 = Input
Portb.1 = 1
I allways have to connect the IR-receiver output at pinb.0 regardless of the config statement
Toggle a LED connected to portb.5 (the same port but different pin as for the IR-receiver connection) dosen't work either.
What's wrong in my code, my hardware setup?
Verry confused
-MHz
(BASCOM-AVR version : 2.0.7.7 ) |
|
Back to top |
|
|
rsavas
Joined: 10 Aug 2010 Posts: 197 Location: Baldwin, Ontario
|
Posted: Mon Feb 24, 2014 6:03 pm Post subject: |
|
|
The background mode will use a 16 bit timer in capture mode. It also means that you need to connect the IR-transmitter output pin to the ICP capture pin of the timer.
When using the background mode, you must specify a 16 bit timer. |
|
Back to top |
|
|
MHz
Joined: 28 Sep 2007 Posts: 123
|
Posted: Mon Feb 24, 2014 6:19 pm Post subject: |
|
|
Thank you rsavas! Reading and *understanding* the Help file helps a lot
However what happens with the LED at Portb.5?
Still confused |
|
Back to top |
|
|
kimmi
Joined: 24 Feb 2006 Posts: 1922 Location: Denmark
|
Posted: Mon Feb 24, 2014 8:45 pm Post subject: |
|
|
if you are using ISP programmer remember to disconnect programmer cable PB.5 is SCK pin
Arduino_Uno_Rev3 _________________ / Kim |
|
Back to top |
|
|
rsavas
Joined: 10 Aug 2010 Posts: 197 Location: Baldwin, Ontario
|
Posted: Mon Feb 24, 2014 8:52 pm Post subject: |
|
|
Quote: | However what happens with the LED at Portb.5? |
I do not know, if you are receiving a correctly encoded RC-5 bit stream in the first place!
How are you monitoring the received RC-5 bit stream?
Do you own a scope? If so, then do you get transitions out of the decoder? Do you have the correct pre-amble(start bits). Does the scope trace match what you are supposed to be transmitting?
Does RC-5 work without the background feature?
What is transmitting the RC-5 bit stream? Is it correct? Is it the correct modulation rate?
Need to do some debugging to determine what's going on.
Code: | Do
If _rc5_bits.4 = 1 Then 'is there RC5 code received
_rc5_bits.4 = 0 'you MUST reset this flag in order to receive a new rc5 command
CLS
Lcd "Address: " ; Rc5_address ' Address
Lcd "Command: " ; Rc5_command ' Command
Else
CLS
Lcd "waiting"
End If
Waitms 500
Loop
End |
Last edited by rsavas on Mon Feb 24, 2014 9:14 pm; edited 2 times in total |
|
Back to top |
|
|
kimmi
Joined: 24 Feb 2006 Posts: 1922 Location: Denmark
|
Posted: Mon Feb 24, 2014 8:55 pm Post subject: |
|
|
did you check your lcd setup ????
Config Lcdpin = Pin , Db4 = Portb.4 , Db5 = Portb.5 , Db6 = Portc.0 , Db7 = Portc.1 , E = Portb.3 , Rs = Portb.2 _________________ / Kim |
|
Back to top |
|
|
MHz
Joined: 28 Sep 2007 Posts: 123
|
Posted: Tue Feb 25, 2014 8:29 am Post subject: |
|
|
Solved! Thank you kimmi et all! |
|
Back to top |
|
|
|