Menu

PIC16F1828 Internal Ref

2017-07-08
2017-07-17
<< < 1 2 3 (Page 3 of 3)
  • Daniel Cioba

    Daniel Cioba - 2017-07-18

    Ok

     
    • Anobium

      Anobium - 2017-07-18

      Exellent stuff. I get a constant reading also! Excellent.

      I have reviewed the ASM. We have different libraries. Please update your library with the attachment. This needs to go in your ..\GCB@Syn_97\GreatCowBasic\Include\lowlevel\ folder.

       
  • Daniel Cioba

    Daniel Cioba - 2017-07-18

    Now is working , good job Anobius !!! What was the problem , if you want to share it with us ?
    And one more question , what is the ADC speed since these PIC's have many more clocking options than High , Medium and Low ?

     
    • Anobium

      Anobium - 2017-07-18

      Two answers.


      1) The root cause. A library mismatch at some point - either I send the wrong one or the library was not updated at one end. The latest library does have a little check for the register to be set - this means that the code will cater with the two different registers that exist today.


      2) The ADC speed. The constants defined for your specific microcontroller are as follows:

          'pre-defined constants
          #define HighSpeed 255
          #define MediumSpeed 128
          #define LowSpeed 0
      

      Where the following is used for PIC (it is different for AVR).

      Conversion Clock Speed
      HighSpeed = FOSC/2
      
      MediumSpeed = FOSC/32
      
      LowSpeed =  FRC (clock supplied from a dedicated RC oscillator)
      

      This is good case where #define ADReadPreReadCommand works well. If you wanted set the A/D Conversion Clock Select bits to a specific setting. You could add the following:

      #define ADReadPreReadCommand ADCS2=1:ADCS1=1:ADCS0=0. I obtained this register bit from the datasheet to set to FOSC/64.


      I hope this helps.

       
  • Anobium

    Anobium - 2017-07-18

    I will include this in the ADC library in the next release.

    The Help will be updated with the syntax without the underscore and the prefix AD. IDE Helpers have been updated already. :-)

    FVR_Initialize ( FVR_2x ) 'set to 2.048

    The online Help will be updated today with the formal release of the library in the next release.

    I also resolve the ADSPEED... It is now consistent where Highspeed = 2, MediumSpeed = 8 and SlowSpeed = 32.

    Anobium

     

    Last edit: Anobium 2017-07-18
<< < 1 2 3 (Page 3 of 3)

Log in to post a comment.