PIC18F2523 12 bit adc
PIC18F2523 12 bit adc
Is there any way of accessing the full 12 bits of the PIC18F2523's ADC, it seems to be restricted to the usual 10bits of the majority of the PICs.
- Benj
- Matrix Staff
- Posts: 15312
- Joined: Mon Oct 16, 2006 10:48 am
- Location: Matrix TS Ltd
- Has thanked: 4803 times
- Been thanked: 4314 times
- Contact:
Hello
I will look into this for you.
I will look into this for you.
Regards Ben Rowland - MatrixTSL
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
- Benj
- Matrix Staff
- Posts: 15312
- Joined: Mon Oct 16, 2006 10:48 am
- Location: Matrix TS Ltd
- Has thanked: 4803 times
- Been thanked: 4314 times
- Contact:
Ok I think I have fixed the problem now
Open the FCD file for the 18F2523. and edit the following line.
Change it to the following
Then restart Flowcode and you should now have access to all 12 ADC bits.
Note: This fix will also work for the 18F2423, 18F4423 and 18F4523
Open the FCD file for the 18F2523. and edit the following line.
Code: Select all
ADCFull="short iRetVal;\niRetVal = (adresh << 2);\niRetVal += (adresl >> 6);\nreturn (iRetVal);\n"
Code: Select all
ADCFull="short iRetVal;\niRetVal = (adresh << 4);\niRetVal += (adresl >> 4);\nreturn (iRetVal);\n"
Note: This fix will also work for the 18F2423, 18F4423 and 18F4523
Regards Ben Rowland - MatrixTSL
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
- Benj
- Matrix Staff
- Posts: 15312
- Joined: Mon Oct 16, 2006 10:48 am
- Location: Matrix TS Ltd
- Has thanked: 4803 times
- Been thanked: 4314 times
- Contact:
Hello
Thanks for that. Is it running with the proper 12 bit accuracy now.
Thanks for that. Is it running with the proper 12 bit accuracy now.
Regards Ben Rowland - MatrixTSL
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel