Menu

new PIC CLCDesignerTool with simulator

2021-09-11
2022-06-08
  • Jerry Messina

    Jerry Messina - 2021-09-11

    For those with an aversion to MPLABX, or who just want a simple, easy to use standalone tool
    there is a new, updated version of the old CLCDesignerTool available.

    CLCDesignerTool V4 adds features not available in the original version, including:
    - support for all PIC18 devices (also supports PIC10/12/16, and a few PIC24 devices)
    - support for up to 8 CLC modules
    - CLCSELECT register overlay support
    - enhanced device ini file format with improved CLC and PPS input and output selections
    - BASIC or C output code generation
    - output format selectable to support different dialects of BASIC
    - improved file operations (Open, Save, Save As)
    - ability to load different device configuration files
    - new ViewCode window to preview output
    - improved output register settings display

    There is also a simulator tool available, allowing you to view the interaction of the various CLC module elements.

    The files are available at:
    https://www.sfcompiler.co.uk/wiki/pmwiki.php?n=SwordfishUser.CLCDesignerTool

     

    Last edit: Jerry Messina 2021-09-11
  • Anobium

    Anobium - 2021-09-11

    Great info.

     
    • Anobium

      Anobium - 2021-09-11

      @Jerry Messina

      Can I include the software URL in the Great Cow BASIC installation? Just the URL shown above. I would then delete the old version of CLC Designer in the Great Cow BASIC installation.

       
  • Jerry Messina

    Jerry Messina - 2021-09-11

    Sure Evan. That's a public URL so links are more than welcome.

     
  • Anobium

    Anobium - 2021-09-12

    Thank you.

    Is there anyway we can import the old format CLC files ?
    And, a question for the documentation of Great Cow BASIC. What is the developent tool? And, where is the source repository ( Guthub/SourceForge/other?). And, what is the license?

    The context is changing this documentation.
    https://sourceforge.net/p/gcbasic/discussion/579126/thread/0d009b1785/ This post ensures we have documented the Supply Chain of the Great Cow BASIC toolchain.

     

    Last edit: Anobium 2021-09-12
  • Jerry Messina

    Jerry Messina - 2021-09-12

    Is there anyway we can import the old format CLC files ?

    If by "old CLC files" you mean the CLCDesigner,ini file, then no.
    While similar, changes were made to support the use of 8 CLC modules and the CLCSELECT method of accessing the registers used in some of the new chips.

    Old "C" output files would probably import ok, but there's no support for ASM files in this version.

    And, a question for the documentation of Great Cow BASIC. What is the developent tool?

    C# (VS 2008)

    And, where is the source repository ( Guthub/SourceForge/other?).

    Currently there isn't one. Maybe at some point in the future...

    This post ensures we have documented the Supply Chain of the Great Cow BASIC toolchain.

    Well, it's not really part of the GCB toolchain, is it?

     
    • Anobium

      Anobium - 2021-09-12

      Thank you.

      I can post the eaelier version project files. Then, you can have a look.

      Thanks for the development insigths. I was thinking of changing the CLC Designer Start icon to the URL - this is then an implied component of the toolchain. I can update the Supply Chain document to show the URL and then 'they' can decide how to handle. If they are concerned they can contact the author directly.

       
      • Anobium

        Anobium - 2021-09-12

        Example INC file from CLCDesigner.

        // File: PWM with CCP via CLC module to control LED.inc
        // Generated by CLC Designer, Version: 3.0.0.4
        // Date: 09/05/2021 23:12
        // Device:PIC16(L)F1885x

         

        Last edit: Anobium 2021-09-12
  • Jerry Messina

    Jerry Messina - 2021-09-12

    I can post the eaelier version project files. Then, you can have a look.

    Be more than happy to. It would be nice if it at least imported old design files.

    One thing that I know would cause a problem is the device selection... the device list is specified differently between the two so V4 might not find the old device.

     
  • Jerry Messina

    Jerry Messina - 2021-09-12
    // File: PWM with CCP via CLC module to control LED.inc
    // Generated by CLC Designer, Version: 3.0.0.4
    // Date: 09/05/2021 23:12
    // Device:PIC16(L)F1885x
    

    So, I tried importing that into V4. Here's what I found:

    First off, V4 expects files to have either ".bas" or ".h" extension... there's no wildcard filter in the File|Open control. You can get it to open it by specifying * .inc in the filename, and then it'll show up (or just change the extension from .inc to .h)

    // Device:PIC16(L)F1885x
    V4 doesn't recognize this device. It has separate entries for PIC16F18855 and PIC16F18857 since they have different PPS input pin mappings and therefore can't use the same entries.

      CLCIN0PPS = 0x05;
      CLCIN1PPS = 0x00;
      CLCIN2PPS = 0x00;
      CLCIN3PPS = 0x00;
    

    This causes an exception. The first two are ok, but the settings for CLCIN2PPS and CLCIN3PPS are invalid since 0x00 would map them to RA0 and those two functions can't be mapped to RA0.

    The default PON reset values for CLCIN2PPS = RB6 and CLCIN3PPS = RB7.
    Here's how V4 sets those registers when you choose a PIC16F18855:

    // PPS Initialization
    CLCIN0PPS = 0x00;    // RA0
    CLCIN1PPS = 0x01;    // RA1
    CLCIN2PPS = 0x0E;    // RB6
    CLCIN3PPS = 0x0F;    // RB7
    

    That said, it would probably be nice if the program didn't bomb out when it sees something like this. Looks like there's a little more work to do...

     

    Last edit: Jerry Messina 2021-09-12
  • Jerry Messina

    Jerry Messina - 2021-09-13

    This causes an exception. The first two are ok, but the settings for CLCIN2PPS and CLCIN3PPS are invalid since 0x00 would map them to RA0 and those two functions can't be mapped to RA0.

    Thinking about this some, what do you think the program response should be when given invalid settings like this?

    It may not matter much since it can't find a direct match to the given device...

     
    • Anobium

      Anobium - 2021-09-13

      Can you put up a warning? As these were valid at some point. :-)

      And, can you regex the device ? remove the PIC16(L)F and make x a wild card like - Device:PIC16(L)F1885x would be stripped to 1885*. Would that work?

       
  • Jerry Messina

    Jerry Messina - 2021-09-13

    Can you put up a warning? As these were valid at some point

    The trouble is, is that even though the old CLCDesigner produced that output, they're NOT valid settings. In this case, setting CLCIN2PPS and CLCIN3PPS = 0 produces undefined operation, and never should have been allowed. That tries to map them to RA0, and they can't be mapped to that pin. That's one of the improvements I made in V4... it only allows valid settings.

    Device:PIC16(L)F1885x would be stripped to 1885*. Would that work?

    No, that wouldn't work either. When it loads a file it needs to match it to a device so that it knows what register set and settings to populate... back to the "V4 only valid settings" thing.

    I could probably put up warnings for these, but I'm not sure I can fix them, esp. the device part.
    It could well end up that they're just not compatible...

     
    • Anobium

      Anobium - 2021-09-13

      OK. I will leave old CLC tool within the Great Cow BASIC installer, I will change the ICON to read 'CLC Designer v3' and when folks install I will create a URL called 'CLC Designer v4'.

      It would be best for all if you moved the software into GitHub. Then, that way the URL would be assured not to change. An idea.


      And, why dont we adapt PPSTool for SwordFish? and, the same for PICINFO for SwordFish? and, there may be other tools that the projects can share.

       
  • Jerry Messina

    Jerry Messina - 2021-09-13

    I've already adapted the PPSTool (with credits to Peter) at https://www.sfcompiler.co.uk/wiki/pmwiki.php?n=SwordfishUser.PPSTool

    Swordfish already has a config tool... the rest of the stuff in PICINFO is probably too specific between the two to try and combine.

     
    • Anobium

      Anobium - 2021-09-13

      Ah ok. Good stuff.

      You should publish PPS to GitHub or SourceForge. This is Open Source and this is the expectation to fork or duplicate the rep.

       
  • ikonsgr74

    ikonsgr74 - 2022-06-08

    I'm using a lot CLC's with my projects, and so far i used MPLAB's MCC to generate code and then copy/paste it into gcb source code :-). Using this tool would be much easier and faster, if only i noticed it earlier.... :-)

     
    • Anobium

      Anobium - 2022-06-08

      Good to hear you used, sad to hear that you only just found. :-(

       

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.