Forum - MCS Electronics

 

FAQFAQ SearchSearch RegisterRegister Log inLog in

Simulator Help ??

 
Post new topic   Reply to topic    www.mcselec.com Forum Index -> BASCOM-AVR
View previous topic :: View next topic  
Author Message
njepsen

Bascom Member



Joined: 13 Aug 2007
Posts: 469

newzealand.gif
PostPosted: Fri Apr 21, 2017 8:40 am    Post subject: Simulator Help ?? Reply with quote

I have never used the simulator, because i have not been able to make head nor tail of how it works.Is there a help file anywhere?

(BASCOM-AVR version : 2.0.7.8 )

_________________
Neil
Back to top
View user's profile
albertsm

Administrator



Joined: 09 Apr 2004
Posts: 5921
Location: Holland

blank.gif
PostPosted: Fri Apr 21, 2017 8:58 am    Post subject: Reply with quote

F1
_________________
Mark
Back to top
View user's profile Visit poster's website
olhexy

Bascom Member



Joined: 03 Apr 2011
Posts: 192
Location: Tilburg, Netherlands

netherlands.gif
PostPosted: Fri Apr 21, 2017 3:01 pm    Post subject: Reply with quote

F1 = "How I gan get help in Windows 10" Wink

Shift F1 = Help Bascom
Back to top
View user's profile
albertsm

Administrator



Joined: 09 Apr 2004
Posts: 5921
Location: Holland

blank.gif
PostPosted: Fri Apr 21, 2017 3:09 pm    Post subject: Reply with quote

F1 in BASCOM will show the BASCOM Help file.
And when you press F1 while selecting the menu option (program simulate in this case) you go direct to that help topic(when it exists).
Press F1 on a keyword result in going to the help of that keyword.
Pressing F1 goes to the index.
I do not recall that it works different in WIN10?

_________________
Mark
Back to top
View user's profile Visit poster's website
olhexy

Bascom Member



Joined: 03 Apr 2011
Posts: 192
Location: Tilburg, Netherlands

netherlands.gif
PostPosted: Fri Apr 21, 2017 4:45 pm    Post subject: Reply with quote

Well, today on my computer with Windows10 Home, version 1607 everything works the way you say when I press Shift F1 in stead of F1.

Just F1 always brings up Bing Search with "How I gan get help in Windows 10"
(https://www.b i n g.com/search?q=hoe+kan+ik+hulp+krijgen+in+windows+10&filters=guid:%22e45d5cb3-84b8-4a97-b55f-fa7301dacb48%22%20lang:%22nl-nl%22&form=S00028)


(I do not use Bing, so it think MS may have overruled Bascom F1 function key; I recently got the 'creators update')
Back to top
View user's profile
albertsm

Administrator



Joined: 09 Apr 2004
Posts: 5921
Location: Holland

blank.gif
PostPosted: Fri Apr 21, 2017 7:00 pm    Post subject: Reply with quote

odd. works for me normal in win10.
But i do not have the latest version.

_________________
Mark
Back to top
View user's profile Visit poster's website
EDC

Bascom Expert



Joined: 26 Mar 2014
Posts: 971

poland.gif
PostPosted: Fri Apr 21, 2017 8:27 pm    Post subject: Reply with quote

It is normal/obvious that system (Windows) must be focused on Bascom in the time you press F1 because almost every program have their own Help with F1.
So when I click on the my desktop and press F1 I got Windows help but when I click on the Bascom window and cursor blink on it and then press F1windows brings Bascom Help...
but there is even more.
When you set cursor after some keyword/command yu get help about this command, but this Mark mention before.
If enyone interested more ( and I swear it is worth it) you can read BASCAVR.pdf in bascom folder. It is some kind of another help file.

Maybe on the begining in programming you can think that advanced shortcuts in IDE are not needed.
Hmm its your choice but I can`t imagine now how to code without CTRL+SHIFT+I or CTRL+SHIFT+U Very Happy
Those two will take (selected first) block of code to the Right or Left

..but If you have a long code where variables declarations are in the top and you are thousant lines of code from it - how to quick jump to the top for variable name or so and quick back? Very Happy

Ahaha Very Happy This is the point where keyboard shortcuts comes in Very Happy

In the top You make first Bookmark by pressing (reasonable quick) "CTRL + K + 1"

In The place you are, when you want to jump and back, set next Bookmark by "CTRL + K + 2"

..and then magic jump to first place "CTRL + Q + 1" and you are teletransported Very Happy
Best thig is that You can back with "CTRL + Q + 2" you set before Very Happy


All this things I learn from BASCAVR.pdf

Now I have request because I can`t find this today how to automatically add "End If", "Next" or another needed but obvious stuffs. I read about this but I cant find this today. This was some kind of macros and some of them can be added by user. With every code it's getting more and more worth it learning shortcuts and bascom features.
Back to top
View user's profile Visit poster's website
albertsm

Administrator



Joined: 09 Apr 2004
Posts: 5921
Location: Holland

blank.gif
PostPosted: Fri Apr 21, 2017 8:38 pm    Post subject: Reply with quote

you mean CTRL+J
type for and press CTRL+J

or just CTRL+J

also try CTRL+SPACE some time

_________________
Mark
Back to top
View user's profile Visit poster's website
njepsen

Bascom Member



Joined: 13 Aug 2007
Posts: 469

newzealand.gif
PostPosted: Fri Apr 21, 2017 8:52 pm    Post subject: Reply with quote

Doesn't do anything on my PC ( Win 7). I still cannot find help on the simulator. Can I navigate to it manually? ( if it exisits)
_________________
Neil
Back to top
View user's profile
albertsm

Administrator



Joined: 09 Apr 2004
Posts: 5921
Location: Holland

blank.gif
PostPosted: Fri Apr 21, 2017 8:58 pm    Post subject: Reply with quote

The help on the simulator is in the bascom-avr help file.
This is the help file you get when you press F1 in bascom.
So do you get the help file?
If not you should re-install.
Or download the bascom-avr manual in PDF format. It is the same as the help file. you can download it from the mcselec.com download section.
Or just go to the avrhelp.mcselec.com on line help.

_________________
Mark
Back to top
View user's profile Visit poster's website
olhexy

Bascom Member



Joined: 03 Apr 2011
Posts: 192
Location: Tilburg, Netherlands

netherlands.gif
PostPosted: Fri Apr 21, 2017 10:53 pm    Post subject: Reply with quote

I solved the problem for the F1 help key.
On my laptop I have 12 system function buttons (for volume up/down, screen light up/down, and several other system-functions), that are combined with program function keys F1...F12.
There is also the FN key. With that you select program-functions or system-functions. In the bios I can set the type of action for FN.
? (at F1 button) means system help, by default. If I mean program function F1, I have to press also FN.
But this FN action can also be reversed in the bios: then F1 means program function F1 by default, and I need to press FN if I want ? (at F1 button).
So I changed it in bios, and now F1 works as it should in Bascom.
[Apparently I could also use the Shift in stead of FN.]

@njepsen
If you can get on the forum then it is very easy to click "Back to main site" and select "BASCOM-AVR Help". I used this most of the time, in stead of that in Bascom.

@njepsen(2)
As a beginning try to understand this https://www.mcselec.com/index2.php?option=com_forum&Itemid=59&page=viewtopic&t=13803&highlight=
Please find LINK TO VIDEO.
EDC produced a simple demonstration how to measure time of a routine with The Simulator.
Back to top
View user's profile
njepsen

Bascom Member



Joined: 13 Aug 2007
Posts: 469

newzealand.gif
PostPosted: Sun Apr 23, 2017 7:33 am    Post subject: Reply with quote

The video didn't help much. I have not come across !NOP before. what is it?
I was trying to time how long a loop took to run. Eventually I set an output & measured it with the scope. Took a lot less time.

_________________
Neil
Back to top
View user's profile
olhexy

Bascom Member



Joined: 03 Apr 2011
Posts: 192
Location: Tilburg, Netherlands

netherlands.gif
PostPosted: Sun Apr 23, 2017 10:36 am    Post subject: Reply with quote

!NOP
NOP is the Assembler instruction for 'No Operation'. It takes 1 clock cycle, does nothing and goes to next instruction.

You tell the Bascom editor that this is an Assembler line. By putting an exclamation mark ! at the beginning of the line.
In Bascom Help it is explained in "Mixing ASM and BASIC".

Learn about AVR Assembler here http://www.atmel.com/webdoc/index.html
Good help for beginners: http://avr-asm-tutorial.net/
Back to top
View user's profile
EDC

Bascom Expert



Joined: 26 Mar 2014
Posts: 971

poland.gif
PostPosted: Sun Apr 23, 2017 11:30 am    Post subject: Reply with quote

You don`t need to know asm for using this one instruction in simulator Very Happy

NOP mean "waste one processor cycle and do nothing"

I put those NOP`s into the code because if you want to all your code to be executed and simulator shoud then stop, you cannot stop in the place where is no code.
If you set cursor on the empty line and try "Run to" then you will get info that this line dont contain any executive code"
So this NOP not change the code but give you opportunity for stopping.

This is also useful when you want to clear cycles counter before procedure testing.

Those NOP`s simply add executive code for mentioned simulator purposes but this code do nothing.
Back to top
View user's profile Visit poster's website
albertsm

Administrator



Joined: 09 Apr 2004
Posts: 5921
Location: Holland

blank.gif
PostPosted: Sun Apr 23, 2017 12:24 pm    Post subject: Reply with quote

Instead of NOP you can also use the BASCOM BASIC BREAK statement.
It will halt the Simulator but also the AVR STUDIO simulator when the processor supports the BREAK instruction.
The code itself behaves like a NOP.
This said, there is no need for break or nop. Just use F8 to step through the code, or set a breakpoint and step from there.

Most external hardware can not be simulated, but using $SIM and conditions like #IF _SIM you can include or exclude code from simulation.

_________________
Mark
Back to top
View user's profile Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    www.mcselec.com Forum Index -> BASCOM-AVR All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum