Searching \ for '[PIC]:16f628 comparators' in subject line. ()
Make payments with PayPal - it's fast, free and secure! Help us get a faster server
FAQ page: www.piclist.com/techref/microchip/devices.htm?key=16F
Search entire site for: '16f628 comparators'.

Exact match. Not showing close matches.
PICList Thread
'[PIC]:16f628 comparators'
2002\04\23@040152 by Goring, Steve

flavicon
face
Hi List ...

This is my requirement - use a gameboy / playstation hand controller for
controlling 4 lights
5 dc motors and 2 pan and tilt cameras.

On the hand controller are 2 analogue pots and 17 switches - my options are
this, keyscan
the switches in a 4x4 matrix and use discrete comparators and just read the
o/ps.

keyscan the switches and use the internal comparators.

My question is this - I need the usart to connect to the motors etc via
rs232, there fore to keyscan
the switches I need 8 i/o lines - would it be better to use all of portb
where the usart is located
and keep configuring and unconfiguring it or to use the upper 4 bits of
portb and lower 4 bits of
porta where the comparators are located and keep configuring and
unconfiguring the comparators.

Or is there another way of doing things - I hope this is clear enough. In
summary I need to know the
state of two analogue pots and 16 switches, the resultant states are then
changed into control
codes and sent to the hardware via rs232.

Thanks in advance


Steve




**********************************************************************
Information in this email is confidential and may be privileged.
It is intended for the addressee only. If you have received it in error,
please notify the sender immediately and delete it from your system.
You should not otherwise copy it, retransmit it or use or disclose its
contents to anyone.
Thank you for your co-operation.
**********************************************************************

--
http://www.piclist.com hint: The list server can filter out subtopics
(like ads or off topics) for you. See http://www.piclist.com/#topics


2002\04\23@074159 by Bob Ammerman

picon face
Here is how I would go about it:

Use CM2:CM0 == 0b011

Then:

RA0 and RA1 are your potentiometer inputs

RA2 is your reference, driven by the VREF module (VROE == 1)

RB1 and RB2 are your USART pins

That leaves 9 pins for multiplexing your keyboard.

No need to configure/reconfigure at all.

Bob Ammerman
RAm Systems


// TODO: Add your command handler code here
{Original Message removed}

More... (looser matching)
- Last day of these posts
- In 2002 , 2003 only
- Today
- New search...