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.
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 ?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
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:
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.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Ok
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.
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 ?
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:
Where the following is used for PIC (it is different for AVR).
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.
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