Infrared learning remote control based on stc89c52 single chip microcomputer

In smart TVs and network set-top boxes (TV boxes), the most common remote control methods are infrared and Bluetooth. In recent years, Bluetooth remotes have gained increasing attention from both manufacturers and users due to their advantages such as "no need for line-of-sight," "ability to control through obstacles," and "longer range." However, many users still prefer infrared remotes, mainly because current Bluetooth remotes suffer from various issues that can disrupt daily use. A highly detailed infrared learning remote control is designed with code stored in an AT24C64 chip. The assembly subroutine is pre-written, and during your own design, you only need to modify the IO calls. This has been verified in my project and can learn most of the commonly used infrared remote controls in the market. ![Infrared Learning Remote Control Based on STC89C52 Single-Chip Microcontroller](http://i.bosscdn.com/blog/pI/YB/AF/qqJueAIih1AAZVlDFaXR4602.png) This system uses the STC89C52 microcontroller, and below is the corresponding assembly code: ;********************************** ;---------------------AT24C64 CODE------------------------- ;========================================================== ICSTART: ; I2C start SETB SDA NOP NOP NOP NOP SETB SCK NOP NOP NOP NOP CLR SDA NOP NOP NOP NOP CLR SCK RET ICSTOP: ; I2C stop CLR SDA NOP NOP NOP NOP CLR SCK NOP NOP NOP NOP SETB SCK NOP NOP NOP NOP SETB SDA RET ICACK: ; I2C acknowledge CLR SDA NOP NOP NOP NOP SETB SCK NOP NOP NOP NOP CLR SCK RET NOACK: ; I2C no acknowledge SETB SDA NOP NOP NOP NOP SETB SCK NOP NOP NOP NOP CLR SCK RET ICREADBIT: ; Read one bit SETB SDA NOP NOP NOP NOP SETB SCK NOP NOP NOP NOP MOV C, SDA CLR SCK RET ICREADACK: MOV R7, #200 SETB SDA NOP NOP NOP NOP SETB SCK NOP NOP NOP NOP READACKS: JNB SDA, ACKEND DJNZ R7, READACKS SETB C CLR SCK RET ACKEND: CLR C CLR SCK RET ICREADBYTE: ; Read a byte MOV R7, #8 READLOOP: LCALL ICREADBIT RLC A DJNZ R7, READLOOP MOV R7, A RET ICWRITEBIT: ; Write one bit MOV SDA, C NOP NOP NOP NOP SETB SCK NOP NOP NOP NOP CLR SCK RET ICWRITEBYTE: ; Write a byte MOV A, R7 MOV R7, #8 WRITELOOP: RLC A LCALL ICWRITEBIT DJNZ R7, WRITELOOP RET READAT: MOV A, R7 ; Calculate the I2C address MOV B, #208 ; 144 MUL AB MOV R2, B MOV R3, A

RandM Tornado

9000 Puffs Disposable Vape,7000 Puffs Disposable Vape,9000 Puffs Vape

Longhua Manxueling Trading Company , https://www.mxlvape.com