Hi all
I'm working on a home domotic system and as a part of this project, I'm measuring 5 analog values. Doing this with a voltage divider & a stabilizing capacitor on the ANx-input. Quit forward.
For testing purposes I attached 5x 1k-thermistors and used the thermistor component in FC8. Reading every input as real temperature & sending it over USB-port to the PC where I display the values in a terminal window.
All works fine, but readings on AN3 & 4 are not correct. AN4 is connected to a 1k-thermistor on the PCB (monitoring the temperature inside the case - just in case ).
I measured the voltage across the input pin and it's OK, so it has to be a software failure.
So I updated FC8 & used the AD-component in stead of the termistor-sensor, but without success.
Did anyone had the same issues ?
Capture.png = part of the schematic & terminal readings.
FC-program : reading T & sending over USB-serial. I'm using a bootloader.
AD on AN3 and AN4 not working PIC18F87J50
Moderator: Benj
- faveremario
- Posts: 28
- Joined: Sat Jun 02, 2012 6:08 pm
- Has thanked: 8 times
- Been thanked: 13 times
- Contact:
AD on AN3 and AN4 not working PIC18F87J50
- Attachments
-
- Capture.PNG
- (153.51 KiB) Downloaded 562 times
-
- T-Meting met console.fcfx
- (24.49 KiB) Downloaded 160 times
- LeighM
- Matrix Staff
- Posts: 2178
- Joined: Tue Jan 17, 2012 10:07 am
- Has thanked: 481 times
- Been thanked: 699 times
- Contact:
Re: AD on AN3 and AN4 not working PIC18F87J50
Could you please try the attached, to go into
C:\ProgramData\MatrixTSL\FlowcodeV8\CAL\PIC
Thanks
C:\ProgramData\MatrixTSL\FlowcodeV8\CAL\PIC
Thanks
- Attachments
-
- PIC_CAL_ADC.c
- (137.13 KiB) Downloaded 154 times
- 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:
Re: AD on AN3 and AN4 not working PIC18F87J50
Also available now via the v8 update system.
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
- faveremario
- Posts: 28
- Joined: Sat Jun 02, 2012 6:08 pm
- Has thanked: 8 times
- Been thanked: 13 times
- Contact:
Re: AD on AN3 and AN4 not working PIC18F87J50
Hi Leigh
Thanks for the quick reply!
Sure something has changed. All temperature-readings show 125° so I guess the ADC reads 1024 for all channels.
Thanks for the quick reply!
Sure something has changed. All temperature-readings show 125° so I guess the ADC reads 1024 for all channels.
- Attachments
-
- Capture.PNG
- (13.31 KiB) Downloaded 531 times
- faveremario
- Posts: 28
- Joined: Sat Jun 02, 2012 6:08 pm
- Has thanked: 8 times
- Been thanked: 13 times
- Contact:
Re: AD on AN3 and AN4 not working PIC18F87J50
I looked @the file you send me (thank you for that btw)
On line 3311, I see :
?
The image joined, shows the result. I try this out for the other channels & get back as soon as I can.
Thanks for the support.
On line 3311, I see :
shouldn't is beANCON0 = ~0x01;
to set PCFG0 to 0 ?ANCON0 &= 0xFE;
?
The image joined, shows the result. I try this out for the other channels & get back as soon as I can.
Thanks for the support.
- Attachments
-
- Capture.PNG
- (13.68 KiB) Downloaded 530 times
- faveremario
- Posts: 28
- Joined: Sat Jun 02, 2012 6:08 pm
- Has thanked: 8 times
- Been thanked: 13 times
- Contact:
Re: AD on AN3 and AN4 not working PIC18F87J50
With this file it works as a dream - I modified the channel-selector as described above.
@Ben, could you place this file for the FC8-update please ?
Thanks all !
@Ben, could you place this file for the FC8-update please ?
Thanks all !
- Attachments
-
- PIC_CAL_ADC.c
- (137.2 KiB) Downloaded 159 times
- LeighM
- Matrix Staff
- Posts: 2178
- Joined: Tue Jan 17, 2012 10:07 am
- Has thanked: 481 times
- Been thanked: 699 times
- Contact:
Re: AD on AN3 and AN4 not working PIC18F87J50
Thanks for the contribution, I have pushed this into our repo, Ben will process this into the auto update system in due course