Menu

ADC problem on PIC16F18857

jackjames
2022-07-18
2022-07-21
  • jackjames

    jackjames - 2022-07-18

    I made some updates on a software on a micro PIC16F18857 written some time ago and compiled with version 0.98.07 RC32.
    After compiling with the latest version of the compiler, the ADC reading does not work.
    I enclose the 'offending' routine.
    Obviously the various registers needed are set properly.

    Sub LeggiADC
            W_Adc = 0
    '       -
            Repeat NUMCAMPIONI
               ANSELA.ANSA0 = 1
               W_Adc = W_Adc + ReadAD10 (AN0)
               If bSeriale Then
                     Exit Sub
               End If
               Wait 2 ms
            End Repeat
    '       -
            V_Adc = W_Adc /[Word] NUMCAMPIONI
    '  Per test
            locate 0,0
            Print "L.ADC:"
            Print V_Adc
            print " - "
            print w_adc
    End Sub
    
     
  • Anobium

    Anobium - 2022-07-19

    Please update to the latest build.

    This was reported last week and resolved already.

    See https://sourceforge.net/p/gcbasic/code/HEAD/tree/GCBASIC/trunk/include/lowlevel/a-d.h

    Evan

     

    Last edit: Anobium 2022-07-19
    • jackjames

      jackjames - 2022-07-19

      Problem solved !
      Thanks Evan for the help you gave me.
      The GCStudio version is the last one that updated itself, but the a-d.h version was stuck on the previous one.

      Thanks

      Jack

       
      • Angel Mier

        Angel Mier - 2022-07-19

        Hi Jack.

        If you have time; Could you tell me on what specific version of GC Studio you are?
        This can be seen on the first window of GC Studio or pressing the "About" button.

        Thank you in advance.

        Angel

         
        • jackjames

          jackjames - 2022-07-19

          The version is 1.68.0

           

Log in to post a comment.