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.

I need help with writing comparator program

Status
Not open for further replies.

wakaka

Full Member level 4
Joined
Dec 7, 2005
Messages
237
Helped
10
Reputation
20
Reaction score
6
Trophy points
1,298
Activity points
2,931
877A comparator

Im a noob in programming, this is my program:

#include <16F877a.h>
#fuses HS,NOWDT,NOPROTECT,NOLVP
#use delay (clock=20000000)

void main()

{
byte value;

setup_port_a(ALL_ANALOG);
setup_adc(adc_clock_internal);
set_adc_channel( 5 );
setup_vref(VREF_HIGH|15);


setup_comparator(A0_A3_A1_A2);

// here i dunno how to proceed. If A3's voltage is greater than A2's, output_high(Pin_B7). or is there any other ways to do it??? need help, thanks......
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top