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.

PIC16F628A (MPLAB) - Someone Can help me? how to use CMCON?

Status
Not open for further replies.

carlosacf

New Member
Hello,

I'm an autodidact in PIC16F628A
I worked with PIC 8085, but it was a long time ago.

I would Like to compare two signals with PIC16F628A using MPLAB:
The idea or algorithm is:

Analogic signal = between 1V to 5V

----------------------PIC16F628A -----------------------------------------
reference signal = 4V
reset time

While Analogic signal < reference signal Then
•send a signal to RA3 (because RA3 is an output and it's connect to a LED)
•Send an error (subtraction between the two signals) to an output RA4
•Count the time in seconds while this situation occur
End while
----------------------------------------------------------------------------

Thank you
Hope someone can help me

Best Regards
Carlos
 
Analogic signal = between 1V to 5V

----------------------PIC16F628A -----------------------------------------
reference signal = 4V
reset time

While Analogic signal < reference signal Then
•send a signal to RA3 (because RA3 is an output and it's connect to a LED)
•Send an error (subtraction between the two signals) to an output RA4
•Count the time in seconds while this situation occur
End while


Send an error? Do u want to output the analogue difference in the value of the 2 analogue signals or just a true or false (digital) type error?
 
- reference signal is digital
- the other one is analog
- the output is the difference(or error) between them. result is digital

the error is the subtraction between digital and analog signal.

the analog signal will be generated by an oscilloscope.
But if it's to much complicated, instead using analog signal could be a digital. and the analog could be after.
I want to simulate in MPLAB first. In MPLAB I can compare two digital signals
 
I would have to recommend another PIC... somewhat similar but for a slightly more price of about $2.30 USD for PDIP package...
PIC16F819

In Fact any of these would be better than the 16F628A for what you want to do...

PIC16F1826
PIC16F1827
PIC16F684
PIC16F688
PIC16F819
PIC16F88

As for the reference signal of 4v... im sure you can use the 5v internal and determine when its over 4v better than using a 4v reference...
 
Last edited:
Status
Not open for further replies.

Latest threads

Back
Top