Need help building a simple IR learning remote with a PIC


Results 1 to 15 of 15

Threaded View

  1. #6
    Join Date
    Dec 2005
    Posts
    1,073


    Did you find this post helpful? Yes | No

    Default

    I was up working on this all night
    That's a shame. I can analyze any CCF code in a minute or two, including a graph of the code. A graph of the ON code is attached.

    What PIC do you plan to use? It's easy to get higher frequencies using hardware PWM. I do it with a PIC12F683 but you'll probably want more pins. There's an example program on the Reynolds Electronics website. Here's some test code that generates ~120kHz.
    Code:
    DEFINE OSC 8
    @ DEVICE PIC12F683, INTRC_OSC_NOCLKOUT
    @ DEVICE PIC12F683, MCLR_OFF
    
    TRISIO.2 = 0				'GPIO.2=Output
    PR2 = 17			        'PWM Period   117.7kHz
    CCPR1L = 8				'PWM Duty-Cycle  
    'CCP1CON = %00001100  			'PWM Mode
    T2CON = %00000100    			'Timer2=ON, 1:1 prescale
    OSCCON = %01110001                      'INT HF OSC 8MHz
    WHILE OSCCON.3>0: WEND                  'OSC startup timeout
    WHILE OSCCON.2=0: WEND                  'INT HF OSC stable
    'CCP1CON = 0 'PWM module off
    WHILE OSCCON.2>0 
      CCP1CON = %00001100 'PWM ON
      PauseUS 1000        'generate 1ms burst 
      CCP1CON = 0         'PWM OFF
      Low GPIO.2
      Pause 10            'pause 10ms
    WEND
    I get somewhat different values.
    • Carrier=38740
      Lead-in=4.259ms ON, 3.872ms OFF
      1-bit=1.187ms ON, 6.557ms OFF
      0-bit=3.665ms ON, 3.872ms OFF
      Lead-out=11.616ms ON, 92.928ms OFF
    If all codes use the same lead-in & lead-out, the binary codes are 1100 0001 11 and 1101 0001 01 for OFF & ON respectively.
    Attached Images Attached Images  

Similar Threads

  1. remote code learning
    By Bruce in forum Code Examples
    Replies: 20
    Last Post: - 21st February 2021, 15:38
  2. Simple RF remote control code
    By Bruce in forum Code Examples
    Replies: 13
    Last Post: - 22nd January 2014, 10:45
  3. No one-way approach to learning ir remote control frequencies
    By selbstdual in forum mel PIC BASIC Pro
    Replies: 41
    Last Post: - 22nd June 2007, 13:26
  4. Serial Pic to Pic using HSER
    By Chadhammer in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 11th March 2005, 23:14
  5. multiplexing IR array into PIC 16C7x
    By droptail in forum General
    Replies: 1
    Last Post: - 17th November 2004, 18:30

Members who have read this thread : 0

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts