Menu

PIC 12F675 WPU Issue and solution

sfyris
2020-05-13
2020-05-14
  • sfyris

    sfyris - 2020-05-13

    Here I wish to show with the 1st attach image an issue with 1 and 4 MHz configuration which is changing the wpu4 and wpu5 behavior following with solution in 2nd attach image. Don't know if this is elsewere in forum solved, but took 3 days to me to solve so I desided to post it to help others.

     

    Last edit: sfyris 2020-05-13
    • Anobium

      Anobium - 2020-05-13

      Well done for resolving. In the next release of the compiler this should not happen. We have spent a lot of time trying to provide a much easier experience with respect to oscillator selection.

      I will try to explain.

      These are the outcomes in Great Cow BASIC v0,98.07. I have shown the key lines only - a simple program and the compiler message.


      Code case 1: The default = INTRC_OSC_NOCLKOUT, 4Mhz Internal oscillator

      #chip 12f675
      
      Compiler Version (YYYY-MM-DD): 0.98.07 RC08 2020-04-20 (Windows 32 bit)   Program Memory: 20/1024 words (1.95%)   RAM: 0/64 bytes (0.0%)   OSC: INTRC_OSC_NOCLKOUT, 4Mhz (Internal oscillator)   Chip: 12F675
      

      Code case 2: The frequency of 1 is selected = OSC: XT, 1Mhz (Clock source is not a primary internal oscillator. Ensure the clock source is correctly setup)

      #chip 12f675, 1
      
      Compiler Version (YYYY-MM-DD): 0.98.07 RC08 2020-04-20 (Windows 32 bit)   Program Memory: 20/1024 words (1.95%)   RAM: 0/64 bytes (0.0%)   OSC: XT, 1Mhz (Clock source is not a primary internal oscillator. Ensure the clock source is correctly setup)   Chip: 12F675
      

      Code case 3: The frequency of 1 with the selection of INTRC_OSC_NOCLKOUT = Error message and the compiler issues a Warning.

      #chip 12f675, 1
      #config INTRC_OSC_NOCLKOUT
      
      Warning: Internal clock source does not support specific frequency
      

      Makes sense?

       
      ❤️
      1

      Last edit: Anobium 2020-05-13
      • Anobium

        Anobium - 2020-05-13

        I should add.... in versions of the compiler before v0.98.07 the compiler will, for all cases shown in the previous post, compile and no indication of clock source or errors is issued.

        Why? When Hugh designed the software the Great Cow Graphical BASIC UI assumed that only internal oscillators would be selected. It was the correct design decision as the UI did constraint (correctly) a lot of the frequency and clock options.

         
        👍
        1
  • sfyris

    sfyris - 2020-05-14

    Anobium the 3rd case is more likely to my opinion with the exception to add the word "maybe" in the warning. eg : "Internal clock source maybe does not support specific frequency" or more specific "Warning: Internal clock source maybe support specific frequency for simulation primitives but not in real chip".

     
    • Anobium

      Anobium - 2020-05-14

      @Sfyris. 'Maybe' is passive. The compiler knows the specific frequency is not possible using the internal oscillator. If there an error in the chip specification (in the dat file) then we need to correct.

      Re 'simulation' no.

      How about?

      Warning: Internal oscillator clock source does not support the specified frequency. A simulator will operate with the specified frequency


      And, would like to get a copy of the release candidate software?

       
      ❤️
      1
  • sfyris

    sfyris - 2020-05-14

    Yes very nice warning. Thank you for your offer, I appreciate it.

     

Log in to post a comment.