Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Question :How to setup the comparator of PIC16f628a ?

Status
Not open for further replies.

bluelaser

Member level 1
Joined
Jul 15, 2002
Messages
37
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,286
Activity points
212
pic16f628a comparator

Dear all:
In my project , I want to use RA2 to do the key detection . So I select
the comparator mode 010, and use the internal VREF . but I just use RA2 for the comparator input (analog input) , I plan to use the other RA0, RA1,
RA3 to do the digital output, In the TRISA register ,I set RA2 to input , and RA0,RA1,RA3 to output . Do you think this setting is correct ?
can I use this method to setup the RA Port?

Thank you .
bluelaser
 

ra0 digital output pic16f628a

Any body can help me ?
 

pic16f628a comparator c

bluelaser said:
Any body can help me ?

Visit Nigel Goodwin's site at www.winpicprog.co.uk , all his tutorials are based on the 16F628 ,I'm sure you will find something there.
If not, he has his own forum where you could post your question.
PS! He is a very helpfull person.

Good Luck :)
 

pic16f628a comparator mode

bluelaser said:
Dear all:
In my project , I want to use RA2 to do the key detection . So I select
the comparator mode 010, and use the internal VREF . but I just use RA2 for the comparator input (analog input) , I plan to use the other RA0, RA1,
RA3 to do the digital output, In the TRISA register ,I set RA2 to input , and RA0,RA1,RA3 to output . Do you think this setting is correct ?
can I use this method to setup the RA Port?

Thank you .
bluelaser

I am afraid this might not work as expected, the 4 inputs are exclusively used as comparator inputs in mode 010 but you could at least try it maybe it works.

You could use mode 101 but you would have to use RA1(AN1) as input and enable the voltage reference module to output its voltage on RA2.
In this case you would only lose RA1 and RA2 and you could use RA0 and RA3 as outputs or inputs.

hope this helps
 

comparator and pic16f628

May you change design to read key by using a2d
from votage divider on ra0
Pulldown ra0 with R 1k
and caonnect all swich to this line
each switch connect to Vdd thouth R
1K 1.5k 2K 2.5k 3K
(I can read 20 key from 1 port)
See App Note From Microchip AN234 AN552
00234a.pdf

I think that may help you solve you problem
:)
 

pic16f628a analog input

Dear all friend :
Thank you for your help .
I try this circuit in the PROTEUS VSM . It can work , But I think it is
not reliable. At last , refer to other pepole's circuit (pls refer to the attached file ), I modify my circuit, the key share the io with the LCD data bus.

Bluelaser.
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top