Proteus isis !!!

Discussion in 'Programmer's Corner' started by Rk17, May 5, 2011.

  1. Rk17

    Thread Starter Member

    Apr 23, 2011
    43
    0
    hi guyz just want to ask.. how do i set the pins of 16F84a to inputs like what this guy did in this video

    Code ( (Unknown Language)):
    1. http://www.youtube.com/watch?v=HBkbDJGybzk&feature=related
    but he is using a diff. simulation software which can set port a or port b high/low.. How could i do that on proteus because in proteus its all outputs i cant figure out how to set the pins as inputs tnx!
     
  2. t06afre

    AAC Fanatic!

    May 11, 2009
    5,939
    1,222
    And your current code what is it. Do you use C or assembler.....
     
    Rk17 likes this.
  3. Rk17

    Thread Starter Member

    Apr 23, 2011
    43
    0
    i use c..

    Code ( (Unknown Language)):
    1.  #include <htc.h>
    2.  
    3. #define _XTAL_FREQ 4000000
    4.  
    5. main(){
    6.  
    7.  
    8. TRISB=0xFF;
    9. TRISA=0x00;
    10. PORTB=0xFF;
    11. while(1)
    12. {
    13. _delay(500);
    14. PORTA=0xFF;
    15. _delay(500);
    16. PORTA=0x00;
    17. }
    18. }
    19.  
     
  4. Rk17

    Thread Starter Member

    Apr 23, 2011
    43
    0
    when i simulate in proteus the delay works but when i use the other software(ohosoft) it does not work. So what im asking is how to use the pins in proteus as inputs because in ohosoft i can use them with just a click.. have you seen the video?
     
  5. t06afre

    AAC Fanatic!

    May 11, 2009
    5,939
    1,222
    Are you doing simukations in Proteus only. Or do you do some hardware testing also? by the way do have to use the old 16f84 or can you use some newer and better chip. Can you post your Proteus project
     
    Rk17 likes this.
  6. Rk17

    Thread Starter Member

    Apr 23, 2011
    43
    0
    ive got it already.. i just used switches connected to the supply, when the switch is on it has high input and if its off has low input


    Code ( (Unknown Language)):
    1.                                                                                                     Are you doing simukations in Proteus only. Or do you do some hardware testing also?
    i do simulations and if it works thats the time i do it in hardware
     
  7. t06afre

    AAC Fanatic!

    May 11, 2009
    5,939
    1,222
    :eek:
    Some important things. Always use a series led then connecting a LED to a MCU 330 ohm is OK to use then using 5 volt as power supply. Your schematic was a real mess. If you post something like this in forums. People will most probably refuse to even look at it. For your own shake keep the lines tidy. Do not create spaghetti schematics ;)
    I have cleaned your schematic up somewhat. What is the project meant to do? Also what is the meaning with the thyristor.
    In your code you do not set the configuration word. This must always be declared.
    It may be that your hardware setup did work in the simulator. But it would never have worked in the real life setup. But do not worry. As I said before. Give your self time to learn and fail..
     
    Rk17 likes this.
  8. Rk17

    Thread Starter Member

    Apr 23, 2011
    43
    0
    oh bout the scr,, i was just trying to experiment a little bit doesnt mean much hehe.. BTW what do you mean by
    Code ( (Unknown Language)):
    1. In your code you do not set the configuration word. This must always be declared.
    can you please give me an example?? is this the _CONFIG (etc.)

    how can you be so sure? im not done yet

    >> it worked in the simulation so most probably it will work in real life ill post the video once its done.... :D
     
  9. Rk17

    Thread Starter Member

    Apr 23, 2011
    43
    0
    :)nwei tnx t06afre! really appreciate it friend!
     
  10. engrdm

    New Member

    Feb 19, 2010
    10
    0
Loading...