Embedded Products


Information

Head Office:
Embedded Market
205, Decision Tower, Next To CityPride,
Satara Road, Pune 411037 India
Phone Numbers
(During working hours)
For Sales :
+91 70 57 57 56 13

Accounts & Dispatch:
+91 20 24228818
Mon-Fri : 9.30 am to 5.00 pm
Sat: 9.30 am to 12.30 pm
For Support : Login
Holiday : Sunday, National holidays & few local festival days
Online order is compulsory for everyone.

Tutorial - Source code for interfacing TSOP1738 RC5 with 8051 Microcontroller

Posted on : Monday, February 21, 2011 For Product: Practical Course For ATMEL Microcontrollers - Upgraded
  This product is no more manufactured. Practical Course For ATMEL Microcontrollers - Upgraded

TSOP1738 RC5 Interfacing with 8051 Microcontroller

Product Tutorial by
Tech-Support Team @ www.EmbeddedMarket.com
Copyright Article


The TSOP1738 is Infrared receiver.

RC5 is the IR transmission protocol developed by Philips. This was used for remots of TV & other equipments.

The PCAM+ kit is equipped with on board TSOP1738. The code below is used to decode the RC5 signal transmitted by the TV remote.

TV Remote is included with the PCAM+ product.

To complete the assignment you will need:

1. Product - PCAM+ (Practical Course For ATMEL Microcontrollers - Upgraded)
2. HandyProg-USB Programmer for 89S52 (Included with the PCAM+ kit)
3. RC5 TV Remote (Included with the Kit)
4. Single pin female to female connectors - 1 + 8

Port Pin P3.3 is connected to the output pin of TSOP1738, which is marked as IR38 on the PCAM+ board.

Connect 8 LEDs to Port P2 to see the decoded output.

8 LEDs will show binary value of the Switch pressed on TV remote.

RC5 TV Remote for Philips


IMP: Use remote which is supplied with the kit. Other remotes from market will not work.

Below is the source code written in 8051IDE:

VAR1 equ 07h             ;Variable for delay
VAR2 equ 08h             ;Variable for delay
TEMP equ 10H           ;Temp variable
COUNT equ 11H        ;Count variable
ADDR equ 12H           ;Device address received from RC5
CMD equ 13H             ;Command value received from RC5
FLIP bit 00H                ;Flip bit
TOG bit 01H                ;Temp bit for flip
IR equ P3.3                 ;IR Receiver connected to this pin
 
 
MOV SP,#60H            ;Stack pointer initialization
CLR TOG                       ;Clear temp bit
 
MAIN:
        JB IR,$               ;Wait for first bit

        MOV VAR2,#6h
        Delay3024:
                MOV VAR1,#229           ;3.024mS delay
                DJNZ VAR1,$
        DJNZ VAR2,Delay3024


        MOV C,IR  ;Read Flip bit       

        MOV FLIP,C
        CLR A
        MOV COUNT,#5         ;Count for address
        Get_Address:
                ACALL DELAY_1728ms
                MOV C,IR
                RLC a
                DJNZ COUNT,Get_Address
                MOV ADDR,A  ;Save the address
                CLR A

        MOV COUNT,#6         ;Count for Command
        Get_COMMAND:
                ACALL DELAY_1728ms
                MOV C,IR
                RLC A
                DJNZ COUNT,Get_COMMAND
                MOV TEMP,CMD         ;Save the old command
                MOV CMD,a  ;Save the new command
                MOV A,ADDR  ;Cheack for valid address
                CJNE A,#00,INVALID
                MOV A,TEMP
                CJNE A,CMD,VALID ;Check for valid command

        INVALID:
                LJMP MAIN
        VALID:   
                CLR A
                MOV C,FLIP
                RLC A
                MOV TEMP,A
                CLR A
                MOV C,TOG
                RLC A
                CJNE A,TEMP,VALID1
        SJMP INVALID
        VALID1:
                MOV C,FLIP
                MOV TOG,C
                MOV A,CMD
                CLR C
                MOV P2,CMD
        LJMP MAIN


DELAY_1728ms:
 MOV VAR2,#6d
 Loop1728:
 mov VAR1,#128         ;1.728mS delay for each bit
 djnz VAR1,$
 DJNZ VAR2,Loop1728
RET


Save this code, assemble it and flash it to the PCAM+ kit with 89S52 using HandyProgUSB Programmer.

Make connection as described above. You should see the Binary value for each switch press of TV remote.



EmbeddedMarket.com has delivered products to various cities in India including , chennai, kharagpur, pune, Abu road, Agartala, Agra, Ahmedabad, Ahmedabad-380058, Ahmednagar, Aizawl, Ajmer, Akola, Alappuzha, Alapuzha, Alibag, Aligarh, Allahabad, Alleppey, Alto-dabolim, Aluva, Alwar, Ambala, Ambernath, Ambikapur, Amravati, Amritsar, Anand, Anantapur, Andheri, Andheri east, Angamaly, Angul, Ankleshwar, Aruppukottai, Asansol, Auranagabad, Aurangabad , Aurangabad. , Austin, Baddi, Bagalkot, Balngalore, Banagalore, Banaglore, Bandel, Bangalore, Baramati, Baroda, Barshi, Bathinda, Belgaum, Bellary, Bengaluru, Benguluru, Berhampur, Bhadravati, Bhandara, Bharatpur, Bharuch, Bhavnagar, Bhavnagar-364 001, Bhilai, Bhilai, distt - durg, Bhilwara, Bhimavaram, Bhiwandi, Bhiwani, Bhopal, Bhubaneswar, Bhubaneswer, Bhubhaneswar, Bhuj, Bilaspur, Boisar, Bolpur, Bombay, Bongaon, Borsad, Bulandshahr, Burdwan, Calicut, Cannanore, Carson city, Chakan,pune , Chanchal, Chandigarh, Chas, Chengalpattu, Chennai, Chennai, india, Chennau, Chidambaram, Chinchwad, Chittoor, Cochin, Coimbatore, Coimbatore ,, Coos bay, Coppet, Csir road, taramani, chennai, Csm nagar, Cuddalore, Cuddalore district, Cuttack, Dabhoi, Dakor, Dakpathar, Deharadun, Dehradun, Delhi, Dhamtari, Dhanbad, Dharmanagar, Dharwad, Dhule, Dibrugarh, Dindigul, District- kurukshetra, Dombivili, Dombivli, Durg, Durgapur, Ernakulam, Ernakulum, Ernamkulam, Erode, Faizabad, Faridabad, Faridkot, G.b. nagar, Gandhinagar, Gandhinagar - , Gangtok, Gauttam budhha nagar, Gaziabaad, Gazibad, Ghaziabad, Goa, Golaghat, Gorakhpur, Greater noida, Gujarat, Guna, Guntur, Gurdaspur, Gurgaon, Guwahati, Gwalior, Hapur, Hardwar, Haridwar, Harihara, Haripura, Hassan, Hauzkhas, Hazaribagh, Himatnagar, Ho chi minh, Hodal, Hoshiarpur, Howrah, Hubli, Hukkeri, Hydarabad, Hyderabad, Hyderabad., Hyderbad, Ichalkaranji, India, Indore, Jabalpur, Jaipur, Jakarta selatan, Jalandhar, Jalandhar city, Jalgaon, Jammu, Jamnagar, Jamshedpur, Jaspur, Jaysingpur, Jhunjhunu, Jodhpur, Junagadh, Kadampanad, Kadi, Kahangad, Kaithal, Kakinada, Kalamassery, kochi, Kalambaste, Kalpakkam, Kalyan, Kalyan east , Kalyan west, Kancheepuram, Kanchipuram, Kannur, Kannur., Kanpur, Kanyakumari district, Karad, Karaikal, Karaikudi, Karkala, Karnal , Karunagappally, Kasaragod, Katpadi, Kesinga, Khammam, Khandwa, Khanna, Kharagpur, Khopoli, Kochi, Kochi,, Kolahpur, Kolar gold field, Kolhapur, Kolkata, Kolkata,, Kollam, Komarapalayam, Kopargaon, Kopergaon, Kota, Kota jn, Kotkapura, Kottayam, Kozhikode, Kumarganj, dakshin dinajpur, Kurnool, Kurukshetra, Lalitpur, Lashkar gwalior, Latur, Lausanne, Lonavala, Lonavla, London, Lucknow, Ludhiana, Machilipatnam, Madhyamgram, Madurai, Madurai-2, Mahadevapura, bangalore, Mahape, navi mumbai, Mahesana, Malappuram, Malviya nagar, Mandi, Mangalore, Mangalore, surathkal, Manglore, Manipal, Manipal, udupi, Mapusa, Marcela, Margao, Margaon, Mathura, Meerut, Mehsana, Melur, Mettur dam, Mhow, Mhow, district - indore, Miraroad, thane, Modinagar (ghaziabad), Mohali, Moradabad, Morjim, Moti nagar, Mumbai, Mumbai thane , Mysore, Nadiad, Nagpur, Nalgonda, Nalla sopara, Namakkal district, Namrup, Nanded, Nandyal, kurnool-district, Nashik, Nasik, Navi mumbai, Navsari, Nazareth, Nazira, Neemuch, Nellore, Nellore dt, New delhi, New mumbai, New perungalathur, Neyveli, Neyveli-3, Nipani, Nit faridabad, Noida, Noida / gautam budh nagar, Ongole, Osmanabad, Palakkad, Palamaner, Pampady, Panaji, Panajim, Panchkula, Panjim, Pantnagar, Panvel, Parkala, udupi district, Parwanoo, Patan, Patan(north gujarat), Pathankot, Patiala, Patna, Payyanur, Penugonda, Petlad, Phagwara, Pilani, Pimple nilakha, pune, Pollachi, Ponda, Pondicherry, Ponkunnam, Porvorim, Powai, Puducherry, Pudukkottai, Pun, Pune, Pune / maharashtra, Pune 37, Pune, maharashtra, Punr, Puri, Raebareli, Raigarh, Raipur, Rajahmundry, Rajapalayam, Rajkot, Rajsamand, Ramachandrapuram, Ramgarh cantt., Ramnthapuram, Rampur, Ranchi, Raniganj, Ratnagiri, Renigunta, Ribandar, Rishikesh, Rohtak, Roorkee, Rourkela, Saharanpur, Salem, Samalkot, Sangli, Sangola, Sas nagar, mohali, Saswad, Satara, Sector 82, noida, Secunderabad, Secunderbad, Secundrabad, Shahdara, Shevgaon, Shimoga, Shirpur,dhule, Siliguri, Silvassa, Sindhanur, Singapore, Siolim, Sivakasi, Sivasagar, Sojitra, Solan, Solapur, Sonepat, Sonipat, South goa, Sriharikota, Srinagar, Srinagar garhwal, Surat, Surathkal, Suratkal, Surendranagar, Talegaon dabhade, Talod, Tamluk, Tanuku, Tezpur, Thalassery, Thane, Thane (w), Thane [ west ] 400607, Thane west, Thane(west), Thane-west, Thanjavur, Theni, Thiruvalla, Thiruvallore, Thiruvananthapuram, Thiruvanathapuram, Thiruvannamalai, Thiruvannamalai district, Thookkupalam , Thrissur, Tiruchengode, Tiruchirapalli, Tiruchirappalli, Tirunelveli, Tirupati, Tirupur, Tirupur., Tirur, Tiruvannamalai, Trichur, Trichur, , Trichy, Trivandrum, Tumkur, Tuticorin, Udaipur, Udupi, Ujjain, Ulhasnagar, Up, V. v. nagar, Vadodara, Vadododara, Vallab vidya nagar, Vallabh vidyanagar, Valsad, Vapi, Varanasi, Vasai, Vasai east , thane district, Vasai road, Vasai road (west), Vasc-da-gama, Vasco, Vasco da gama, Vasco-da-gama, Vashi, navi mumbai, Vellore, Verna, Vidisha, Vijapur, Vijayawada, Virar (west), Virudhunagar, Visakhapatnam, Vithalwadi(w), Vizianagaram, Warangal, Wardha, Warje malwadi,pune, Yamuna nagar, Yamunanagar, Yeola, Zirakpur, Zuari nagar, Zuarinagar