1. Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.
    Dismiss Notice

pic16f84A

Discussion in 'Homework Help' started by buzz RG, Nov 26, 2016.

  1. buzz RG

    buzz RG New Member

    Joined:
    Nov 26, 2016
    Messages:
    3
    Likes:
    0
    How can I connect these LEDs and switches to PIC 16F84A ? I need to have PIC to PIC communication and the programing has to be in assembly using (MPLAB.) and then use(( proteus)) Screenshot (81).png
     
  2. Les Jones

    Les Jones Well-Known Member

    Joined:
    May 15, 2015
    Messages:
    1,411
    Likes:
    180
    Location:
    Lancashire UK
    I would suggest strating by writing the software to create a software UART ast the PIC17F84A does not have a hardwate UART. (You will probably find may examples of this on the web.) You can then use two pins on each PIC to communicate between the PICs I would decide to use one as master and the other as a slave. (The master would make all of the decisions. Based on the 5 switches.) As you have 8 data bits available you can use 4 to control the LEDs and either 2 or 3 bits (Depending on which one is master.) to send the state of the switches. I have just realised that you are allowed to use multiple lines to communicate so if Z was the master you could do it with 6 lines of the B port. In fact if you use one line per switch from PIC Y then the output of the switches could just be linked beteen the pics rather then using another two ports.

    Les.
     
    Last edited: Nov 26, 2016
    • Like Like x 2
  3. Ian Rogers

    Ian Rogers Super Moderator Most Helpful Member

    Joined:
    Mar 28, 2011
    Messages:
    8,946
    Likes:
    877
    Location:
    Rochdale UK
    ONLINE
    I did one of these years back.... 8 digital and 8 analogue multiplexed down RS485 for 100 metres.... Worked pretty good.. I still think its working today!!!

    There are examples to do this on Nigel's site... Depending on distance, I would agree with Les... Software RS232...
     
  4. dave

    Dave New Member

    Joined:
    Jan 12, 1997
    Messages:
    -
    Likes:
    0


     
  5. Ian Rogers

    Ian Rogers Super Moderator Most Helpful Member

    Joined:
    Mar 28, 2011
    Messages:
    8,946
    Likes:
    877
    Location:
    Rochdale UK
    ONLINE

    What are you programming the micro's with.. ASM, Basic or C??

    If you are using ASM then only Proteus is needed as they have a built in source editor and mpasm is used to build..
     
  6. absf

    absf Active Member

    Joined:
    Jun 18, 2012
    Messages:
    206
    Likes:
    27
    Location:
    Malaysia
    Here's one that was written for 16F84A and simulates on proteus. Unfortunately, it was written in HiTech C. The theory is well explained and I tried it out on proteus and it works.

    May be the OP can treat the communication part as a black box first and concentrate on the switch and LED algorithm first. Once working then convert the C to ASM.

    http://saeedsolutions.blogspot.my/2012/10/pic16f84a-software-uart-bit-banging.html
    PIC16F84A SOFT UART CCT.jpg

    Allen
     
    Last edited: Nov 26, 2016
  7. absf

    absf Active Member

    Joined:
    Jun 18, 2012
    Messages:
    206
    Likes:
    27
    Location:
    Malaysia
    Your hardware simulation in proteus would look something like below. I left out the oscillator part and I am not sure if RB6/7 is suitable for the soft uart. Please check the datasheet to confirm.

    F84 PIC-PIC COMMUNICATION.PNG Allen
     
    • Like Like x 2
  8. buzz RG

    buzz RG New Member

    Joined:
    Nov 26, 2016
    Messages:
    3
    Likes:
    0
    thanks absf that is so helpful
    can u help me with the coding
    if u may on MPlab
     
  9. Les Jones

    Les Jones Well-Known Member

    Joined:
    May 15, 2015
    Messages:
    1,411
    Likes:
    180
    Location:
    Lancashire UK
    This looks like a school project. It will not help you if someone else does all the work. You need to back over what you have been tought as it seems obvious that you have not learned it. You have been given lots of hints about how to proceed. When you leave school and start work you will not be able to get someone else to do your job for you.

    Les.
     
    • Agree Agree x 2
    • Informative Informative x 1
  10. absf

    absf Active Member

    Joined:
    Jun 18, 2012
    Messages:
    206
    Likes:
    27
    Location:
    Malaysia
    Sorry, as other members have indicated..... That is, unless you show some efforts on your part first, more help would be given to you free.:happy:

    Perhaps you can start with a Flow-Chart of your coding.

    Allen
     
    Last edited: Nov 26, 2016
    • Like Like x 1
  11. buzz RG

    buzz RG New Member

    Joined:
    Nov 26, 2016
    Messages:
    3
    Likes:
    0
    the thing is its a project at collage and there is gana be exam in two days
    and the doc he is just gana ask about it
    and he gave as nothing about the programs
    and am weak in assembly language .
    so i need help to pass the exam
    and i hope u give help . :)
     
  12. Ian Rogers

    Ian Rogers Super Moderator Most Helpful Member

    Joined:
    Mar 28, 2011
    Messages:
    8,946
    Likes:
    877
    Location:
    Rochdale UK
    ONLINE
    Here in lies the problem.... If you pass but it wasn't your work, you will be living a lie..

    Way back when... I was given projects... I managed to do them in more than ample time... We had students who still hadn't started days before time was up... Guess what!!... They failed...
     
    • Agree Agree x 2

Share This Page