Yahoo Groups archive

AVR-Chat

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

Thread

16f88 vref problem

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

Re: [AVR-Chat] 16f88 vref problem

2009-08-05 by John Samperi

At 12:41 PM 5/08/2009, you wrote:
>status_rp = 00          -- select bank 0

Ask at microchip.com NOT here, this is an Atmel AVR forum.

Regards

John Samperi

********************************************************
Ampertronics Pty. Ltd.
11 Brokenwood Place Baulkham Hills, NSW 2153 AUSTRALIA
Tel. (02) 9674-6495       Fax (02) 9674-8745
Website  http://www.ampertronics.com.au
*Electronic Design * Custom Products * Contract Assembly
********************************************************

Re: [AVR-Chat] 16f88 vref problem

2009-08-05 by Jim Wagner

This is an AVR group, not PIC. You can try one of the PIC lists for  
better help.

Jim Wagner

On Aug 4, 2009, at 7:41 PM, Yingdan wrote:

> 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
>
>
> 



[Non-text portions of this message have been removed]

Re: [AVR-Chat] 16f88 vref problem

2009-08-05 by Dao Viet Dung

Why don't you try ATMEGA8.

--- On Wed, 8/5/09, Yingdan <yingdanh@gmail.com> wrote:
Show quoted textHide quoted text
From: Yingdan <yingdanh@gmail.com>
Subject: [AVR-Chat] 16f88 vref problem
To: AVR-Chat@yahoogroups.com
Date: Wednesday, August 5, 2009, 9:41 AM






 




    
                  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 




 

      

    
    
	
	 
	
	








	


	
	

[Non-text portions of this message have been removed]

Re: [AVR-Chat] 16f88 vref problem

2009-08-05 by enkitec@gmail.com

I don't believe you are still using these PIC toys.   :-) :-) :-)


Yingdan wrote:
Show quoted textHide quoted text
> 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 
>

Re: [AVR-Chat] 16f88 vref problem

2009-08-05 by Harkfin Balrog

Depending upon your source, the internal A/D capacitors retain a certain 
amount of the voltages you are sampling. Try sampling a grounded signal 
(or the internal ground) before sampling your POT.

Yingdan wrote:
Show quoted textHide quoted text
>  
>
> 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
>
> __._,_.__

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.