I'm trying to turn on just port AN0 as an analog input. I've inserted C-blocks right before and after where I take my input into pin 1 (RA0/AN0). I'm using a PIC18F1320, and my sensor is a temperature sensor (LM34)
First block:
adcon0 = 0xc3;
adcon1 = 0xFE;
Second Block:
adcon0 = 0xc1;
I'm currently trying to simply output the value to an lcd screen. The display shows 0, and when I use a DMM to check the voltage into the port, it reads 0. Connections are all complete and correct, so I think the error might be in how I am calling on the input.
I've attached the flowcode as well. Thank you in advance.
ADC Issues
- 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: ADC Issues
Hello
The icon you have inserted between the C code blocks is a digital input. You do not require the C code blocks or the input icon to use the analogue channels. Instead click to add a ADC component into your program and then use hardware macros to call the Sample and Read value functions.
The icon you have inserted between the C code blocks is a digital input. You do not require the C code blocks or the input icon to use the analogue channels. Instead click to add a ADC component into your program and then use hardware macros to call the Sample and Read value functions.
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