need a project for PIC16F84


Closed Thread
Results 1 to 7 of 7
  1. #1
    Danish's Avatar
    Danish Guest

    Talking need a project for PIC16F84

    I Am Looking For A Project That Uses The Microcontroller PIC16F84 Or Any Other Microcontroller Can Someone Give Me A Schematic And Information The Project.

    I Will Really Appreciate It
    Thank You

  2. #2
    Join Date
    Feb 2004
    Location
    Germany
    Posts
    762


    Did you find this post helpful? Yes | No

    Default

    Danish,

    why are you posting the same thing in different categories?

    Please Click Here

    If you would spend some time reading on this forum you would find tons of examples.

    Even the PBP Manual has some examples including schematics.
    regards

    Ralph

    _______________________________________________
    There are only 10 types of people:
    Those who understand binary, and those who don't ...
    _______________________________________________



  3. #3
    Danish's Avatar
    Danish Guest


    Did you find this post helpful? Yes | No

    Default Help Problem With Program

    HI ANYONE HELP ME OUT HERE BECAUSE I WROTE THIS PROGRAM AND IT COMMING UP WITH THE COMPILING ERROR AND ALSO I AM USING THE PICBASIC COMPILER AND THE EVERY TIME I COMPILE THE ERROR COMES UP THAT THIS TWO LINES ARE WRONG THE LINES THAT HAVE A *** NEXT TO THEM MEANS THAT THEY ARE THE LINES THAT HAD THE ERROR AND ALSO BELOW IS THE PROGRAM THIS PROGRAM HAS TWO SWITCHES ONE INCRESE THE DELAY OF THE BINARY COUNTING LEDS AND ONE TO DECREASE. I DIDN'T COMPILE YET BECAUSE IT KEEPS COMING UP WITH THE COMPILING ERRORS AND ALSO I TRIED MAKING SOME CHANGES IN THE PROGRAM AND I FOUND SOME MISTAKES OF MY OWN AND I FIXED THEM BUT STILL ITS NOT WORKING SO CAN ANYONE HELP ME OUT WITH THIS.


    'PROGRAM 4.2
    SYMBOL TRISB = 134 'SET TRISB TO 134
    ***SYMBOL TRISB = 6 'SET PORT B TO 6
    B1 = 0:B2 = 0
    SYMBOL DELAY = W4 'INITILAIZE DELAY VARIABLE
    W4 = 250 'INITIALIZE VARIABLE TO 250 MS DELAY
    'INITIALIZE PORT(S)
    POKE TRISB,192 'SET PORT B PINS 0-5 TO OUTPUT, PINS 6 AND 7
    'TO INPUT
    loop1: 'MAIN COUNTING LOOP
    FOR B0 = 0 TO 63
    ***POKE PortB, B0 'PLACE B0 VALUE AT PORT TO LIGHT LEDS
    PAUSE DELAY 'WITHOUT PAUSE COUNTING IS TOO FAST TO SEE
    B1 = 0: B2 = 0
    button 7,0,1,0,B1,1,loop2 'CHECK SW1 STATUS - IF CLOSED JUMP
    'DELAY SAME
    BUTTON 6,0,1,0,B2,1,loop3 'CHECK SW2 STATUS - IF CLOSED JUMP
    'DELAY SAME
    NEXT B0 'NEXT B0 VALUE
    GOTO loop1
    loop2: 'LOOP2 INCREASES TIME DELAY
    DELAY = DELAY + 10 'INCREASE BY 10 MS DELAY
    B1 = 0: PAUSE 100
    BUTTON 7,1,1,0,b1,1,loop1 'CHECK BUTTON STAUS - IF OPENED JUMP
    'INCREASING
    IF DELAY > 1000 THEN hold1 'DON'T GO OVER 1-S DELAY
    GOTO loop2
    loop3: 'SECOND LOOP DECREASES DELAY
    DELAY = DELAY -10 'DECREASE DELAY BY 10 - MS
    B2 = 0:PAUSE 100
    BUTTON 6,1,1,0,B2,1,loop1 'CHECK BUTTON STATUS - IF OPENED JUMP
    'DECREASING
    IF DELAY < 20 THEN hold2 'NOT LESS THAN 10 MS DELAY
    GOTO loop3
    hold1: 'MAINTAIN DELAY AT UPPER LIMIT
    DELAY = 1000 'MAXIMUM DELAY
    GOTO loop2 'RETURN TO THE CALLING LOOP
    hold2: 'MAINTAIN DELAY AT LOWER LIMIT
    DELAY = 10 'MINIMUM DELAY
    GOTO loop3 'RETURN TO THE CALLING LOOP


    AND ALSO WHEN I COMPILE IT COMES WITH THESE MESSAGES BELOW:

    ERROR Line 13: Attempt to Redefine 'TRISB' (2SWITCH.BAS)
    ERROR Line 22: Variable or Constant Expected (Token 'PortB') (2SWITCH.BAS)
    ERROR Line 22: End of Line or ':' Expected (Token ',') (2SWITCH.BAS)

    FORGET ABOUT THE LINES THE ONES I MARKED *** ARE THE PROBLEMS.

    I WILL REALLY APPRECIATE A REPLY
    THANKS
    Last edited by Danish; - 23rd July 2005 at 04:43.

  4. #4
    Danish's Avatar
    Danish Guest


    Did you find this post helpful? Yes | No

    Talking Problem With Program

    HI ANYONE HELP ME OUT HERE BECAUSE I WROTE THIS PROGRAM AND IT COMMING UP WITH THE COMPILING ERROR AND ALSO I AM USING THE PICBASIC COMPILER AND THE EVERY TIME I COMPILE THE ERROR COMES UP THAT THIS TWO LINES ARE WRONG THE LINES THAT HAVE A *** NEXT TO THEM MEANS THAT THEY ARE THE LINES THAT HAD THE ERROR AND ALSO BELOW IS THE PROGRAM THIS PROGRAM HAS TWO SWITCHES ONE INCRESE THE DELAY OF THE BINARY COUNTING LEDS AND ONE TO DECREASE. I DIDN'T COMPILE YET BECAUSE IT KEEPS COMING UP WITH THE COMPILING ERRORS AND ALSO I TRIED MAKING SOME CHANGES IN THE PROGRAM AND I FOUND SOME MISTAKES OF MY OWN AND I FIXED THEM BUT STILL ITS NOT WORKING SO CAN ANYONE HELP ME OUT WITH THIS.


    'PROGRAM 4.2
    SYMBOL TRISB = 134 'SET TRISB TO 134
    ***SYMBOL TRISB = 6 'SET PORT B TO 6
    B1 = 0:B2 = 0
    SYMBOL DELAY = W4 'INITILAIZE DELAY VARIABLE
    W4 = 250 'INITIALIZE VARIABLE TO 250 MS DELAY
    'INITIALIZE PORT(S)
    POKE TRISB,192 'SET PORT B PINS 0-5 TO OUTPUT, PINS 6 AND 7
    'TO INPUT
    loop1: 'MAIN COUNTING LOOP
    FOR B0 = 0 TO 63
    ***POKE PortB, B0 'PLACE B0 VALUE AT PORT TO LIGHT LEDS
    PAUSE DELAY 'WITHOUT PAUSE COUNTING IS TOO FAST TO SEE
    B1 = 0: B2 = 0
    button 7,0,1,0,B1,1,loop2 'CHECK SW1 STATUS - IF CLOSED JUMP
    'DELAY SAME
    BUTTON 6,0,1,0,B2,1,loop3 'CHECK SW2 STATUS - IF CLOSED JUMP
    'DELAY SAME
    NEXT B0 'NEXT B0 VALUE
    GOTO loop1
    loop2: 'LOOP2 INCREASES TIME DELAY
    DELAY = DELAY + 10 'INCREASE BY 10 MS DELAY
    B1 = 0: PAUSE 100
    BUTTON 7,1,1,0,b1,1,loop1 'CHECK BUTTON STAUS - IF OPENED JUMP
    'INCREASING
    IF DELAY > 1000 THEN hold1 'DON'T GO OVER 1-S DELAY
    GOTO loop2
    loop3: 'SECOND LOOP DECREASES DELAY
    DELAY = DELAY -10 'DECREASE DELAY BY 10 - MS
    B2 = 0:PAUSE 100
    BUTTON 6,1,1,0,B2,1,loop1 'CHECK BUTTON STATUS - IF OPENED JUMP
    'DECREASING
    IF DELAY < 20 THEN hold2 'NOT LESS THAN 10 MS DELAY
    GOTO loop3
    hold1: 'MAINTAIN DELAY AT UPPER LIMIT
    DELAY = 1000 'MAXIMUM DELAY
    GOTO loop2 'RETURN TO THE CALLING LOOP
    hold2: 'MAINTAIN DELAY AT LOWER LIMIT
    DELAY = 10 'MINIMUM DELAY
    GOTO loop3 'RETURN TO THE CALLING LOOP


    AND ALSO WHEN I COMPILE IT COMES WITH THESE MESSAGES BELOW:

    ERROR Line 13: Attempt to Redefine 'TRISB' (2SWITCH.BAS)
    ERROR Line 22: Variable or Constant Expected (Token 'PortB') (2SWITCH.BAS)
    ERROR Line 22: End of Line or ':' Expected (Token ',') (2SWITCH.BAS)

    FORGET ABOUT THE LINES THE ONES I MARKED *** ARE THE PROBLEMS.

    I WILL REALLY APPRECIATE A REPLY
    THANKS

  5. #5
    Join Date
    Jul 2003
    Posts
    2,358


    Did you find this post helpful? Yes | No

    Default

    Danish... do you have a manual for the Compiler? If you haven't, then it's time you downloaded one. Go to the MeLabs website and find it.

    You will then discover that the word SYMBOL dos not insert a value into the TRISB Register (as your comments suggest), but assignes a new NAME or ALIAS to a Variable, Register or PinName to make code more readable. You get an error because you are trying to redefine the same name TWICE... look the compiler is TELLING YOU this...

    ERROR Line 13: Attempt to Redefine 'TRISB' (2SWITCH.BAS)

    The compiler really is pretty good... it gives you a clue as to where your problem is, it's up to you to then analyse your line for the error.

    If there is one thing I will recommend, is that you do not blindly copy other peoples code without checking LINE by LINE with the manual as to what it does.

    PS... Patience. One posting of your question is fine... any more than that does not solicit any quicker responses.

  6. #6
    Danish's Avatar
    Danish Guest


    Did you find this post helpful? Yes | No

    Smile thanks melanie

    thanks melanie
    i tried what you said and everything seems to be working fine

    onece again thanks

  7. #7
    Join Date
    Aug 2005
    Location
    Houston, TX
    Posts
    43


    Did you find this post helpful? Yes | No

    Default Keyboard lock

    How about a 3 x 4 matrix keyboard combination lock that will trigger a garage door opener or a burglar alarm or whatever. You can even input a temporary code that will survive a power outage. I have a circuit board design if you are interested.

Similar Threads

  1. A Serial GLCD 128x64 Simple Project
    By Oldspring in forum Off Topic
    Replies: 0
    Last Post: - 8th March 2010, 20:58
  2. A Temperature & Humidity Data Recorder Project
    By Oldspring in forum Off Topic
    Replies: 0
    Last Post: - 9th July 2008, 18:47
  3. paying project i need done
    By n1cod3mus in forum General
    Replies: 7
    Last Post: - 13th October 2007, 05:58
  4. Help with final project
    By OvERKiLL in forum General
    Replies: 4
    Last Post: - 15th December 2006, 20:35
  5. A category for Project Ideas
    By Pic_User in forum Forum Requests
    Replies: 2
    Last Post: - 23rd June 2006, 07:29

Members who have read this thread : 1

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