How do i read sensor voltage to microcontroller, PIC18F4520. Any codes i can use?
Printable View
How do i read sensor voltage to microcontroller, PIC18F4520. Any codes i can use?
You need to get MPLAB and a chip programmer. Write your assembly in the MPLAB and then download your hex file to the chip. You will have to write a code to read the voltage on the ADC pin of the chip. It is 10 bit resolution. Read about ADCON0, ADCON1, ANSEL, ADRESL, and ADRESH. If your voltage to read is over the Vss of the chip, you will have to use a voltage divider to scale the results down.