Menu

Where are the .inc files

2018-07-10
2022-07-02
1 2 3 > >> (Page 1 of 3)
  • Jeffrey Kaplan

    Jeffrey Kaplan - 2018-07-10

    I remember from MPLAB that the .inc file contains substantial info.
    Here I have succeeded with #include <P16F84A.inc> and i would like to be able to read and print this .inc file. I need the location C:\whatever of the .inc files

     

    Last edit: Jeffrey Kaplan 2018-07-10
  • Anobium

    Anobium - 2018-07-10

    Why? we transform the INC file into the GCB dat file.

    Are you looking for the DAT file?

     
    • Jeffrey Kaplan

      Jeffrey Kaplan - 2018-07-11

      thanks for your help.

       
    • Jeffrey Kaplan

      Jeffrey Kaplan - 2018-07-11

      thanks for your help.

       
  • bed

    bed - 2018-07-10

    On Top, even they are named .dat are they in Clean ASCII.
    Folder chipdata

     
  • stan cartwright

    stan cartwright - 2018-07-10

    16f84a dat is in GCB@Syn/GreatCowBasic/chipdata
    It can be read with notepad

     
  • Jeffrey Kaplan

    Jeffrey Kaplan - 2018-07-11

    What a tremendous occasion that this Forum works.Thanks to all!

     
  • Jon Nelson

    Jon Nelson - 2022-05-31

    Using gcbasic /version 0.98.<<>> 2021-<<>>-24 (Linux 64 bit) Build 1005 with MPLAB X IDE v6.00 to attempt initially blink LED on PIC.
    '#Chip 16f88' generates assembler code...

    #include <P16F88.inc>
    

    (NB uppercase P16F88 above)
    MPLAB shows..."../../../gcbasic/ledFlashPIC16F88.asm:10:10: fatal error: 'p16f88.inc' file not found"
    http://picforum.ric323.com/viewtopic.php?f=2&t=24 indicates a need to change line P16F88.inc to lower case, however error persists.
    We found /usr/local/include/freebasic/16f88.dat but that does not help find the .inc file.

     

    Last edit: Jon Nelson 2022-05-31
    • Anobium

      Anobium - 2022-05-31

      John... are you a newbee to Great Cow BASIC ?

       
  • Jon Nelson

    Jon Nelson - 2022-05-31

    Yes, never used it before. The second line of http://gcbasic.sourceforge.net/usingforum.html got us here.

     

    Last edit: Jon Nelson 2022-05-31
  • Anobium

    Anobium - 2022-05-31

    ah....

    Welcome to Great Cow BASIC. This information is especially important for experienced PIC users moving from MPASM or C so please read. It could save you hours of frustration.

    As a PIC user most of us are conditioned, regardless of the Assembler or Compiler, to reach for the devices data sheet first and try to work out how to setup the Oscillator, interrupt vectors and Configuration bits.

    Reading this first as it will give you some great insights. For the basic operation the only setup and configuration required for a Great Cow BASIC program is the name of the target Device i.e. #Chip 16f1619. That is it, honestly, Great Cow BASIC will do the rest and will determine the optimal Oscillator settings, interrupt vectors, Configuration bits etc

    Next we would start deciding on and including the Device files and libraries that we intend to use. Great Cow BASIC does a lot of this automatically. Great Cow BASIC is creating Portable Code, it doesn’t care if you use a PIC12, PIC18 or an ATmega328. You write in BASIC and at compile time Great Cow BASIC will decide which core libraries to include based on the instructions you have used and the target device you specified in the #chip statement.

    Finally we would decide on the pins to use, their port names, which register bits are needed to make them inputs or outputs and override any Analog function if a digital function is desired.

    Again, Great Cow BASIC will do this for you - Dir PortC.0 In - Will set Pin RC0 to a Digital Input. There is no need to manually set the TRIS register or see if there is an associated ADCON bit to set or clear.

    Putting it all together: An example Great Cow BASIC program.

    #Chip 16f88
    
    #Define LED PortC.0
    Dir LED Out
    
    Do
      LED = !LED
      Wait 500 ms
    Loop
    

    That is it. If you have an LED attached to PortC.0 (LED DS1 on a PCB/board, program using your programmer. It will start to Blink confirming that you have a working microcontroller and hardware.

    To change target device or family just change the #Chip Entry along with the Pin you have the LED on and recompile. it Really IS as Simple as that to get started in Great Cow BASIC.

    You can manually override Great Cow BASIC and set every register, every flag, every BIT, every Configuration ‘Fuse’ and every vector if you wish, but why bother doing it upfront? Rather get your code working with the default settings and then adjust from there, if needed, as your confidence grows.

    There are 1000s of Demos, there are examples of all of the most common programming challenges and many different devices which, along with the Help files, will answer most of your questions.

     

    Last edit: Anobium 2022-05-31
  • Jon Nelson

    Jon Nelson - 2022-05-31

    Hopefully this explains problem better

     
  • stan cartwright

    stan cartwright - 2022-05-31

    Jon, GCB is simple if you are used to Basic. You got to be old to think of basic as a programming language but if you do then programming pics and avr with gcb is easy to learn and versatile to use. Gcb generates efficient code.
    Trying the demos is a good idea when starting with gcb.
    I use gcb windows version, the linux version and setting up geany was too much for me on rpi400 but gcb is built.

     
  • Anobium

    Anobium - 2022-05-31

    Jon,

    The ASM has the reference to the INC to support the use of MPASM, MPLAB-IDE or PIC-AS. There is no requirement to use any of those tools as Great Cow BASIC can generate the HEX using GCASM. The use of GCASM is part of the commandline parameter.

    So, if you want a HEX just use GCASM - is is easier.
    So, if you want to use the ASM generated by Great Cow BASIC to walk the ASM in MPLAB then MPLAB will have the required include files.

    So, what are you trying to do? Gen a hex? walk in the simulator in MPLAB?

     

    Last edit: Anobium 2022-05-31
  • William Roth

    William Roth - 2022-06-02

    @Jon

    To answer the question directly. The p16F88.inc file is located in the "MPASMX " folder, assuming MPLABX Ver 5.35 which is the last version of MPLABX that supports MPASM.

    Typically the inc file will be the folder "C:\Program Files (x86)\Microchip\MPLABX\v5.35\mpasmx"

    However If you are using MPLABX Ver 6.0 then MPASM is not supported and you must set PIC-AS as the assembler in GCB as well as in MPLABX Ver 6.0.

    My suggestion is that if you for some unknown reason are attempting to generate MPASM with GCB and then Assemble/Debug in MPLAB that you use MPLABX Ver 5.35 (Not Version 6.0)

    If you are dead set on using MPLABX Ver 6.0, Then try setting the Assembler in GCB to PIC-AS.

    You should be using the latest version of GCB.

    My Question is why are you using MPLAB at all ? It is certainly not needed to to write code or to program a chip. GCB can do all that without MPLAB

    William

     

    Last edit: William Roth 2022-06-02
  • stan cartwright

    stan cartwright - 2022-06-02

    "My Question is why are you using MPLAB at all ? It is certainly not needed to to write code or to program a chip. GCB can do all that without MPLAB"
    why do gcb users use mplab?? Seems lots of gcb sopport for mplab... avr users not but what am I missing by never used it?

     
  • William Roth

    William Roth - 2022-06-03

    @Stan,

    If you can sort through all of the bloat, MPLABX can be good for for debugging code. There are also a bunch of tools to help with programming peripherals and such. (if you can use Assembly language or XC8.) The problem for me in regards to MPLABX is that is it so huge I have a hard time finding my way around.

     
    • Anobium

      Anobium - 2022-06-03

      I am funding a new Debugger project for PICs. The project have the same capability as using the Debugger in mplab but without the bloat. When a beta product is really I will be asking for reviewers.

      The Debugger will Halt, Single Step, Show registers, Set registers. It will be very much like MPLAB of old. It will have a fast to load UI and a command line option.

      I will post a new thread when I have more news.

       
  • stan cartwright

    stan cartwright - 2022-06-03

    I'm an old dog that can't learn new tricks. Most of my code doesn't work first time so debugging is sometimes printing variables especially using gldc as you can print them on the glcd.
    After uasing picaxe I was sceptical about gcb and at the time it seemed "old" even then but when I first flashed a pic was amazed.. even though I had to get pickit2 and realised clk and data were different pins to picaxe.
    It was when I used an arduino with it's usb plug and play that I thought "this is really good".
    I try to promote gcb when I can. It's an excellent alternative for coding arduino if you can't do C+.
    The nano 328 boards are nice to use and the lgt328 is really nice if you want fast code.
    Wouldn't it be nice to just step through a gcb basic program and show all variables and their basic values? It wouldn't do anything just a simulation of the code flow,
    Maybe dim var defines a memory address so could that address be got back as the basic variable that was dimmed ie name?
    ps. I had thought of an on pin interrupt to send all variable values to the terminal

     

    Last edit: stan cartwright 2022-06-03
  • Jon Nelson

    Jon Nelson - 2022-06-06

    Progress report:
    Thanks to all contributing especially Anobium for saying p16f88.inc is 3rd party i.e. from MPLAB and William for defining location down to specific MPLAB versions.
    As (case insensitive) $ sudo find / -iname p16f88.inc
    shows no matches with MPLAB X IDE v6.00 onboard we decided to change, as suggested, from...
    $ gcbasic ledFlashPIC16F88.gcb /O:ledFlashPIC16F88.asm followed by MPLAB X IDE
    to
    $ gcbasic /A:GCASM ledFlashPIC16F88.gcb
    generating ledFlashPIC16F88.hex for inputting into MPLAB IPE v6.00
    (NB Before pressing Program button put in advance mode and under Power Settings tab/Power target circuit from PICkit3 check it is Unticked for a powered target)

    Using ledFlashPIC16F88.gcb, matching Anobium's example, containing...

    #Chip 16f88
    #Define LED PortA.0
    Dir LED Out
    Do
      LED = !LED
      Wait 500 ms
    Loop
    

    Above worked and LED flashes. Moving on... 1/2

     

    Last edit: Jon Nelson 2022-06-06
  • Jon Nelson

    Jon Nelson - 2022-06-06

    Moving on to...
    https://github.com/Anobium/Great-Cow-BASIC-Demonstration-Sources/blob/master/Serial_Communications_Solutions/Software_Serial_Optimised_for_Speed_and_Size/Ser1Send_16F1886.gcb (slightly adapted for PIC16F88)...

    $ gcbasic /A:GCASM PIC16F88softSerialTX.gcb
    Great Cow BASIC (0.98.<<>> 2021-<<>>-24 (Linux 64 bit) : Build 1005)
    Compiling PIC16F88softSerialTX.gcb ...
    Cannot find /opt/GCBASIC/include//SoftSerialCh1.h
    Cannot find /opt/GCBASIC/include//SoftSerialCh2.h
    Cannot find /opt/GCBASIC/include//SoftSerialCh3.h
    Errors have been found
    

    $ sudo find / -name softserial.h
    Two matches found and fortunately they have same checksum...
    $ md5sum ~/GreatCowBASIC/include/softserial.h /opt/GCBASIC/include/softserial.h
    bc3133246ef5c30ca5efe291c541b766 ~/GreatCowBASIC/include/softserial.h
    bc3133246ef5c30ca5efe291c541b766 /opt/GCBASIC/include/softserial.h

    softserial.h contains...

    '*** 3 independent channels in 3 different files:
    #include <SoftSerialCh1.h>
    #include <SoftSerialCh2.h>
    #include <SoftSerialCh3.h>
    

    $ sudo find / -iname SoftSerialCh1.h
    finds /opt/GCBASIC/include/softserialch1.h
    so it seems SoftSerialCh1.h doesn't exist
    To try: Modify all 3 files for consistent case file naming and comment out SoftSerialCh2.h and SoftSerialCh3.h as we only need one serial channel

    PIC16F88softSerialTX.gcb now contains...

    ; ----- Include library
    '#include <softserial.h>
    #include "./softserialLinux.h"
    

    softserialLinux.h contains...

    '*** 3 independent channels in 3 different files:
    #include <softserialch1.h>
    '#include <SoftSerialCh2.h>
    '#include <SoftSerialCh3.h>
    

    Result: Program assembled successfully
    2/2

     

    Last edit: Jon Nelson 2022-06-06
  • Anobium

    Anobium - 2022-06-06

    Jon,

    In the context of 'I am not the Linux' expert. Are the filenames in your include files are lowercase? The archive with the Linux distro should have all files in lowercase.

    If everything is lowercase - all should be good.

     
  • Jon Nelson

    Jon Nelson - 2022-06-06

    @Anobium "If everything is lowercase - all should be good" is true but they don't need to be. For case sensitive Linux, Fred.txt and fred.txt are two different files. All that needs to be done is ensure the name in the include matches exactly the name of the file to be included.
    Compatibility with Windows is not compromised.

    #include <SoftSerialCh2.h>
    

    is fine as long as SoftSerialCh2.h exists.

     
    • Anobium

      Anobium - 2022-06-06

      But, we ship (or are meant to ship) with everything in lowercase. And, the include statement should be in lowercase.

      So, the #include statement should be in lowercase... as there is no point in have all the files in lowercase.

      So, we should fix the issue as source and change the .h files to resolve the issue. (I am not aware that this principle of lower case has been applied to all .h include files.)

       
1 2 3 > >> (Page 1 of 3)

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.