stunny
Newbie level 1
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?
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?