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.

Analog Comparator(pic18f) vs Proteus

Status
Not open for further replies.

stunny

Newbie level 1
Joined
Oct 4, 2007
Messages
1
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,291
comparator proteus

Hi,

I'm having troubles trying to simulate a simple analog comparator on PIC18F4550(or 18F4553) with proteus(already tried versions 7.2 sp6 and 7.5 sp3)

using PIC16F877 the same code works on proteus without a problem.

the relevant code is:

--start
#include <18F4553.h>
#FUSES NOWDT //No Watch Dog Timer
#FUSES NOMCLR
#FUSES HS //High speed Osc (> 4mhz)
#FUSES NOPUT //No Power Up Timer
#FUSES NOPROTECT //Code not protected from reading
#FUSES NODEBUG //No Debug mode for ICD
#FUSES NOBROWNOUT //No brownout reset
#FUSES NOLVP //No low voltage prgming, B3(PIC16) or B5(PIC18) used for I/O
#FUSES NOCPD //No EE protection

#use delay(clock=20000000)

void main () {

setup_timer_1(T1_INTERNAL); // Internal clock
setup_comparator(A0_A3_A1_A2_OUT_ON_A4_A5);
setup_adc_ports( AN0_TO_AN3 );

while(TRUE) {

}
}

-- end code

in proteus I use sines and DC voltage generators. and watch the CMCON register.

am I missing something?
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top