Hi, it is the first time I am trying to run a simulation of my ADC code in proteus, but I am facing a problem - I cannot even blink an LED currently. Following is my code to blink an led:
I have also attached a screenshot of my proteus connections. Once I get this corrected, I will run a simulation of battery monitor using ADC. ThanksCode:Include "modedefs.bas" DEFINE OSC 4 ' OSCCON defaults to 4MHz on reset DEFINE OSCCAL_1K 1 @ __Config _INTRC_OSC_NOCLKOUT & _WDT_ON & _PWRTE_ON & _MCLRE_OFF & _BODEN & _CP & _CPD pause 50 VALUE VAR WORD PORTA=0 PORTC=0 TRISA = %001000 TRISC = %001000 CMCON = 7 ANSEL=%10000000 ADCON0=%1011100 ADCON1=%01010000 ANSEL = 0 OPTION_REG = %10001111 SWITCH_ON VAR ADCON0.0 START VAR ADCON0.1 CHECK VAR PIR1.6 START1: WHILE 1 TOGGLE PORTC.5 PAUSE 100 WEND GOTO START1
Bookmarks