28X2 pins 2 thru 5 are labled C1-, C2-, C1+, C2+ ?

Johnmb

Member
I can't find any reference to C!- ... C2+, so I don't know what the labels mean. Can anyone point me to the info or provide a clue about their use?
John
 

BeanieBots

Moderator
They are the comparitor pins.
See "compsetup" in manual 2 (page 44) for details.

EDIT:
As already mentioned by AC ^^
 

Johnmb

Member
Why were they included?

There must have been a problem the designers were addressing when they included C1_ ..... C2+. What was it? How is it being used?
John
 

hippy

Ex-Staff (retired)
Could be any number of reasons for adding something -

1) Added because a competitor has it
2) Seemed a good idea because competitors didn't have it
3) Seemed the market was asking for that
4) Seemed it may be a good idea in itself
5) They had some space and wondered what to fill it with
6) It was added to shut someone up continuously championing the idea
7) Needed something interesting and new to put in a press release

Most often it is to fill a perceived market need.
 

eclectic

Moderator
Could be any number of reasons for adding something -

1) Added because a competitor has it
2) Seemed a good idea because competitors didn't have it
3) Seemed the market was asking for that
4) Seemed it may be a good idea in itself
5) They had some space and wondered what to fill it with
6) It was added to shut someone up continuously championing the idea
7) Needed something interesting and new to put in a press release

Most often it is to fill a perceived market need.
That, I am going to frame!
And then try to sell it to the
"Institute of Marketing" or similar.

A gem!

e
 

hippy

Ex-Staff (retired)
Feel free - You might want to tidy the grammar in (6). There's one I forgot; "synergy", bringing a range into alignment.
 

eclectic

Moderator
Feel free - You might want to tidy the grammar in (6). There's one I forgot; "synergy", bringing a range into alignment.
Synergistically, auto-ranging alignment-potentialities?

Thank you for that.

I'll now only charge you
£78,950 for my consultancy fees. :)

e
 

BCJKiwi

Senior Member
like;

May be a number of reasons for adding a feature to an existing product: -

1) Because a competitor has it
2) Seemed a good idea because competitors didn't have it
3) Seemed the market was asking for it
4) "synergy" - bringing a range into alignment
5) Seemed it may be a good idea in itself
6) They had some space and wondered what to fill it with
7) It was added to satisfy a persistent champion of the feature
8) Needed something interesting and new to put in a press release

Most often it is to fill a perceived market need.



My bill will only be $25,000! :)
 
Last edited:

BeanieBots

Moderator
Many chips (including PICs) start out addressing a very particular issue and I would suspect they were needed for that reason. A second issue, the chip would then be made more "general purpose" so the real question might actually be for example "Why does it have a UART?".
 

manie

Senior Member
Could be any number of reasons for adding something -

1) Added because a competitor has it
2) Seemed a good idea because competitors didn't have it
3) Seemed the market was asking for that
4) Seemed it may be a good idea in itself
5) They had some space and wondered what to fill it with
6) It was added to shut someone up continuously championing the idea
7) Needed something interesting and new to put in a press release

Most often it is to fill a perceived market need.
I would not charge anything ! I enjoy the sheer brilliance !
 

hippy

Ex-Staff (retired)
hippy is disqualified from an answering.
Have any of you found an application for its use?
I'll pretend I'm someone else as you're not getting any answers on the potential use / have used side.

The comparators are simply that, giving a digital output which indicates if one signal is greater than another, so it can be used as a simple version of two READADC commands and a comparison of results. Thus -

ReadAdc 1, b1
ReadAdc 2, b2
If b1 > b2 Then Goto FloodingAlert

could be replaced by -

If comparatorOutputBit = 1 Then Goto FloodingAlert

That will be quicker to execute which may be important. It also uses less variables and less code space. Though the later is offset by having to set the comparators up.

On the PICmicro there are also other options available which give a wider range of potential uses. COMPSETUP allows many options to be set, poking SFR can get at some other options.

One PICAXE example use for these was to use the comparators to take a 0V/3V3 input level signal, compare that against say 2V and use the output ( which will be 0V/5V) to drive a PICAXE input which expects 0V/5V. This gave an on-chip voltage level converter.

What it really gives is an advantage to the designer of a circuit. If they need one or two comparators in their circuit they can instead use the ones on-chip. That saves an additional external component, cuts costs. Later PICmicro/PICAXE have selectable UART TX and RX polarity. By adding that it saves having to invert polarity externally. It comes down to the more the chip can do itself, the less you need to add to make your circuit work, which makes that product look appealing against other options - "One chip to rule them all".
 

Technical

Technical Support
Staff member
And as the comparators work in the background all the time, and will set an interrupt flag bit when they hit the threshold, you can use 'setintflags' to interrupt the main PICAXE BASIC program automatically when a certain threshold is reached. This saves having to do lots of readadc commands in a loop.
 

Johnmb

Member
Thank you for the replies. You've taught me a lesson. I have posted 'witty' remarks in the past and was quite satisfied I contributed at least something to a topic I knew little about. The lesson? I will now post witty remarks as a contribution to posts that I know a lot about. If we all do this, then I am sure this forum will get the same kind of attention that chatrooms get. Am I being witty now or just sarcastic. I don't know.
John

PS Who let Hippy out of the closet?
 

inglewoodpete

Senior Member
I haven't tried to use the PICAXE comparator but it could be possible to use it as an audio signal detector with a few resistors and a capacitor or two. I have used an external comparator to do this in the past.

Why? In one design I wanted to turn an amplifier on when it received an input signal (and off after the signal had gone away for a few minutes). In another, I used several audio detectors to select inputs in an audio switcher. Of course, the PICAXE only has one comparator so let's not get too carried away.
 

inglewoodpete

Senior Member
two comparators...!
Ahh. That make more sense now. I had seen the C1 and C2 references on the X2 but not realised there were actually two camparators.

I have to admit I have only used the 20X2s to date and have not had reason to experiment with the comparitors. My main work horse is still the 28x1/40x1.
 
Top