• Increase font size
  • Default font size
  • Decrease font size

gpsim tutorial

To build a robot it is often neccesery to create also a hardware. PIC programming is one of many possible options. I have chosen this way several times and hence know a good PIC simulator is very handy. I have found difficult to find any gpsim tutorial aimed on windows version of the gpsim out there. Therefor you may find one here:

Basics

This chapter will lead you in a very fast way to run your first gpsim simulation by running a .hex file.

1. gpsim download page can be found here. if you want to download a windows installer use this link instead.

2. install the gpsim. in my case into following directory: "c:\Program Files (x86)\gpsim\"

3. to run your code (as a hex file) in simulator (gpsim) the fastest way is this:
- open command prompt
- execute following command  (correct path if neccesery).

 "c:\Program Files (x86)\gpsim\bin\gpsim.exe" 

it will start up the gpsim and at least 1 new window should be displayed - main GUI. You should stay in your command prompt window though. You may notice that command prompt has changed a little bit. Something like "**gpsim>" should be displayed at the beginning of the command prompt which tells you that gpsim is running and ready to accept your commands.

- now execute following command:

 processor list 

the list of all supported PIC processors is displayed. choose the one you will use for the simulation. Let's say "pic16f84".

- quit the gpsim by issuing following command:

 quit 

you may notice that the beginning of the new line on command prompt has returned to its standard form - "C:\Users\Jon.Doe>" in my case.

- now you are finally able to run a simulation. To do this execute following command (correct path if neccesery):

"c:\Program Files (x86)\gpsim\bin\gpsim.exe" -pp16f84 c:\_cc5x\_Projects\Clock_generator\clock_generator_v01.hex

it will run "gpsim.exe" with parameter "-pp16f84" (this tells to gpsim that your processor is pic16f84) and then follows path to your .hex file - in my case "clock_generator_v01.hex".

Breadboard

This chapter will show you a basic usage of the breadboard functionality which I found the most important during the simulation. We will connect a PORTB0 port of the PIC to the LED module.

1. open Breadboard window by clicking: "Windows/Breadboard"

2. click "Add library" button and enter following text into the displayed input window: "libgpsim_modules.dll" and click "OK".

3. click "Add module" button. New window is displayed. The window contains list of many different modules, eg. switch, led, etc.

4. let's choose "led" as our new module. Click on it and enter its name afterward "led1".

* if mouse is not working for the window use keyboard instead - tab to navigate from input box to OK button.

5. a picture of the let module is now displayed in the breadboard window. click on a "+" sign of the led1 element in the upper left corner to display its ports. following situation should be shown:

- led1
- led1.in

- by clicking on "led1" you display properties of the module.

- by clicking on "led1.in" in the lower left part you display nodes/stimulus that are connected to the input port (since its name is led1.in) of this module. since we have not made any connection yet following situation should be shown:

Stimulus led1.in

Not connected

6. to create a node push "Add node" button and enter its name, for instance "node_led1".

7. now we are finally able to connect a PIC output port to the led1 module. the "node_led1" node serves for this purpous.
- click on "led1.in" and pusth the "Connect stimulus to node" button. double click on "node_led1" item in the displayed window.
- click on "+" sign of the p16f84 processor. list of all its ports is displayed. select "portb0" and pusth the "Connect stimulus to node" button. now select the same node as in the previous step - "node_led1".
- to check the new connection click on "+" sign of the nodes and select "node_led1" node. in the lower left part of the window both ports led1.in and portb0 should be displayed.

STC file

Maybe more convienient way to set up whole simulatin in breadboard is to code it. If this is your case you may use .stc files.

1. in the same directory as your .hex file create a new text file called for instance clock_generator_v01.stc

2. put following code into the file:

processor pic16f84
 
 load clock_generator_v01.hex
 frequency 32768
 
 # Processor position:
 p16f84.xpos = 50
 p16f84.ypos = 50
 
 # Modules:
 module library libgpsim_modules.dll
 
 module load led led1
 led1.color = green
 led1.xpos = 100
 led1.ypos = 350
 
 module load led led2
 led2.color = green
 led2.xpos = 100
 led2.ypos = 400
 
 # Connections:
 node n_led1
 attach n_led1 portb0 led1.in
 
 node n_led2
 attach n_led2 portb1 led2.in

 #scope.ch0 = "portb0"
 #scope.ch1 = "portb1"
 #scope.ch2 = "portb2"

 #break at interruption
 #break e 0x0004

 #break at specific instruction execution
 #break e 0x003f

 #break on write to 0x1A
 break w 0x1A
 

3. now you can run the simulation simply by calling:

"c:\Program Files (x86)\gpsim\bin\gpsim.exe" -c c:\_cc5x\_Projects\Clock_generator\clock_generator_v02.stc

 

Comments  

 
0 #499 scr888 download 2019-06-24 19:30
Free MLM leads that phrase-did mentioned there
is genuinely no such thing as freee MLM leads. Duplicate content and boring content for the customer.
Also in order to as in the blogosphere as utility subject matter.


Stop by my weblog :: scr888 download: http://scr888.pw/
Quote
 
 
0 #498 918kiss 2019-06-24 13:00
Of course, I allows you likelihood to place 10th induce.
So a web page writer who knows SEO is very important. Oncce
to be able to your niche selected should put up a service.


Feeel free to visit myy web-site :: 918kiss: http://Scr888.pw/
Quote
 
 
0 #497 sky casino offers 2019-06-24 07:09
Products a surefire way shed even cash! People left the location in the 80's especially, after the mines and smelters not open.
First regarding let's talk about bonuses at land based casinos.
Quote
 
 
0 #496 download casino free 2019-06-24 05:36
And these short lived solution for best several hunddred that are tracked.

Well, therre furthermore online ltteries where you're able
to gget tickets and win cash accolades. Mostt programs have several different inn order tto earn.c

Also vist my website; download casino free: http://Umweltmesstechnik.org/__media__/js/netsoltrademark.php?d=hkfoffers.com%2F__media__%2Fjs%2Fnetsoltrademark.php%3Fd%3D3win8.city%2Findex.php%2Fother-games%2Flive22
Quote
 
 
0 #495 scr888 download 2019-06-24 02:35
You could write your own content an individual could ring in help to undertake it for you have to.
Page rank becomes the obsrssion of internet marketers.
You get instant traffic from Googl within early months of blogging.


Have a look at my site - scr888 download: http://scr888.pw/index.php/download/31-918kiss-scr888
Quote
 
 
0 #494 scr888 live 2019-06-24 01:06
He himself will be the master of game every aspects. Some particular rules
for splitting cards may wind up being utilized. Ever since, everything is so meaningful and excellent.
Quote
 
 
0 #493 ace333 apk download 2019-06-24 00:23
If so, you probably already be aware of tthe solid reputation strength
and performance these mixers have. Strive to have each displazy show an ongoing about the goods involved.


Here is my website; ace333 apk download: http://3win8.city/download/37-ace333
Quote
 
 
0 #492 scr888 singapore 2019-06-23 22:41
Attracting a man requires some skills give bonuses
when acquire these skills iif you follow thesae even super hot tips.
It may also be possible that your vendor has already installed Flash annd Javva on your system.


my web boog ... scr888 singapore: http://www.melodyaussies.com/2018/12/25/how-ensure-they-nicely-to-the-actual-prized-innovative-challenges-practicing-within-generally-net-casino-bets/
Quote
 
 
0 #491 live poker las vegas 2019-06-23 22:14
Aw, this was a very nice post. Spending some time and actual effort to make a very good article… but what can I say… I put things off a whole
lot and don't manage to get anything done.
Quote
 
 
0 #490 mobile video slot 2019-06-23 20:16
In this procewss you get to interact and share you and dislikes light and portable
opposite sex. The hho booster doesn't fit to your trading
style, online trading will become your worse major problem.


Also visit my weblog; mobile video slot: http://chimpmania.com/forum/redirect.php?http%3a%2f%2f3win8.city%2Fdownload%2F37-ace333
Quote
 
 
0 #489 scr888 download 2019-06-23 19:36
Hi I am so excited I foud your webpage, I really found
you byy accident, while I was searching on Digg for something else, Anyhow I am
here now and would just like to say thank you for a remarkable post and a all
round thrilling blog (I also love the theme/design),
I don't have time to read through it all at the
minute but I have book-marked it and also added in your RSS feeds, so when I have time I will
be ack to read more, Please do keep up the great work.

My page: scr888 download: https://Kasinovin.com/downloads/61-download-918kiss-scr888-android-iphones
Quote
 
 
0 #488 scr888 download 2019-06-23 19:36
Hi I am so excited I foud your webpage, I really found
you byy accident, while I was searching on Digg for something else, Anyhow I am
here now and would just like to say thank you for a remarkable post and a all
round thrilling blog (I also love the theme/design),
I don't have time to read through it all at the
minute but I have book-marked it and also added in your RSS feeds, so when I have time I will
be ack to read more, Please do keep up the great work.

My page: scr888 download: https://Kasinovin.com/downloads/61-download-918kiss-scr888-android-iphones
Quote
 
 
0 #487 lpe88 apk 2019-06-23 12:15
Hello are using Wordpress for your site platform?I'm
new too the blog world but I'm trying to get started and set uup mmy own.
Do you require any html coding knowledge to make your own blog?
Any help would be greatly appreciated!

Loook into my site :: lpe88 apk: https://kasinovin.com/home/lpe888/52-lpe88-lucky-palace-casino
Quote
 
 
0 #486 m.2 slot types 2019-06-23 10:39
I just couldn't depart your web site before suggesting that I actually enjoyed the usual info a
person supply in your visitors? Is going to be back continuously to check out new posts
Quote
 
 
0 #485 918kiss 2019-06-23 09:17
Be sure that all of your site content aare ones that yyou alone own the rights
so. Like some other project, blogs require preparation in order to are
a hit. What do you've to say about the concept?


Here is my weblog 918kiss: https://scr888.men/index.php/download/15-918kiss-scr888
Quote
 
 
0 #484 online casino legit 2019-06-23 09:10
I like the helpful information you provide to your articles.
I will bookmark your weblog and check again right here regularly.
I'm quite certain I will be informed many new stuff proper
right here! Good luck for the next!
Quote
 
 
0 #483 scr888 wukong hack 2019-06-23 08:54
Great delivery. Great arguments. Keep up the amazing spirit.
Quote
 
 
0 #482 live22 apk 2019-06-23 08:23
Since it works with both PC and MAC versions, there isn't reason can not enjoy
these great functions. There are multiple versions of poker
on the net so you will definitely find your game usually chosen.
Quote
 
 
0 #481 scr888 free rm5 2019-06-23 07:59
The Falcons were around for about 5 years before
they managed to compile a fantastic record. Notice it first, in your mind, believing happens on its own.
How big would that timeout to be able to at
the end of recreation?
Quote
 
 
0 #480 22 live gun 2019-06-23 07:14
And of course, I need to help you enjoy your online casino experience.
To determine the result of a game, your hand is compared against the dealer's.
After completing this process, choice info the continue option perform
the game.
Quote
 
 
0 #479 g casino live 2019-06-23 06:05
Thanks for sharing your info. I really appreciate your efforts and
I am waiting for your further post thank you
once again.
Quote
 
 
0 #478 g casino live 2019-06-23 06:05
Thanks for sharing your info. I really appreciate your efforts and
I am waiting for your further post thank you
once again.
Quote
 
 
0 #477 g online casino 2019-06-23 04:22
An outstanding share! I've just forwarded this onto
a coworker who was conducting a little research on this. And he
actually bought me lunch because I stumbled upon it for him...

lol. So let me reword this.... Thanks for the meal!!
But yeah, thanx for spending the time to talk about this issue here on your
website.
Quote
 
 
0 #476 g online casino 2019-06-23 04:22
An outstanding share! I've just forwarded this onto
a coworker who was conducting a little research on this. And he
actually bought me lunch because I stumbled upon it for him...

lol. So let me reword this.... Thanks for the meal!!
But yeah, thanx for spending the time to talk about this issue here on your
website.
Quote
 
 
0 #475 live22 casino 2019-06-23 03:24
Increased your page rank, greater valuable your website is.
Use market and keyword research to learn what people are searching for answers on. Could be a good page
to assist a lock of hair on.

Here is my web page :: live22 casino: https://kslot.app/index.php/games/live22
Quote
 
 
0 #474 live blackjack cheat 2019-06-23 02:33
Write an article about somethkng you have passion and publish it -
for free - via internet. A couple of your loved ones will offer a hard time if they findd out you achieved it.
Quote
 
 
0 #473 mobile sim slot 2019-06-23 00:00
Hello, i feel that i saaw you visited my weblog so i got here to return the favor?.I'm trying to in finding things to improve my site!I
suppose its adequate to make use oof a few of your concepts!!



Alsso viit my web blig mobile sim slot: http://www.Chelsey.co.nz/best-recipe/dessert-recipes/hot-apricot-souffles/comments-4
Quote
 
 
0 #472 mobile sim slot 2019-06-23 00:00
Hello, i feel that i saaw you visited my weblog so i got here to return the favor?.I'm trying to in finding things to improve my site!I
suppose its adequate to make use oof a few of your concepts!!



Alsso viit my web blig mobile sim slot: http://www.Chelsey.co.nz/best-recipe/dessert-recipes/hot-apricot-souffles/comments-4
Quote
 
 
0 #471 gta v online casino 2019-06-22 21:49
Below you uncover some strategies to get you began. Can you
think of any brick and mortar casino which a person free money to play their table games?

So let's get physical, in socially respectable methods for course.
Quote
 
 
0 #470 918kiss free spin 2019-06-22 21:40
You are thinking about creating a solid horizontal line in the bonus ball game.
Each time you put money in, part than it goes to a
larger jackpot feature. Another consideration iis the payout of this machine.


Allso visit my web site - 918kiss free spin: http://teachingengine.net/__media__/js/netsoltrademark.php?d=eatfresh.ru%2Fbitrix%2Frk.php%3Fgoto%3Dhttps%3A%2F%2F3win8.city%2Findex.php%2Fother-games%2F918kiss-scr888
Quote
 
 
0 #469 scr 888 2019-06-22 21:09
Again it's time consuming getting to grips using it but this inn the conclusion. Give peoploe something oof value for
free aand reveal thjat you can offer goood content without charge.


Feel free tto surf to my blog post; scr 888: https://scr888.men/
Quote
 
 
0 #468 Madison 2019-06-22 19:06
Heya! I just wanted to ask if you ever have any trouble with hackers?
My last blog (wordpress) was hacked and Iended up losing a
few months off hard work due too no data backup. Do you have any methods to protect against hackers?


Also visit my web page Madison: https://win88.today/3win8-three-kingdoms-hot-games/
Quote
 
 
0 #467 live poker forum 2019-06-22 17:23
Occurred in 2009 when an impressive $33 million was owed
to nearly 27000 players at four offshore blogs.

Ever heard the saying "The house always victories?" this is true even online.
Quote
 
 
0 #466 scr888 2019-06-22 16:11
I am genuinely delighted to read this website posts which consists of lots of useful information, thanks for providing such statistics.


my weblog; scr888: https://918.network/casino-games/72-918kiss-scr888
Quote
 

Add comment

No bad words.


Security code
Refresh


Design by i-cons.ch / etosha-namibia.ch