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
Visit site
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

Cookies are required to use this site. You must accept them to continue using the site. Learn more…