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

PIC Simulator

Discussion in 'Oshonsoft' started by Transistorman, Aug 16, 2010.

  1. Transistorman

    Transistorman Member

    Joined:
    Jun 7, 2010
    Messages:
    390
    Likes:
    2
    Location:
    Indonesian
    not yet

    im still in the project :)
     
  2. wombweller

    wombweller Member

    Joined:
    Sep 1, 2007
    Messages:
    364
    Likes:
    0
    Hi Guys
    Loving this thread.. just reading through it now. Just discovered the OS section and having been introduced to Os it's about time I got more in to it.:confused:

    Eric your a great Tutor as usual.:)

    Cheers
     
  3. Transistorman

    Transistorman Member

    Joined:
    Jun 7, 2010
    Messages:
    390
    Likes:
    2
    Location:
    Indonesian
    *Bump :)

    I am back
     
  4. dave

    Dave New Member

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


     
  5. tong143

    tong143 New Member

    Joined:
    May 15, 2011
    Messages:
    16
    Likes:
    0

    the program is not opening

    I have downloaded the software from the website but it is not working at all. Please help me how to run it. I have tried to install different versions form various sources nothing is working.
     
    Last edited: May 15, 2011
  6. ericgibbs

    ericgibbs Well-Known Member Most Helpful Member

    Joined:
    Jan 4, 2007
    Messages:
    21,242
    Likes:
    645
    Location:
    Ex Yorks' Hants UK
    hi,
    Which program have you downloaded.??
     
  7. tong143

    tong143 New Member

    Joined:
    May 15, 2011
    Messages:
    16
    Likes:
    0
    sorry I mean the software 'pic simulator IDE'.
     
    Last edited: May 15, 2011
  8. ericgibbs

    ericgibbs Well-Known Member Most Helpful Member

    Joined:
    Jan 4, 2007
    Messages:
    21,242
    Likes:
    645
    Location:
    Ex Yorks' Hants UK
    hi,
    Did you download and install the trial version of the PIC Sim IDE.??
     
  9. tong143

    tong143 New Member

    Joined:
    May 15, 2011
    Messages:
    16
    Likes:
    0
    Yes I have installed the traial version.
     
  10. ericgibbs

    ericgibbs Well-Known Member Most Helpful Member

    Joined:
    Jan 4, 2007
    Messages:
    21,242
    Likes:
    645
    Location:
    Ex Yorks' Hants UK
    OK.
    So what is the problem, which program did you try to run in the Sim.?
     
  11. tong143

    tong143 New Member

    Joined:
    May 15, 2011
    Messages:
    16
    Likes:
    0
    The software is not at all opening
     
  12. ericgibbs

    ericgibbs Well-Known Member Most Helpful Member

    Joined:
    Jan 4, 2007
    Messages:
    21,242
    Likes:
    645
    Location:
    Ex Yorks' Hants UK
    Hi,
    Which PC operating system are you using.? Windows. etc.

    Try un-installing the PIC sim, then re-download the trial version from the Oshonsoft web site.
    The program may have been corrupted during downloading.

    If the program still fails to run, contact the Oshonsoft site by email and report the problem.
     
  13. tong143

    tong143 New Member

    Joined:
    May 15, 2011
    Messages:
    16
    Likes:
    0
    i am using windows7. I have tried un-installing and re-downloading the software but no use. even on Oshonsoft website I am not able to report the problem
     
  14. ericgibbs

    ericgibbs Well-Known Member Most Helpful Member

    Joined:
    Jan 4, 2007
    Messages:
    21,242
    Likes:
    645
    Location:
    Ex Yorks' Hants UK
    hi,
    I have heard of problems with Win7 and Oshonsoft, I use Win XP.

    For Win7 I believe that you must run as Administrator for the first opening of the PIC sim.
     
  15. Ian Rogers

    Ian Rogers Super Moderator Most Helpful Member

    Joined:
    Mar 28, 2011
    Messages:
    9,310
    Likes:
    914
    Location:
    Rochdale UK
    I have installed oshonsoft onto Vista (same security as 7) you must run as administrator (even the install file) or it won't load

    Ian
     
  16. DerStrom8

    DerStrom8 Super Moderator Most Helpful Member

    Joined:
    Aug 9, 2010
    Messages:
    5,515
    Likes:
    507
    Location:
    Vermont (GMT-5:00)
    I am just starting, as well, and I use the PICkit2 as a simulator. Once you learn how to use it, it is a very helpful tool.
     
  17. tong143

    tong143 New Member

    Joined:
    May 15, 2011
    Messages:
    16
    Likes:
    0
    Thankyou it works now.
     
  18. 3v0

    3v0 Coop Build Coordinator Forum Supporter

    Joined:
    Jul 14, 2006
    Messages:
    9,404
    Likes:
    227
    Location:
    OKLAHOMA USA
    Both the simulator and the PK2 use the same IDE/debugger, good but initially confusing..

    Some explanation of terms.

    The MPLAB simulator is a program/code on the PC that simulates a pic. No real PIC is involved.

    The PK2 provides run control(breakpoints, step) and monitoring of the PIC it is connected to. The code is executed on that PIC and no simulator is required. This is know as ICD or In Circuit Debugging.

    With the simulator you have an unlimited number of breakpoint.
    With the PK2 the number of breapoints is determined by the PIC you are using. Some 1 others 3.

    With the simulator you can use a simulated logic analyzer.
    With the PK2 you need a real one.

    etc
     
    Last edited: May 16, 2011
  19. tong143

    tong143 New Member

    Joined:
    May 15, 2011
    Messages:
    16
    Likes:
    0
    Hi
    To start with I have written a program using mikroC, for pic16f882 using 4 MHz external crystal oscillator, to increase and decrease a number based on input from RA1/RA2 and display on multiplexed 7 segment display. 1s position is controlled by RA3 and 10s position is controlled by RA4. It is a common cathode. I am usin real pic simulator for simulation. The sequence is not followed while increase or decrease operations and both the digits are showing the same value. Following is the program. Shall someone help me on this.

    unsigned char seg[10]={0x80,0xf2,0x48,0x60,0x32,0x24,0x04,0xF0,0x00,0x30};
    unsigned short i, DD0=0x80,DD1=0x80;
    unsigned int tc,k=0,t1c;
    void display_temp(short DD0, short DD1)
    {
    for (i=0;i<1;i++)
    {
    TMR1IE_bit=1;
    while(!TMR1IF_bit )
    {
    PORTC = seg[DD0];
    PORTA.f3= 1; // Select Ones Digit
    PORTA.f4= 0;
    delay_ms(1);
    PORTC = seg[DD1];
    PORTA.f3= 0;
    PORTA.f4= 1; // Select Tens Digit
    delay_ms(1);
    if(PORTA.f0==1 || PORTA.f1 == 1 || PORTA.f2 == 1)
    {
    TMR1IE_bit=0;
    TMR1IF_bit=0;
    break;
    }
    }
    TMR1H=0x9E; //begin with 0
    TMR1L=0x58;
    TMR1IE_bit=0;
    TMR1IF_bit=0;
    if(PORTA.f0==1 || PORTA.f1 == 1 || PORTA.f2 == 1)
    break;
    }
    return;
    }


    void main()
    {
    int tc=0,count=0,set=0, t1,t1c=0;
    GIE_bit=1;
    TRISA=0xE7; // Set PORTA
    TRISC=0x01; // set PORTC as OUTPUT except pin0
    PORTA=0x00;
    PORTC=0x80;
    ANSEL=0x00;
    ANSELH=0x00;
    T1CON=0x01; //tmr1on bit is set
    TMR1H=0x9E; //begin with 0
    TMR1L=0x58;
    while(1)
    {
    if(PORTA.f2==1)
    {
    if(tc==0) tc=67;
    else tc--;
    }
    if(PORTA.f1==1)
    {
    if(tc==67) tc=0;
    else tc++;
    }
    DD0 = tc%10;
    DD1 = tc/10;
    display_temp(DD0,DD1);
    TMR1IE_bit=0;
    TMR1IF_bit=0;
    }
    }
     
  20. DerStrom8

    DerStrom8 Super Moderator Most Helpful Member

    Joined:
    Aug 9, 2010
    Messages:
    5,515
    Likes:
    507
    Location:
    Vermont (GMT-5:00)
    Hmm, I think this calls for a Yosemite Sam Award! :D:D:D
    unclejed?
     
    Last edited: May 19, 2011
  21. unclejed613

    unclejed613 Well-Known Member

    Joined:
    Apr 3, 2009
    Messages:
    1,828
    Likes:
    99
    yup he should have started another thread....

    tong143 gets a Genu-wine O-fishul Yosemite Sam "Iahma Highjackin' This Here Thread" Award.
     

    Attached Files:

Share This Page