+ Post New Thread
Results 1 to 7 of 7
  1. #1
    Member level 2
    Points: 816, Level: 6

    Join Date
    Nov 2015
    Posts
    43
    Helped
    0 / 0
    Points
    816
    Level
    6

    [moved] 32bit input capture using PIC16f

    Hello

    I m working on project which operates on IR remote control. I have tested the output of IR remote through TSOP using Arduino it is giving 32bit Word.
    Problem:

    How i can Capture 32bit data from pic16f18856. In this microcontroller cature register is of only 16bit wide.

    •   AltAdvertisment

        
       

  2. #2
    Super Moderator
    Points: 252,835, Level: 100
    Awards:
    1st Helpful Member

    Join Date
    Jan 2008
    Location
    Bochum, Germany
    Posts
    44,050
    Helped
    13403 / 13403
    Points
    252,835
    Level
    100

    Re: 32bit input capture using PIC16f

    By using timer interrupt and counting overflows of capture register.



  3. #3
    Super Moderator
    Points: 77,476, Level: 67
    Achievements:
    7 years registered
    Awards:
    2nd Helpful Member
    betwixt's Avatar
    Join Date
    Jul 2009
    Location
    Aberdyfi, West Wales, UK
    Posts
    12,687
    Helped
    4235 / 4235
    Points
    77,476
    Level
    67

    Re: 32bit input capture using PIC16f

    Probably simpler is to make a 32-bit shift register from four 8-bit registers. The PICs have useful RLF/RRF instructions that make it easy to chain registers in only two instructions. All you need to do is clock the data, either by using fixed timing or by looking for the pulse edges.

    Brian.
    PLEASE - no friends requests or private emails, I simply don't have time to reply to them all.
    It's better to share your questions and answers on Edaboard so we can all benefit from each others experiences.



    •   AltAdvertisment

        
       

  4. #4
    Super Moderator
    Points: 252,835, Level: 100
    Awards:
    1st Helpful Member

    Join Date
    Jan 2008
    Location
    Bochum, Germany
    Posts
    44,050
    Helped
    13403 / 13403
    Points
    252,835
    Level
    100

    Re: 32bit input capture using PIC16f

    Capture mode makes use of the 16-bit Timer1 resource. When an event occurs on the capture source, the 16-bit CCPRxH:CCPRxL register pair captures and stores the 16-bit value of the TMR1H:TMR1L register pair, respectively.
    To capture time intervals exceeding 16-bit timer range, count timer interrupts. Or use a processor with 32-bit timers respectively 16-bit timer cascading feature.



  5. #5
    Advanced Member level 4
    Points: 7,988, Level: 21
    Achievements:
    7 years registered
    paulfjujo's Avatar
    Join Date
    Jun 2008
    Location
    France 01120
    Posts
    1,301
    Helped
    263 / 263
    Points
    7,988
    Level
    21

    Re: [moved] 32bit input capture using PIC16f

    hello,

    the frequency of data bit on IR remote control is slow enough , to direct store result inside a long word (32 bit)
    or in a table of 32 element ( even using a byte to store one bit )



    •   AltAdvertisment

        
       

  6. #6
    Super Moderator
    Points: 70,924, Level: 64
    Achievements:
    7 years registered
    Awards:
    Most Frequent Poster 3rd Helpful Member

    Join Date
    Apr 2014
    Posts
    14,515
    Helped
    3302 / 3302
    Points
    70,924
    Level
    64

    Re: [moved] 32bit input capture using PIC16f

    Hi,

    Maybe you misunderstand the capture functionality.

    The result of a capture is a timestamp of a signal edge.
    Each signal edge may cause a timestamp... it depends on the capture function setup.

    A capture result will never directly give the value of a serial dataword.

    Klaus
    Please don´t contact me via PM, because there is no time to respond to them. No friend requests. Thank you.



  7. #7
    Super Moderator
    Points: 77,476, Level: 67
    Achievements:
    7 years registered
    Awards:
    2nd Helpful Member
    betwixt's Avatar
    Join Date
    Jul 2009
    Location
    Aberdyfi, West Wales, UK
    Posts
    12,687
    Helped
    4235 / 4235
    Points
    77,476
    Level
    67

    Re: [moved] 32bit input capture using PIC16f

    Kiransbaddi, it would help if you told us whether you are trying to read the data bits so you can see how they are encoded or whether you are trying to use the PIC capture mode to measure how long each bit lasts for.

    I think there is confusion because of the wording of your question, 'input capture' has a specific meaning on PIC devices because they have the ability to measure how long a signal is present at their input pins using a timer. If you are trying to read the sequence of 1 and 0 bits in an IR command, a software shift register is what you need.

    Brian.
    PLEASE - no friends requests or private emails, I simply don't have time to reply to them all.
    It's better to share your questions and answers on Edaboard so we can all benefit from each others experiences.


    1 members found this post helpful.

--[[ ]]--