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
    hi
    i want to know , what is the good simulator
    for a starter like me ?
     
  2. ericgibbs

    ericgibbs Well-Known Member Most Helpful Member

    Joined:
    Jan 4, 2007
    Messages:
    21,181
    Likes:
    644
    Location:
    Ex Yorks' Hants UK
    hi TT,
    Look at Oshonsoft sim, there is a free trial period. Oshon Software Homepage
     
  3. Transistorman

    Transistorman Member

    Joined:
    Jun 7, 2010
    Messages:
    390
    Likes:
    2
    Location:
    Indonesian
    hi,eric
    i already download it a couple days ago
    but i have no idea how to use it
     
  4. dave

    Dave New Member

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


     
  5. ericgibbs

    ericgibbs Well-Known Member Most Helpful Member

    Joined:
    Jan 4, 2007
    Messages:
    21,181
    Likes:
    644
    Location:
    Ex Yorks' Hants UK

    hi TT,
    You could always ask me/us for help....:rolleyes:

    Whats the main problem.???
     
  6. Transistorman

    Transistorman Member

    Joined:
    Jun 7, 2010
    Messages:
    390
    Likes:
    2
    Location:
    Indonesian
    what is the step - step to simulating ?

    there seems to be so many setting
     
    Last edited: Aug 17, 2010
  7. ericgibbs

    ericgibbs Well-Known Member Most Helpful Member

    Joined:
    Jan 4, 2007
    Messages:
    21,181
    Likes:
    644
    Location:
    Ex Yorks' Hants UK
    hi,
    Which PIC and clock freq are you wanting to use.?
     
  8. Transistorman

    Transistorman Member

    Joined:
    Jun 7, 2010
    Messages:
    390
    Likes:
    2
    Location:
    Indonesian
    as usual
    12F629
    and the freq is 4 mhz
     
  9. ericgibbs

    ericgibbs Well-Known Member Most Helpful Member

    Joined:
    Jan 4, 2007
    Messages:
    21,181
    Likes:
    644
    Location:
    Ex Yorks' Hants UK
    hi,
    Run Oshonsoft.
    On the menu bar click OPTIONS, then SELECT MICRO, find the 12F629 PIC on the displayed table of PIC's.

    Also in the OPTIONS, select CHANGE CLOCK FREQ, make it 4.

    On the menu bar click TOOLS, then BASIC COMPILER.
    This will show a blank Basic window, this is where you type your program code.

    The 12F629 is too simple to explain the features of Oshonsoft fully.
    For teaching I would suggest the 16F628A PIC, I can then post some written programs for you to try.!
    Is that OK.?
     
  10. Transistorman

    Transistorman Member

    Joined:
    Jun 7, 2010
    Messages:
    390
    Likes:
    2
    Location:
    Indonesian
    yes its ok

    but i never use BASIC programming laguage
     
    Last edited: Aug 17, 2010
  11. ericgibbs

    ericgibbs Well-Known Member Most Helpful Member

    Joined:
    Jan 4, 2007
    Messages:
    21,181
    Likes:
    644
    Location:
    Ex Yorks' Hants UK
    hi,
    Look at this simple 628A Basic program, select the 16F628A from the OPTIONS, select the Basic Compiler and copy and paste the attached Basic program into the Basic Compiler window.
    When you have done that, press keyboard 'F9' this will compile and load the program into the sim.
    Using the TOOLS menu, load the LCD module, now just run the program, I always set the RATE from the menu as ULTIMATE

    EDIT:
    If you use windows explorer, you will see that Oshonsoft also creates an 'asm' file, 'lst' and 'hex' file.
    The 'asm' file is useful if you you prefer to work in assembler, the sim also has an 'assembler' window.
     

    Attached Files:

    • TT1.bas
      File size:
      547 bytes
      Views:
      274
    Last edited: Aug 17, 2010
  12. Transistorman

    Transistorman Member

    Joined:
    Jun 7, 2010
    Messages:
    390
    Likes:
    2
    Location:
    Indonesian
    hi eric
    thanks , it works
    it seems basic laguage is really easy
    i can display another massage with that , right ?
    and , what is the next lesson ? :D
     
  13. ericgibbs

    ericgibbs Well-Known Member Most Helpful Member

    Joined:
    Jan 4, 2007
    Messages:
    21,181
    Likes:
    644
    Location:
    Ex Yorks' Hants UK
    hi TT,
    Well done.
    Look at this extra work on the LCD.

    EDIT:
    Look thru these notes for the LCD.

    When simulating keep the delays WAITMS [ wait millisecs] short so it runs faster.
     

    Attached Files:

    Last edited: Aug 17, 2010
  14. Transistorman

    Transistorman Member

    Joined:
    Jun 7, 2010
    Messages:
    390
    Likes:
    2
    Location:
    Indonesian
    hi
    it works too
    i view the asm file that generated by it , and it was so long
    BASIC IS REALLY easy :D:D
    what is the next lesson ?
     
  15. ericgibbs

    ericgibbs Well-Known Member Most Helpful Member

    Joined:
    Jan 4, 2007
    Messages:
    21,181
    Likes:
    644
    Location:
    Ex Yorks' Hants UK
    hi TT,
    Next bit,
    From the TOOLS select HARDWARE UART, load and run this program, its LCD and UART output...


    EDIT:
    On the menu OPTIONS
    TICK, Save positions, Save always on top,,

    On the AUTOSTART options, from the window, tick the boxes that you want at start up.

    As an experiment click BASIC PROGRAM TRACKING from the OPTIONS,,, dont leave it on as it slows down the sim...
     

    Attached Files:

    • TT3.bas
      File size:
      816 bytes
      Views:
      184
    Last edited: Aug 17, 2010
  16. Transistorman

    Transistorman Member

    Joined:
    Jun 7, 2010
    Messages:
    390
    Likes:
    2
    Location:
    Indonesian
    hi eric
    its works too
    its can counting ( to 255 i think ) :)
    and also display hello in uart simulator :D
    i delete some comment because i cant past from 50 lines :(
    so , what is the next lesson ? :)
     
    Last edited: Aug 17, 2010
  17. ericgibbs

    ericgibbs Well-Known Member Most Helpful Member

    Joined:
    Jan 4, 2007
    Messages:
    21,181
    Likes:
    644
    Location:
    Ex Yorks' Hants UK
    hi TT,
    Same program but you can send a string from the HARDWARE uart to the LCD.
    Run the program and when its displays 'send a string', use the SEND STRING cmd in the hardware uart.
    if the string is over 16 characters in length it will display or you can end a short string with a '.' full stop character at the end and it will display
     

    Attached Files:

    • TT3.bas
      File size:
      913 bytes
      Views:
      177
  18. Transistorman

    Transistorman Member

    Joined:
    Jun 7, 2010
    Messages:
    390
    Likes:
    2
    Location:
    Indonesian
    hi eric
    sorry for late respond
    i test it on the simulator
    its work , but i think we need to add reset button :)
    so what is the next lesson ?
    i wondering what is analog input for :)
     
  19. ericgibbs

    ericgibbs Well-Known Member Most Helpful Member

    Joined:
    Jan 4, 2007
    Messages:
    21,181
    Likes:
    644
    Location:
    Ex Yorks' Hants UK
    hi,
    Run TT3.bas then close the Basic compiler window, use TOOLS and open the Assembler window, copy and paste this TT3.asm file into the window.

    Press F9 and it will assemble, the use the FILE on the menu bar, the LOAD FILE, double click the tt3.asm name and the file is ready to run.
     

    Attached Files:

    • TT3.asm
      File size:
      5.7 KB
      Views:
      151
  20. Transistorman

    Transistorman Member

    Joined:
    Jun 7, 2010
    Messages:
    390
    Likes:
    2
    Location:
    Indonesian
    i try to assemble it using PIC IDE which has a plug in / connected
    to MPASM and it converted too
    so, see you tomorrow , maybe we can continued it tomorrow , i need to sleep :)
     
  21. Transistorman

    Transistorman Member

    Joined:
    Jun 7, 2010
    Messages:
    390
    Likes:
    2
    Location:
    Indonesian
    hi
    i ready to continue :)
     

Share This Page