Menu

Hints and Tips for GCBASIC

2018-05-13
2023-10-28
  • Chris Roper

    Chris Roper - 2018-05-13

    With all the new capabilities that GCBASIC introduces it may be a good Idea to have a place to post Tips, Tricks and any advise or minor fixes that come to light in the next few days.

    This is not for general discussion but will be used more as a FAQ to keep track of the more pertinent Tips or issued raised in the forum that are specifically related to build of the Great Cow BASIC tool chain and in particular the new features thereof.

    Off topic posts will be deleted, but if you have a genuine tip then your contribution is greatly appreciated.

    The wealth of knowledge and the depth of experience of the contributors to this forum never fails to amaze me. We must have some of the most knowledgeable people in the field here and as we all come to terms with the enhanced power this release unlocks for us we all need to support each other.

    So as the final few bytes of Evan's upload tick away - “Gentlemen start your downloads........”

    DOWNLOAD

    Cheers
    Chris

     

    Last edit: Anobium 2023-06-30
  • Anobium

    Anobium - 2018-05-13

    Adding the Pololu AVR programmer

    There is a thread for new programmers, see https://sourceforge.net/p/gcbasic/discussion/chipfileforum/thread/aeacc591/ on the parameters to add a Pololu programmer.

    We will be adding an import facility soon but currently in v0.98.06 you will have to add manually.

     

    Last edit: Anobium 2019-06-12
  • Anobium

    Anobium - 2018-05-13

    How to set the OSCCAL value when programming

    Some parts will require the OSCCAL value to be set. This can be done in the Programme Preference Tool.

    There is a programmer called Microchip PICKit 2 CLI - with OSCCAL this programmer entry accepts an OSCCAL value as an additional paramter. To specify the OSCCAL value update the field called osccal shown on the Tool Variables tab - the value specified will used when programming with the Microchip PICKit 2 CLI - with OSCCAL programmer.

    A similar technique can be used to pass a paramter to any programmer defined.

     
  • Chris Roper

    Chris Roper - 2018-05-13

    Adding CLC Designer to the Toolbar in SynWrite

    If you are using GC Studio with GC Code as your code editor then select <f4>. type CLC and select the CLC Designer.</f4>


    One of the most interesting features, to me at least, is the inclusion of the CLC tool, but where is it? Well it is there but it may be hidden in stealth mode.

    The Path to find it in the menu is:

    IDETools-->GCB tools-->CLC Designer Tool

    But SynWrite has context sensitive menu’s so, depending on the document that currently has the focus, you may or may not actually see the CLC Designer Tool in that path.

    The quick solution is to click + in the editor pane to create a new document and then use the Path above. Alternatively you can get at it in the Windows Start Menu under Great Cow BASIC as CLCDesigner.

    You can also add it to the toolbar.
    Here is a quick way to do that.

    First download the icon image, “clc.png” that is attached to this post and save it into the *C:\GCB@Syn\CLCDesigner * Directory, assuming you used the default install path.

    Now lets add that to the GCBasic Tool Bar.

    Right Click on the PPS Icon and select -> Customize toolbar...
    In the window that opens Click -> Add
    A new ? icon is created, drag it next to the PPS Icon and drop it before the vertical bar.
    Click on the “Select external tool...” button.
    Then click on “CLC Designer tool”
    Click on the “Browse for icon...” Button.
    Select the option “Link PNG file”
    Then click on the “Browse...” Button
    Browse to C:\GCB@Syn\CLCDesigner\clc.png , or wherever you saved it, and Click OK.

    Click OK again and you should have a CLC button next to your pps button in the toolbar.

    The toolbar button will always work, regardless of the currently selected document.

    Cheers
    Chris

     

    Last edit: Anobium 2022-12-02
  • Anobium

    Anobium - 2018-05-13

    Windows XP

    Great Cow BASIC has been tested when using the Microsoft Windows XP operating system. The following applications, part of the Great Cow BASIC IDE tool chain, have been tested and confirmed to be operating as expected.

    • GCB@SYN SynWrite IDE/Editor
    • Great Cow Graphical BASIC
    • Great Cow BASIC compiler
    • Programmer Preference Tool
    • Peripheral Pin Select
    • CLC Designer Tool
    • PICKit 2Plus GUI Software
    • PICKit 3Plus GUI Software
    • PICKitCommandline
    • AVRDUDES
    • AVRDUDE
    • PICKit 2 Legacy GUI Software
    • PK2CMD
    • TinyBootLoader+

    The testing included programming via USB to AVR programmer.

    The prerequisite is .Net. See PPSforXP_Fixes for_dotNetFx40_Full_x86_x64.zip in the PPSTool folder. Ensure these patches are installed.

    If you use Windows XP. It is your decision. We only supportWindows XP with best endeavours. Usage under the Windows XP operating system is "as is" and without any warranty including but not limited to any implied warranty of merchantability, fitness for particular purpose. in no event will can the developers be liable for any incidental, indirect or consequential damages of any kind arising from or related to the use of this software or its derivatives.

    For more information on Windows XP operating system support, see https://www.microsoft.com/en-gb/windowsforbusiness/end-of-xp-support

     

    Last edit: Anobium 2022-09-18
    • Anobium

      Anobium - 2018-05-13

      Programming an existing HEXfile when you do not need/have the source GCBfile

      So, you have a hex file and you want to use one of the programmers to program a microcontroller with an existing HEXfile, but, you do not have the source and you do not want to recompile.

      1. Simply create a new folder.
      2. Copy existing HEXfile to the new folder.
      3. Create in the IDE a new GCBfile with the same prefix as the HEXfile.
      4. Save this file in the new folder.
      5. Add the correct #chip with the chip name. ie #chip 16f88, save.
      6. Press or select FLASH.
      7. Programmer will FLASH the part.

      Enjoy

       
      • Anobium

        Anobium - 2018-05-13

        Using LVP Programming with ease

        Sometimes you will need to use Low Voltage Programming. You will with the Northern Programmer NSDSP Suite of programming software and programmers.

        You DO NOT need to specific LVP on the #config in your source program. You can tell the programmer to use LVP.

        In the PPTool for the specific programmer simple as the config statement to enable LVP during programming. This means that your source code is portable and the programmer constrain is handle correctly.

        The' Northern Programmer NSDSP' programmer is an example. The PPTool comes with the programmer setup to support LVP, as shown in the picture. If you require other configuration items you add more, if they are specific to a programmer.

        See the Required Config field for the Northern Programmer NSDSP programmer example, shown below:

        Enjoy

         

        Last edit: Anobium 2018-05-13
        • Anobium

          Anobium - 2018-05-13

          Support for Mutliple Programmers attached to your computer at one time

          If you have multiple programmers attached to your computer you can use the PPTool to automatically select which programmer to use.

          Let us assume you have two PICKit programmers attached, but, this can different programmers of any type.

          In the PPTool for a specific programmer, let us assume the PICKit 3 Programmer use the DEF(PK3) in the Use if field, as shown below. If your source program has a define PK3 the programmer will be chosen, if not other criteria match. Remember, programmers are processed from the top of the list in sequence - the compiler needs to the find our DEF(PK3) so it is safe put this programmer at the top of the list.

          Create as many programmers with more Use if fields to control your programmers.

          Then, simply add and edit the #define PK3 in your program to automatically select the PICKit3 programmer.

          Enjoy

           

          Last edit: Chris Roper 2018-09-28
          • Anobium

            Anobium - 2018-05-13

            Compiler Option - Verbose Mode

            Verbose mode has been a compiler option for a long time. It has been a hidden parameter that only a few have been using.

            Verbose mode shows you a lot more information about your program, source files, the include files, methods called and a host of other information including the programmer that has selected to be used.

            The option can be found in the PPTool. Select the Compiler tab and select or deselect the Verbose Mode check box. Compile something to see the different information provided.

            Verbose mode can be very useful to understand what the compile is doing and what errors are happening.

            Enjoy

             
            • Anobium

              Anobium - 2018-05-13

              Compiler Option - Show BASIC code as comments...

              Show BASIC code as comments in assembly has been a compiler option for a long time. It has been a hidden parameter that only a few have been using.

              Show BASIC code as comments in assembly shows you a lot more information about the interpretation of the BASIC in your source program, the include files and the methods used. From these comments you see how the BASIC is tranformed into assembly!

              The option can be found in the PPTool. Select the Compiler tab and select or deselect the Show BASIC code as comments in assembly check box. Compile something to see the different information provided by opening the ASM file - to do this press SHIFT-F7.

              Show BASIC code as comments in assembly can be very useful to understand what the compile is doing with your source program and what happening at the lowest level.

              Enjoy

               
              • Anobium

                Anobium - 2018-07-23

                Windows 10 Installation into 'c:\program files' directory structure

                If you install the distribution into the 'c:\program files\', or any derivative of this file structure for your specific Windows architecture you encounter file write errors. These errors will happen when you are NOT an Administrator of the computer.
                To resolve use either of these options:

                Install in the default directory. c:\gcb@syn

                or,

                Change the file permissions as shown in the two step shown in the pictures.

                Step 1.

                Step 2.

                This example shows how to resolve writes issues with USE.INI. Use the same process for other files.

                Enjoy this insight.

                Discovered and resolved by Uteh Str

                 

                Last edit: Anobium 2018-07-23
                • Anobium

                  Anobium - 2021-10-07

                  Patching your installation

                  You can patch your installation to keep the tool chain up to date.

                  Use the GC Studio DEV Channel.

                   

                  Last edit: Anobium 2022-12-02
                  • Anobium

                    Anobium - 2022-01-30

                    Config Geany to work with the compiler

                    When using Geany as the GCB IDE you should make this changes below.

                    This approach will show you the full compilation information within Geany once the compilation has completed, and, to handle errors within Geany.

                    Create a "command line" that calls the compiler directly, and invoking the programmer with the correct .hex file name to program the target device. This example uses the NSDSP programmer (nsprog.exe). If you are using another programmer the portion of the line which invokes the programmer and sets the parameters for the programmer would need changing.

                    You can then add the "command line" in the build menu in Geany so to call directly with a keystroke within Geany.

                    C:\GCB\GCB@Syn\GreatCowBasic\gcbasic.exe  /NP /A:GCASM /K:text /V /P:"C:\GCB_NSDSP\NSDSP\nsprog.exe p -h -e -v -d "PIC"%chipmodel% -i %Fn_NoExt%.hex" %d/%f
                    
                    • The GCB compiler is set to verbose output (/V)
                    • Program using the NSDSP programmer (/P). Using the NSDSP programmer in HVP (-h) without erasing the EeProm (-e) in verbose mode (-v)

                    The command required for a "compile" only (syntax check) is:

                    C:\GCB\GCB@Syn\GreatCowBasic\gcbasic.exe  /NP /A:GCASM /K:text /V %d/%f
                    

                    You should add the regular expression on my Geany build menu to:

                    (?P<file>[^(]+) \((?P<line>\d+)

                    This allows any compilation errors to be highlighted and navigated to automatically by clicking on the error message in the Geany compiler tab.

                    Here is an image of Geany having just performed a successful compile of a small program to show how it looks.

                     

                    Last edit: Anobium 2022-01-30
  • Anobium

    Anobium - 2018-05-13

    Do not reply to this thread.

    If you want to comment, or make a comment relative to these postings or the release - create a new posting and use the thread/post URL for reference.

    PLEASE DO NOT HIJAAK THIS THREAD

    Anobium

     
  • Chris Roper

    Chris Roper - 2020-09-12

    You should start a new topic, see the post above yours.

    But as you are new, this should serve as a starting point for you:
    http://gcbasic.sourceforge.net/help/_tone.html

    If you want to discuss it further, start a new thread with a new topic.

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.