Need help in program for remote control using PIC16F84A


Closed Thread
Results 1 to 8 of 8

Hybrid View

  1. #1
    Join Date
    Jul 2006
    Location
    Southern California, U.S.A.
    Posts
    7

    Default Need help in program for remote control using PIC16F84A

    Hello all,

    I am new to PIC programming and am using a PIC16F84A. I would like to program it to make one of the pins go "high" when, and only when the input pins accept a certain binary code and in a particular order. Example:

    Pin 6 is low, pin 7 is high, pin 8 is low and pin 9 is low. That would be the binary code "0100" or simply the binary code for the number "4"

    The next inputs would be:
    Pin 6 is high, pin 7 is low, pin 8 is low and pin 9 is high. That would be the binary code "1001" or simply the binary code for the number "9"

    And finally:
    Pin 6 is low, pin 7 is low, pin 8 is high and pin 9 is low. That would be the binary code "0010" or simply the binary code for the number "2"

    After that sequence has been completed, I want to have the output of another pin go "high"

    The binary codes that are inputed into the PIC are generated from the output of a DTMF decoder. In other words, I want to press "492" on a touch tone keypad and have it activate a project. Basically I want to control a project remotely from a telephone.

    Any help on the source code would be appreciated. Like I said, I am very new to programming but enjoy designing electronic circuits.

    Darren

  2. #2
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Default

    help us a little bit and provide your DTMF decoder chip model.
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

  3. #3
    Join Date
    Jul 2006
    Location
    Southern California, U.S.A.
    Posts
    7


    Did you find this post helpful? Yes | No

    Default

    I use the 8870 chip. It is an 18 pin DIP. Its input is DTMF from a phone or receiving radio. The output is a binary code ( four pins ). The only place I have seen this decoder is at BG micro.com out of Texas. I have used several of them and they always work perfect. I want to run the four output pins of the 8870 to four inputs on the PIC MCU 16F84a. The 8870 DTMF decoder holds the output constant until a new tone is entered in. In other words, if I touch the number 3 key on a touch tone phone, the output on the 8870 would be "0011" until I touched another key.

    Furthermore, I am using an epic programmer from ME lab and the PicBasic compiler (if that helps). And let me remind you, I'm an idiot when it comes to programming these things. I'm just getting started. Thanks for the reply. Any help would be appreciated.

    Darren

  4. #4
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Default

    Sounds simple to me. Any schematic could be handy to start.
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

  5. #5
    Join Date
    Jul 2006
    Location
    Southern California, U.S.A.
    Posts
    7


    Did you find this post helpful? Yes | No

    Default

    I put together a schematic of the project I am designing. Sorry that it is a little "scrunched" but I assume you don't have the software that I am using to design it. It was difficult to get the entire schematic on the screen at one time. I designed it on Livewire by New Wave Concepts. I converted the image to a JPEG photo and am sending it as an attachment for your ease of viewing. Thanks again for your input. ( let's see if I am actually successful in attaching the photo, hahahaha)

    Darren
    Attached Images Attached Images  

  6. #6
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Default

    the most inefficient way but easy to follow.
    Code:
    LOW PORTB.4
    Key var byte
    
    start:
        Key=(PORTB&$0F) rev 4
        If Key<>4 then Start
        While key 
            Key=PORTB&$0F 
            wend 
        pause 50
    
        Wait2nd: 
            Key=(PORTB&$0F) rev 4
            if key=0 then Wait2nd
            If Key<>9 then Start
            While key 
                Key=PORTB&$0F 
                wend 
            pause 50
    
        Wait3rd:
            Key=(PORTB&$0F) rev 4
            if key=0 then Wait3rd
            If Key<>2 then Start
        
        HIGH PORTB.4    
    Spin:
        goto spin
    Last edited by mister_e; - 16th July 2006 at 20:30.
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

Similar Threads

  1. Octave synthesizer PIC program for PIC16f84A
    By esgrimae in forum Code Examples
    Replies: 0
    Last Post: - 21st July 2009, 04:15
  2. Making Program Code Space your playground...
    By Melanie in forum Code Examples
    Replies: 15
    Last Post: - 19th July 2008, 08:26
  3. Replies: 4
    Last Post: - 16th May 2008, 14:35
  4. Disabling bootloader under program control
    By Charles Linquis in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 14th March 2007, 15:35
  5. control servo motor by using pic16F84A
    By waterlee2000 in forum PBP Wish List
    Replies: 10
    Last Post: - 23rd June 2006, 14:31

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