Picproje Elektronik Sitesi

DERLEYİCİLER => PICBasic => Konuyu başlatan: elektroombank - 19 Ekim 2005, 03:14:22

Başlık: TK19'dan veriyi alma
Gönderen: elektroombank - 19 Ekim 2005, 03:14:22
Merhaba arkadaşlar

PIC16f84'e tk19'u bağlayıp bir kumandadan(RC5) gelene dataları algılayıp

PIC'imin ona göre işlem yapmasını istiyorum..Yani Mesela kumandadan 1 tuşuna bastı PORTB.1 ini logic 1 yapacağım.

RC5 sistemini inceledim ve anladım galiba.Ancak PIC basic Pro ile bu veriyi nası okuyacağım hakkında bir dokuman bulamadım..

Veriler tk19 üzerinden okumam konusunda yardımcı olursanız çok sevinirim.
Başlık: TK19'dan veriyi alma
Gönderen: bayramonur - 19 Ekim 2005, 14:19:24
Picbasic üreticilerinin(Proton ,Melabs) forum sayfalarına bak bir sürü kaynak kod bulacaksın.Zaten ençok kullanılan RC5 ve Sonny kumandalarını decoderları.Piyasadaki 90 kanal kumandaların çoğu RC5'i kullanıyor.
Başlık: TK19'dan veriyi alma
Gönderen: elektroombank - 19 Ekim 2005, 14:28:11
çok teşekkür ederim.Melabs a bakmıştım ama bulamadım.Herhalde ben bulamıyorum baya geniş bir site.Adres verebilirmisiniz..
Başlık: sonunda çalıştı ama
Gönderen: elektroombank - 22 Ekim 2005, 17:47:19
sonunda kodlarım çalıştı rolemi tetikledim amabi kere tetikledi diyelim.
20 kez basyom belki tetikliyror.Yani doğru dürüst çalışmoyr
herhalde kodlarımda osrun var bir incelermisiniz..

'Program SONY_RX.BAS

'Reads signals from a Sony IR remote control,
'and returns the button code in the variable IR_But.
'the device code in the variable IR_DEV,

'The infrared receiver module used is the Sharp IS1U60.

'The infrared receiver module for this experiment should,
'be a type that is set for a 40kHz carrier frequency.
'If another type is used. some reduction in range may be noticed.

'The remote control used, may be either a Sony manufactured unit,
'or one of the universal remotes that can be configured for Sony equipment.
'This is important since we are dealing with a specific signal protocol.

'With Sony's SIRC specification, a start pulse is initially sent to
'indicate the beginning of a frame of data. This pulse is approx 2.4 ms in length.
'Following this, are 5-bits of data, which represent the DEVICE code,
'which signifies the target device (TV, VCR, etc.).
'Then an additional 7-bit BUTTON code
'Data bits are sent with the most significant bit first (MSB).

  Include "Modedefs.Bas"
  Define OSC 4
  ADCON1 = 7
                 TRISA = %00000100

' ** Declare the Variables **
  Header Var Word   '
  Packet Var Word   '  
  P_Val   Var Byte   '  
  IR_But Var Byte   '     IR_Dev Var Byte   '
  Sony_LP Var Byte   '
  Red_LED Var PortB.6 '
  Green_LED Var PortB.1 '
IR_Sensor Var PortE.0 '
               SYMBOL LCDSTATUS=PORTC.0
HIGH LCDSTATUS

' ** THE MAIN PROGRAM LOOP STARTS HERE **

Again:
  Low Green_LED : Low Red_LED    
  Gosub IRIN                
  If IR_Dev=255 then goto Again
  If IR_Dev<>0 then goto Again  
  If IR_But=18 then High Green_LED  
               IR_But=19 then High Red_LED
              Pause 2000                  
              Goto Again                
IRIN:
  IR_Dev=255:IR_But=255
  Pulsin PortE.0,0,Header      
              If Header < 200 then Return  
               If Header > 270 then Return      
  For Sony_Lp=0 to 11  
  Pulsin PortE.0,0,P_Val  
              If P_Val >= 90 then
    Packet.0[Sony_Lp]=1
  Else   Packet.0[Sony_Lp]=0
  Endif
  Next            
  IR_But=Packet & %01111111       IR_Dev=(Packet >>7) & %00011111   Return




Kumandayı sony diye aldım .Üzerinde RM-887 yazıyor

Alcı gözüm tfms 5300


Bir türlü duzenli olarak çalışmadı kumanda ne yapmalıyım..