Continue to Site

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.

  • 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.

PIC Simulator

Status
Not open for further replies.
hi
i ready to continue :)
hi,
Run the TT3.bas program.
On the LCD module, click 'setup' , drop down window will appear.
This is the window you have to set up when working with 'asm' files,,, when using BASIC the sim makes the changes.

You can also change the colour scheme.

Click on 'setup LCD Module delays', a pop up window will appear, change the default value of 1640 to 500.

Click OK, and then make the other two values 40, click APPLY

Rerun the TT3.bas and it should run faster.

OK...


EDIT:
Using menu OPTIONS;
select 'Change uart TX/RX times' , make the time 50.
also change the A/D conversion time to 25.

Select 'continuous Analog input slider up date'

Select 'Change ultimate refresh interval', make it 2000.... this means when running at top RATE the IDE SFR boxes only update every 2 secs, which is OK,,, the simulations run faster in ULTIMATE.
 
Last edited:
hi,
Run the TT3.bas program.
On the LCD module, click 'setup' , drop down window will appear.
This is the window you have to set up when working with 'asm' files,,, when using BASIC the sim makes the changes.

You can also change the colour scheme.

Click on 'setup LCD Module delays', a pop up window will appear, change the default value of 1640 to 500.

Click OK, and then make the other two values 40, click APPLY

Rerun the TT3.bas and it should run faster.

OK...


EDIT:
Using menu OPTIONS;
select 'Change uart TX/RX times' , make the time 50.
also change the A/D conversion time to 25.

Select 'continuous Analog input slider up date'

Select 'Change ultimate refresh interval', make it 2000.... this means when running at top RATE the IDE SFR boxes only update every 2 secs, which is OK,,, the simulations run faster in ULTIMATE.
yes i did it :)
next lesson :)
 
hi,
Change the PIC type to 16F876A, 4 mHz clock.
Copy/paste this TT4.bas into the basic window, BEFORE you press F9, close the LCD module if its showing.
Then press F9.
Select the LCD module from the TOOLS and accept it.
Using TOOLS, select micro controller view.

Run the program in Ultimate.

On the PIC view near AN0 you will see a letter 'A' , left click it, as small box will appear, use the slider to change the adc input voltage, the LCD will display the values..
Dont rush it, remember in simulation the programs run a lot slower.
 

Attachments

  • TT4.bas
    2.1 KB · Views: 340
hi,
Change the PIC type to 16F876A, 4 mHz clock.
Copy/paste this TT4.bas into the basic window, BEFORE you press F9, close the LCD module if its showing.
Then press F9.
Select the LCD module from the TOOLS and accept it.
Using TOOLS, select micro controller view.

Run the program in Ultimate.

On the PIC view near AN0 you will see a letter 'A' , left click it, as small box will appear, use the slider to change the adc input voltage, the LCD will display the values..
Dont rush it, remember in simulation the programs run a lot slower.
i cant past then 50 lines
but i will purchase it later
 
I wanna play too!! I have my pickit 2 at home. Are you guys saying it's as easy as writing basic and then compiling it to an ASM? I was having all kinds of trouble because I don't know assembly at all haha. I was also having trouble because all I currently have is the pickit2 demo board.. Need to get some breadboard and an IC and start experimenting. I want to start with this program you guys are talking about with Oshon. I'm so excited!
 
I wanna play too!! I have my pickit 2 at home. Are you guys saying it's as easy as writing basic and then compiling it to an ASM? I was having all kinds of trouble because I don't know assembly at all haha. I was also having trouble because all I currently have is the pickit2 demo board.. Need to get some breadboard and an IC and start experimenting. I want to start with this program you guys are talking about with Oshon. I'm so excited!

hi s87,
Goto the Oshonsoft website and download the trial version of the simulator, you can use all the tutor programs TT1 thru 4 and the posts to get you started.

Oshon Software Homepage

Ask if you have a problem.
 
Last edited by a moderator:
I don't know what happened to the post I just submitted but I'm looking to purchase a few ICs to get started as well. I am looking around on microchip's website. What would be the best to get started with? I found a page containing the PIC12F629 (as specified in the above video) would this be sufficient? The pickit2 demo board also comes with PIC16F690 but I don't think it'll come off of the board without some desoldering......

This is the microchip page for the PIC12F629. I am confused though... What are all of the different types? Like PIC12F629-E/MD, etc? Which do I want?

https://www.microchipdirect.com/ProductDetails.aspx?Category=PIC12F629
 
Last edited:
I don't know what happened to the post I just submitted but I'm looking to purchase a few ICs to get started as well. I am looking around on microchip's website. What would be the best to get started with? I found a page containing the PIC12F629 (as specified in the above video) would this be sufficient? The pickit2 demo board also comes with PIC16F690 but I don't think it'll come off of the board without some desoldering......

This is the microchip page for the PIC12F629. I am confused though... What are all of the different types? Like PIC12F629-E/MD, etc? Which do I want?

PIC12F629 - microchipDIRECT

hi,
The PIC comes in different case styles, how do plan to use the 12F629, is it on a project or a PCB.?

I wouldn't desolder the 16F690 from the Pickit PCB

The Oshonsoft sim supports the 16F690 PIC.
 
Since I am just starting I figure I'll just do little things like blink the LEDs as demonstrated above and I have a few LED arrays that I would probably want to experiment with. Nothing major just little experimentation and I'm not planning on soldering it to anything. I have yet to get a bread board because "The Shack" has none because they're moving away from what they were made for and more towards become mini-bestbuys. (/rant) But I would probably just pick up a breadboard somewhere and pop it in with them and just blink some LED's and stuff for now.
 
Since I am just starting I figure I'll just do little things like blink the LEDs as demonstrated above and I have a few LED arrays that I would probably want to experiment with. Nothing major just little experimentation and I'm not planning on soldering it to anything. I have yet to get a bread board because "The Shack" has none because they're moving away from what they were made for and more towards become mini-bestbuys. (/rant) But I would probably just pick up a breadboard somewhere and pop it in with them and just blink some LED's and stuff for now.

hi,
To insert and remove from a Project board you want the PDIP package for the 12F629.
 

Attachments

  • 42268235.jpg
    42268235.jpg
    4.4 KB · Views: 337
Last edited:
E/P or I/P? What are those?
I dont know anyting about PIC package , but for a beginner like you

why not just buy a DIP package , usually DIP package is used for prototyping

search it on google : PIC12F629 - I/P

if you already have the 12F629 , try this code
 

Attachments

  • S871.ASM
    4.3 KB · Views: 351
  • S871.hex
    728 bytes · Views: 307
Last edited:
No no I mean I see the package type says PDIP but:

PIC12F629-E/P Click Here to upload your code to this device View Datasheet
Lead Count: 8 Package Type: PDIP

PIC12F629-I/P Click Here to upload your code to this device View Datasheet
Lead Count: 8 Package Type: PDIP
 
hi,
If you have the datasheet for the 12F629 look at pages 117 and upwards for the types.
 
I'm referring to on the actual purchase page.

In the red circle, I'm sorry if that's what you're talking about to I just don't know what the difference is.

**broken link removed**
 
Also, in TT3.bas I tried adding another waitms 5000 after the LCDOUT "Hey" to make it wait 5 secs before it cleared and everything.


Lcdout "Hey there"
WaitMs 5000
Lcdcmdout LcdClear


However, it skips right over that. It looks at it and just keeps going. I am using the PIC16F628A in the simulator... Does it not support the waiting? Any idea why it's skipping right over?
 
Also, in TT3.bas I tried adding another waitms 5000 after the LCDOUT "Hey" to make it wait 5 secs before it cleared and everything.


Lcdout "Hey there"
WaitMs 5000
Lcdcmdout LcdClear

However, it skips right over that. It looks at it and just keeps going. I am using the PIC16F628A in the simulator... Does it not support the waiting? Any idea why it's skipping right over?

hi,
The E/P works from -40C to +125C and the I/P works from -40C to +85C
The I/P will be OK for you.

EDIT:
A WaitMs of 5000 in a simulator will take for ever!!, make it about 10 or less.

Also add near the top of the program . Define SIMULATION_WAITMS_VALUE = 1, if you program a PIC make = 0


EDIT:


PLEASE NOTE:

When writing programs for real PIC devices you will most likely use delay intervals that are comparable to 1 second or 1000 milliseconds.

Many examples in this help file also use such 'real-time' intervals.

But, if you want to simulate those programs you have to be very patient to see something to happen, even on very powerful PCs available today.

For simulation of 'WaitMs 1000' statement on 4MHz you have to wait the simulator to
simulate 1000000 instructions and it will take considerable amount of time even if 'extremely fast' simulation rate is selected.

So, just for the purpose of simulation you should recompile your programs with adjusted delay intervals, that should not exceed 1-10ms.

But, be sure to recompile your program with original delays before you download it to a real device.

There is an easy way to change arguments of all WAITMS statements in a large basic program with a value in the range 1-10 for simulation purposes.

With one line of code setting parameter

Example. Define SIMULATION_WAITMS_VALUE = 1

with DEFINE directive, the arguments of all WAITMS statements in the program will be ignored and the specified value will be used instead during compiling.

Setting the value 0 (default) for this parameter (or omitting the whole line) will cancel
its effect and the compiled code will be ready again for the real hardware.
 
Last edited:
Status
Not open for further replies.

Latest threads

Back
Top