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.
Is that why it skips over? It just decides it's not going to wait the 5000 ?

Though, even at 5 it just skips over.
 
Last edited:
Hi,

Do you mean software simulator? Matlab does that too, free from Microchip.
 
Is that why it skips over? It just decides it's not going to wait the 5000 ?

Though, even at 5 it just skips over.
hi s87,
I am wondering why you would want to have delay loop for 5 seconds.???

If this line Define SIMULATION_WAITMS_VALUE = 1 is placed somewhere within the program header, Oshonsoft will use a value of WaitMs 1.

If you want to, change it to a value from 1 to 10, or for a promming a PIC make it =0 or delete the line.

After you have used Oshonsoft for a while, you can work out how the WaitMs are stretched out, mine runs at about 20 times slower than the 'real' world times. Depends upon the speed of your PC..

EDIT:
So for a 5sec delay at 20, that would be a 5000mS/20 >> WaitMs 250

You can check your real times by lookingat the Sim window, see this image.
 

Attachments

  • AAesp01.gif
    AAesp01.gif
    7.8 KB · Views: 320
Last edited:
I just collected around 50 $
but i will recieve it tonight ( here is 15:00 for now )
not too long before we continue again :)
hi,
I hope you are reading the Oshonsoft Basic manual.??
Do you have Microsoft Word on your PC.???
 
of course i have

hi TT,
Load this TTpt2_1.asm into the Sim, set the PIC to 16F628A first and clock at 4mHz.
Set up the LCD as shown in the image.
Assemble using F9, Load and Run.

Note the 'conditional' assembly in the listing.
Added some Macro's for you to try...:)
 

Attachments

  • TTpt2_1.asm
    4.7 KB · Views: 298
  • TTpt2_1.gif
    TTpt2_1.gif
    9.3 KB · Views: 312
hi eric

what is macro for ?

hi,
Macro can be used where a 'section' of program is used a number of times within the text.
A simple example is the bank0 macro
Code:
bank0 macro
    bcf STATUS, RP0
    bcf STATUS, RP1
    endm
Instead of typing in the bcf xxxx and bsf xxxx every time you want to go bank0
you type in bank0.
When the assembler reads bank0, it generates the contents of the macro into the listing/hex file.

With this macro you can pass a delay value
Code:
;delay loop 1 To 255 msec
loopms  macro msec
    movlw msec
    movwf cntr0
    Call wait_ms
    endm
When you enter
loopms .10 ; the macro will use the decimal 10 as the delay value = 10mSec
 
of course i have

hi,
Look at this draft Oshonsoft basic manual I started a long time again ago.
Use the hyper links to navigate the file,
Add and Edit it to suit yourself.
 

Attachments

  • OSV7.doc
    153.5 KB · Views: 632
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.
its work , thanks

i just get the software some minute ago :)
 
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.
its work , thanks

i just get the software some minute ago :)

i will test the second one :)
 
hi s87,
I am wondering why you would want to have delay loop for 5 seconds.???

If this line Define SIMULATION_WAITMS_VALUE = 1 is placed somewhere within the program header, Oshonsoft will use a value of WaitMs 1.

If you want to, change it to a value from 1 to 10, or for a promming a PIC make it =0 or delete the line.

After you have used Oshonsoft for a while, you can work out how the WaitMs are stretched out, mine runs at about 20 times slower than the 'real' world times. Depends upon the speed of your PC..

EDIT:
So for a 5sec delay at 20, that would be a 5000mS/20 >> WaitMs 250

You can check your real times by lookingat the Sim window, see this image.

I was wanting to do this because it was running so quickly. It was going

Hey
0
1
2
3
etc

I was wanting it to go
Hey
.
.
.
0
1
2
3
4
etc

So you could read the text before hand. I can't try your suggestion right now but I will later. thanks
 
up to you :)

hi,
It takes a little while to prepare.
hi
This short prog uses TMR1 interrupts.
Select 16F876A
Load the LCDintr1.asm into a new assembler window and press F9 to compile.
Select from TOOLS
Micro view
LCD
Hardware Uart
Run the program in Ultimate
Click on AN0 and/or AN1 on the micro view window, adust AN0 and AN1 and you should see the
values on the LCD.

NOTE:
I have shortened the TMR1 count in order to speed up the Sim
Remember the the TMR1 interrupts at FF > 00 roll over, so the higher the count loaded into the TMR1 the shorter the interrupt interval
 

Attachments

  • LCDintr1.bas
    3 KB · Views: 293
hi,
If you use some of my external Oshonsoft modules it will make your testing easier.

Go to to this Blog link and download and install, get the free VB5 runtime files from the web and install.

This module enables you to adjust the ADC inputs in real time without the Micro View window
https://www.electro-tech-online.com...oft-simulator-16fanalog3-external-module.html


This module is for 4, push button/switch inputs
https://www.electro-tech-online.com...oft-simulator-16fkeypad4-external-module.html

This module is for 8, push button/switch inputs
https://www.electro-tech-online.com...oft-simulator-16fkeypad8-external-module.html

NOTE: you only need to intstall the VB5 runtime files once, when you have done that I can post 'exe' files
for other modules.
 
hi,
If you use some of my external Oshonsoft modules it will make your testing easier.

Go to to this Blog link and download and install, get the free VB5 runtime files from the web and install.

This module enables you to adjust the ADC inputs in real time without the Micro View window
https://www.electro-tech-online.com...oft-simulator-16fanalog3-external-module.html


This module is for 4, push button/switch inputs
https://www.electro-tech-online.com...oft-simulator-16fkeypad4-external-module.html

This module is for 8, push button/switch inputs
https://www.electro-tech-online.com...oft-simulator-16fkeypad8-external-module.html

NOTE: you only need to intstall the VB5 runtime files once, when you have done that I can post 'exe' files
for other modules.
sorry for late respond ,

my internet just die for some hours :(

can you tell me the pin configuration for the lcd module ?
 
Last edited:
hi,
I thought you had gone to bed.:rolleyes:

Which program LCD module.?

EDIT:
Do you mean the actual LCD.
Look at this pdf.
 

Attachments

  • how2lcd1.pdf
    240.7 KB · Views: 424
Last edited:
Status
Not open for further replies.

Latest threads

Back
Top