Yahoo Groups archive

AVR-Chat

Index last updated: 2026-04-28 22:41 UTC

Message

16f88 vref problem

2009-08-05 by Yingdan

Hello,

I am using VREF+ and AVss for a potentiometer. Below is my setting:

status_rp = 01   	-- select bank 1
CVRCON = 0b_1110_0110
ANSEL  = 0b_0001_1001
ADCON1 = 0b_0010_0000	-- VREF+/AVSS
status_rp = 00		-- select bank 0

The VREF+ pin gives ~1.2v and I can get the reading 0 - 255 in the range of 0 - ~1.2v. The problem is the reading is unstable. When I rotate the shaft from high to low, and low to high, I got different readings for a specific position. From high to low, I got a relative bigger reading and from low to high, I got a much smaller reading for the similar position. 

I have no idea how to fix the problem. Can anyone help to take a look at my CVRCON and ADCON1 registers since I am not confident with them, or offer any help about what might be wrong?

Your help is highly appreciated,
Yingdan

Attachments

Move to quarantaine

This moves the raw source file on disk only. The archive index is not changed automatically, so you still need to run a manual refresh afterward.