Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Help needed to understand using the compartor output in PIC 16F628.

Status
Not open for further replies.

perpu

New Member
I have been searching for information in almost all the forums to find out more information on the output signal of the comparators and how to convert the value to comparable voltage value. So far it has been unsuccessful.

What I am looking for is to get the Vout and convert into volts to compare with Vref which will allow me to run several action depending on the outcome of formula.

Vnow = Vout-Vref.

Today i can read the value of the COMCON bit 7(COUT1) and bit 6(COUT2) either as binary 1 or 0 in theory.

Maybe I am stupid to do a such a calculation please bear with me as I am new and want to learn more about PIC MCU' s. You all are welcome to make positive or negative comment on this.

Do appreciate all the help.

Look forward to an answer.

Good day to all of you.
 

Attachments

  • PIC_Mid_C_6.pdf
    397 KB · Views: 2,356
perpu said:
What I am looking for is to get the Vout and convert into volts to compare with Vref which will allow me to run several action depending on the outcome of formula.

Vnow = Vout-Vref.

Comparators don't put out the difference between Vout and Vref as you're suggesting in your post.

The comparator output can only be placed in 1 of 2 possible states...+5V or 0V. We translate this into "high" and "low" respectively.

Basically the way comparators work is that they "compare" an input voltage to a fixed reference voltage, known as "Vref", and then change the high/low state of their output depending on whether Vin is higher or lower in amplitude than Vref. Any input that is of a greater amplitude than Vref will cause the comparator output to go "high" (+5V). Conversely, any input voltage that is of a lesser amplitude than Vref will drive the comparator output "low" (0V). The only relation that the comparator output itself has to the input is that its current high/low state tells you whether Vin is higher or lower than Vref.

An inverting comparator does the same thing, but the output state changes backwards relative to the output state of a non-inverting comparator.
 
Last edited:
Re:Help needed to understand using the compartor output in PIC 16F628

Thanks Jon Wilder for you reply.

I understand what you have explain. Sorry if I have not given clear information when I posted the request. What you have explained is exactly what I understod from the documents I found in the forums.

The thing is if I am using PIC 16F628 to control a pellets burnner with the following proccess. I must be ale to get the temperature values to set all these diffrent proccess levels. Following is the the description of the process:

In the start leve the heating element fires up and then pellets will be pumped in. Then the blower starts up in a very lowspeed level to get the pellets fieredup. When it has done that blower goto highspeed level and at the same time an LDR check if the flame has rech a certain intencity as the presetted level. If that has reach the level the state changes from start level to the standarddrift level but keeping the blower speed as it is. In the standarddrift level it continiusly check the temperature of the burner with the help of an LM35 or something like that and compare with a presetted value and at the same time do check the flame intencity. If flame is ok and the temperature is -5% of the presetted it have to change the state to the lowdrift level and switch the blower to lowspeed. Then when temperature reach it presetted level it gose to cooldown level where the blower gose bak to high speed and continue running for arround 5 minutes while all the other function will switch off. After 5 minutes it gose to the standby level.

The above is the proccess I am trying to produce with my experiment.

LDR connected to comparator1 and LM35 connected to comparator2 respectivly with idividual comparator configuration in a PIC16F628. The LDR function I have no problem with. It's the LM35 signal I need help to pass information to the PWM to change the speed of the blower in standarddrift, lowdrift and cooldown level.
I am using The PWM signal to control the blower via en TRIAC controller.

I hope this information will help you all to get to know what I am exactly looking for. I am open to allkinds of suggestions.

Thanks
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top