Menu

A bit of fun with a Microchip Xpress Board... using the new release...more tools more fun

Anobium
2018-05-12
2018-05-13
  • Anobium

    Anobium - 2018-05-12

    This code just makes me smile.

    The power of CLC! The SLEEP is real.. and yet, the LEDs still come and off when the button is pressed.

    #chip 16f18855,32
    
    '' -------------------LATA-----------------
    '' Bit#:  -7---6---5---4---3---2---1---0---
    '' LED:   ---------------|D5 |D4 |D3 |D1 |-
    ''-----------------------------------------
    '''
    
    #define SWITCH      PORTA.5
    
    #define LEDD2 PORTA.0
    #define LEDD3 PORTA.1
    #define LEDD4 PORTA.2
    #define LEDD5 PORTA.3
    
    Dir     LEDD2 OUT
    Dir     LEDD3 OUT
    Dir     LEDD4 OUT
    Dir     LEDD5 OUT
    
    'setup switch (SW1)
    dir SWITCH in
    
    'Generated by PIC PPS Tool for Great Cow Basic
    'PPS Tool version: 0.0.5.19
    'PinManager data: v1.65.2
    '
    'Template comment at the start of the config file
    '
    #startup InitPPS, 85
    
    Sub InitPPS
    
            'Module: CLC1
            RA0PPS = 0x0001    'CLC1OUT > RA0
            RA1PPS = 0x0001    'CLC1OUT > RA1
            RA2PPS = 0x0001    'CLC1OUT > RA2
            RA3PPS = 0x0001    'CLC1OUT > RA3
    
    End Sub
    'Template comment at the end of the config file
    
    CLC1GLS0  = 0x01
    CLC1GLS1  = 0x00
    CLC1GLS2  = 0x00
    CLC1GLS3  = 0x00
    CLC1SEL0  = 0x00
    CLC1SEL1  = 0x00
    CLC1SEL2  = 0x00
    CLC1SEL3  = 0x00
    CLC1POL   = 0x00
    CLC1CON   = 0x81
    CLCIN0PPS = 0x05
    CLCIN1PPS = 0x00
    CLCIN2PPS = 0x00
    CLCIN3PPS = 0x00
    
     sleep
    
    end
    

    A clue

    :-)

     

    Last edit: Anobium 2018-05-12
  • Chris Roper

    Chris Roper - 2018-05-12

    Very clever and a nice example of the power of CLC support making its debut in Great Cow BASIC with this new release.

    So if you are not yet up to speed with PPS and the PPS Tool, brush up now because it is about to expand into new dimensions.

    What is CLC?

    Configurable Logic Cell - (or sometimes called PLA - Programmable Logic Array).
    Yes the new PIC's all have configurable hardware to reduce the need for external 555 timers, op amps, comparators or 4000 logic.

    It is all controlled by PPS and CLC.
    Look in the examples folder and Help System - have fun.

    Cheers
    Chris

     
  • Moto Geek

    Moto Geek - 2018-05-12

    Holy Cow!!!! This is very cool! Exciting stuff...

     
    • Anobium

      Anobium - 2018-05-12

      I am uploading the next right now.

      It will tomorrow until I get the files in the right place etc.. but, hours not days.

      This is a cool release - there will be a learning curve for those that loved batch files but this is so much better, we have new tools and new capabilities. A huge community effort.

      With PICKitPlus nearly ready (a few of us have it fully integrated into the release candidate) it makes so easy! No more fussing out - choose a chip and program. When you learn the logic of the new programming capability it is very clever. I have attached and working lots of different programming and Great Cow BASIC is programming will no changes.

      Lots of do. Must go.

       
  • stan cartwright

    stan cartwright - 2018-05-12

    Op-amp? Not xpress 18f18855...is there?

     
    • Chris Roper

      Chris Roper - 2018-05-12

      Unfortunately not., but the 18f18855 has got 4 x CLC's, that should keep you going for a while.

      The sister series PIC16F178x are the ones with Intelligent Analog and have up to 3 op-amps, 8 Bit DAC and several comparators etc. and GCBASIC Supports them.

      A quick scan of the Microchip database returns the following devices as having Op-Amps integrated:

      PIC12F752
      PIC16F753
      PIC16F527
      PIC16F570
      PIC16F170x
      PIC16F178x

      If the current trend continues you can expect most new releases to have PPS, Intelligent Analog, CLC and Core Independent Peripherals.

      Any one who tells you that 8 bit is dead is not keeping up with developments.

      Cheers
      Chris

       

      Last edit: Chris Roper 2018-05-12
      • stan cartwright

        stan cartwright - 2018-05-12

        I was looking through the microchip 8bit pic info, scrolling left/right not fun.. and saw pics with one op amp. One is never enough. I must order some 5V to swing to rail ones.
        The clc tool is supposed to be stand alone to asm and c but can't find,-only mplabx plugin.
        Lots of uses it seems http://ww1.microchip.com/downloads/en/DeviceDoc/41631B.pdf

         
        • Chris Roper

          Chris Roper - 2018-05-12

          The CLC tool is now part of GCBASIC, no need for MPLABx, that is the reason for this thread.

          The Release of Great Cow BASIC, that will be available in the next few days, includes the PPS and CLC tools, (our version of the MCC) that generate code native for inclusion in GCBASIC not just XC8 or MASM, an integrated version of PICKitPlus (that supports PICKit2 and PICKit3 interchangeably and on the fly) and it eliminates the need for MPLABx by being fully integrated with the latest version of Syn@write IDE. Not only is GCBASIC faster and easier to use than MPLabX it is also smaller and portable (USB install).

          I have heard unconfirmed rumours of a Port to Mac and Linux too, but that is way outside of my domain so count it as gossip only :)

          As for Op-Amps I have some MCP6001 devices that I used to design an Oscilloscope front end, they are the same as the OP-AMP's incorporated into the PIC's. They are fully Rail to Rail and 5V with 1 MHz bandwidth and if you need more than one you can get the MCP6002 or the MCP6004 which are dual or quad versions of the 600x series.

          PIC 8 BIT microcontrollers are getting more powerful and flexible with each new release, and with increased power and performance you increase complexity, but Great Cow BASIC is keeping pace and helping to make the complexity manageable for student, hobbyist and Professional alike.

          Cheers
          Chris

           
          • stan cartwright

            stan cartwright - 2018-05-13

            As you mentioned op amp/scope- I want to make an "octopus" tracker.
            It's sort of a component tester. I have one..ebay but this needs x/y scope.
            My hantek x/y falls over so I did a x/y scope on gcb glcd with 2 a/d.
            It needs a 50Hz sine and it swinging around 2.5V.
            it's for my own interest and a mate nagging me to make one.
            Lots of op amp options.

             
  • Anobium

    Anobium - 2018-05-12

    And, another to make it even more fun.

    Only CLC feeding into another CLD and into the LEDs.

     
  • Anobium

    Anobium - 2018-05-12

    I will upload the release tomorrow.

     
  • Moto Geek

    Moto Geek - 2018-05-13

    This has the potential of messing up a perfectly good Mother's Day at my house tomorrow...

     
  • Sleepwalker3

    Sleepwalker3 - 2018-05-13

    Hey this sounds great guys! Thanks to all the people that contributed to this, I wish I could contribute myself but family health issues have kept me from gcb for some time. I like the CLC idea, especially as I deal with GALs (and PALs) still. The analogue stuff is very interesting too.
    So this PICkitPlus, is it software for the existing Pickit3? Thnaks again for the great effort put in.

     
    • Anobium

      Anobium - 2018-05-13

      Good to hear from you!

      PICKitPlus is new life in your old programmers like the PK2 and PK3. Works very very nicely. Watch for more news soon. We have a few guys doing Beta testing prior to proper release but you do not need PICKitPlus for the new releases.

       
  • Sleepwalker3

    Sleepwalker3 - 2018-05-13

    Thanks Anobium - I actually was reading about PICkitPlus as you were posting! I hadn't seen the posts about it, just haven't had time, but was eager to see what was in the latest release of GCB, I have a PicKit3, so this sounds like it will be useful when I can get some time to get back on GCB projects. Good Work.

     

Log in to post a comment.