This program is used in a colorful infrared remote control decoding program. The microcontroller uses PIC12F629. The software simulates three-way PWM output to drive the red, green and blue LEDs into eight groups with a total of 24 LEDs, realizing nine patterns such as single LED gradually bright and dim, two LEDs one bright and one dark, and colorful. It has a power-off memory function. The following is the decoding program.
;--------------------------------------------------------
;filename: 24LED_Remote.asm
; mcu: PIC12f629
; clock: 4 MHz for INTRC
; date: 2006/02/25
; writer: aLin
; IC type: PT2262IR
; Rosc: 470K
;--------------------------------------------------------
list p=pic12f629
#i nclude"p12f629.inc"
#define B_LED gpio,0 ; Green LED output port
#define G_LED gpio,1 ; Blue LED output port
#define R_LED gpio,2 ; Red LED output port
#define rem gpio,3 ;GP3/MCLR, define remote control input terminal
; Because when you hold down the PT2262 button
;PT2262 will continuously send out the code
; Set the ENABLE bit to detect whether the key has been released.
; If not released, no response
;For remote control type
#define enable user_reg,0 ;Receive enable bit
#define on_off user_reg,1 ;When this bit is 0, pressing the pattern selection key is invalid
#define go_next user_reg,2 ;When this bit is 1, jump to the next section
#define reset user_reg,3 ;When this bit is 1, turn off the display
#define unlock user_reg,4 ; used to coordinate with on_off position
;---------------------------------------------------------
; Define variables
;
r1 equ 20h ; used for d5ms subroutine
r2 equ
Previous article:PIC16F877A microcontroller (IIC bus + AT24C02 chip)
Next article:PIC microcontroller-stamping discharge monitoring
Recommended posts
- [AB32VG1 development board review] TF card and file reading and writing applications
- TheAB32VG1developmentboardisequippedwithaTFcardslot,anditsinterfaceisshowninFigure2.WhenaTFcardisinserted,file-leveloperationscanbeperformedwiththecooperationofthefilesystemthroughprogramprocessing.Sincethec
- jinglixixi Domestic Chip Exchange
- What if the IoT meter sends the data to my server first, and my server then pushes the data to the client's server?
- IftheIoTmetersendsthedatatomyserverfirst,andmyserverthenpushesthedatatotheclient'sserver,youseethemeaningisnotexpressedclearly,andthetitlewordlimitisreached.Alas,itisveryinconvenient.Ihavemadesuggestions
- 深圳小花 MCU
- Principles of Automatic Control (Shiqun)
- Adetailedandpractical"AutomaticControlPrinciples(includingModernControlTheory)VideoTutorial"taughtaccordingtothepostgraduateentranceexaminationstandards!ThisseriesofvideotutorialsistaughtbyShiQun,aPh.D.fromTsinghua
- EE大学堂 Training Edition
- FPGA Basics (I)
- Thanksforsharing Goodinformation,thanksforsharing!
- 至芯科技FPGA大牛 FPGA/CPLD
- Support the e-sports competition and get gifts for grabbing the building~~
- 【EventIntroduction】 The2019CollegeStudentElectronicDesignCompetitionisabouttobegin.Netizenswhoarepreparingtoparticipatethisyearhavealreadyenteredthebattlepreparationstate.Inordertoalloweveryonetofullycomm
- okhxyyo Electronics Design Contest
- 【2024 DigiKey Creative Competition】+ Realization of motion control mini-game
- #PrefaceThisdesignisjustasmalldesignthatrealizesthemovementofthecontrolledobjectthroughthesensorandrealizesthesomatosensorygame.Timeistight,manydetailsoftheoriginaldesignarenotrealized,andthesimplestcontrolled
- zsy-s DigiKey Technology Zone
- Naxin Micro and Xinxian jointly launched the NS800RT series of real-time control MCUs
- How to learn embedded systems based on ARM platform
- Summary of jffs2_scan_eraseblock issues
- Application of SPCOMM Control in Serial Communication of Delphi7.0
- Using TComm component to realize serial communication in Delphi environment
- Bar chart code for embedded development practices
- Embedded Development Learning (10)
- Embedded Development Learning (8)
- Embedded Development Learning (6)
Professor at Beihang University, dedicated to promoting microcontrollers and embedded systems for over 20 years.
- Intel promotes AI with multi-dimensional efforts in technology, application, and ecology
- ChinaJoy Qualcomm Snapdragon Theme Pavilion takes you to experience the new changes in digital entertainment in the 5G era
- Infineon's latest generation IGBT technology platform enables precise control of speed and position
- Two test methods for LED lighting life
- Don't Let Lightning Induced Surges Scare You
- Application of brushless motor controller ML4425/4426
- Easy identification of LED power supply quality
- World's first integrated photovoltaic solar system completed in Israel
- Sliding window mean filter for avr microcontroller AD conversion
- What does call mean in the detailed explanation of ABB robot programming instructions?
- Breaking through the intelligent competition, Changan Automobile opens the "God's perspective"
- The world's first fully digital chassis, looking forward to the debut of the U7 PHEV and EV versions
- Design of automotive LIN communication simulator based on Renesas MCU
- When will solid-state batteries become popular?
- Adding solid-state batteries, CATL wants to continue to be the "King of Ning"
- The agency predicts that my country's public electric vehicle charging piles will reach 3.6 million this year, accounting for nearly 70% of the world
- U.S. senators urge NHTSA to issue new vehicle safety rules
- Giants step up investment, accelerating the application of solid-state batteries
- Guangzhou Auto Show: End-to-end competition accelerates, autonomous driving fully impacts luxury...
- Lotus launches ultra-900V hybrid technology "Luyao" to accelerate the "Win26" plan
- EEWORLD University ---- TI-RSLK Module 3 - ARM Cortex M
- Application of diode emulation mode in synchronous buck
- What kind of signal does PA2 and PA3 give, so that VOUT can output a voltage of about 50V? And the waveform is controllable (pulse width, frequency, period...
- [Original] Play with pyboardCN V2 -- Using the pyboardCN three-axis accelerometer
- [Smart lock based on ESP32-S3] Unboxing post. I hope there are no brothers who unbox it later than me:)
- Experimental study on a new broadband magic T-type
- Help!! Can any expert provide me with a test circuit diagram for testing the performance of VDMOS power tube? I will be very grateful!
- "Playing with the Board" + Replaying MicroPython on the STM32F7DISC (5)
- Lenovo Yangtian: Covering small and medium-sized enterprises with dense channels
- EEWORLD University Hall----Basics of Motors and Traction (Petroleum University)