joy_shukla
Junior Member level 2
Hello Freaks,
i am using atmega8 & programming it in bascom ..
i want to send a rc5 code using send rc5 command and receive the same code (retro-reflect) .. that is my application ..
Now, i have successfully sent rc5 code using sendrc5 command & it worked perfectly also i have successfully decoded rc5 command of remote and displayed it on lcd .. (both independently)
so both the things are working perfectly independently, but it doesn't work when i use both togather ..
Connections of my board are
pb0-sensor
pb1-emitter
pc4 & pc5 - active low led
my bascom program is as bwlow :
$regfile = "m8def.dat"
$crystal = 12000000
$lib "mcsbyte.lbx"
'Config Porta = Output
'Config Portb = Output
'Config Portd = Input
'Config Porta.7 = Input
Config Portc = Output
Config Portb.0 = Input
Config Portb.1 = Output
'Config Lcd = 16 * 2
'Config Lcdpin = Pin , Db4 = Pinb.2 , Db5 = Pinb.3 , Db6 = Pinb.4 , Db7 = Pinb.5 , E = Pinb.1 , Rs = Pinb.0
Config Adc = Single , Prescaler = Auto , Reference = Avcc
Start Adc
Dim S1 As Word
Dim S2 As Word
Dim S3 As Word
'Config Timer1 = Timer , Prescale = 1024
'On Ovf1 Timer1_isr
'Enable Timer1
'Timer1 = &HC2F7
Config Rc5 = Pinb.0
Dim Address As Byte , Command As Byte , Togbit As Byte , Address_send As Byte , Command_send As Byte
Enable Interrupts
Address_send = 0
Command_send = 12
Togbit = 0
Set Portc.4
Set Portc.5
Do
Rc5send Togbit , Address_send , Command_send
Getrc5(address , Command)
Command = Command And &B01111111
If Command = 12 Then
Reset Portc.5
Else
Set Portc.5
End If
Loop
End
so my led(pc5) blinks when i send power button(12) from remote
(so receiver working )
and also , another board of sensor receives command 12 when put ir in front of sensor .. (so ir working)
hope u could understand my problem
Pls reply ..
Thank you
i am using atmega8 & programming it in bascom ..
i want to send a rc5 code using send rc5 command and receive the same code (retro-reflect) .. that is my application ..
Now, i have successfully sent rc5 code using sendrc5 command & it worked perfectly also i have successfully decoded rc5 command of remote and displayed it on lcd .. (both independently)
so both the things are working perfectly independently, but it doesn't work when i use both togather ..
Connections of my board are
pb0-sensor
pb1-emitter
pc4 & pc5 - active low led
my bascom program is as bwlow :
$regfile = "m8def.dat"
$crystal = 12000000
$lib "mcsbyte.lbx"
'Config Porta = Output
'Config Portb = Output
'Config Portd = Input
'Config Porta.7 = Input
Config Portc = Output
Config Portb.0 = Input
Config Portb.1 = Output
'Config Lcd = 16 * 2
'Config Lcdpin = Pin , Db4 = Pinb.2 , Db5 = Pinb.3 , Db6 = Pinb.4 , Db7 = Pinb.5 , E = Pinb.1 , Rs = Pinb.0
Config Adc = Single , Prescaler = Auto , Reference = Avcc
Start Adc
Dim S1 As Word
Dim S2 As Word
Dim S3 As Word
'Config Timer1 = Timer , Prescale = 1024
'On Ovf1 Timer1_isr
'Enable Timer1
'Timer1 = &HC2F7
Config Rc5 = Pinb.0
Dim Address As Byte , Command As Byte , Togbit As Byte , Address_send As Byte , Command_send As Byte
Enable Interrupts
Address_send = 0
Command_send = 12
Togbit = 0
Set Portc.4
Set Portc.5
Do
Rc5send Togbit , Address_send , Command_send
Getrc5(address , Command)
Command = Command And &B01111111
If Command = 12 Then
Reset Portc.5
Else
Set Portc.5
End If
Loop
End
so my led(pc5) blinks when i send power button(12) from remote
(so receiver working )
and also , another board of sensor receives command 12 when put ir in front of sensor .. (so ir working)
hope u could understand my problem
Pls reply ..
Thank you