Question
this is what I currently have : I var BYTE: V1 VAR BYTE; V2 VAR BYTE TRISIO=%111011; GP2 SET AS CCP1 OUTPUT FOR THE PWM
this is what I currently have :
I var BYTE: V1 VAR BYTE; V2 VAR BYTE TRISIO=%111011; GP2 SET AS CCP1 OUTPUT FOR THE PWM ANSEL=%001000; AN3 SET AS ANALOG INPUT CMCON0=%00000111; CIN PINS 1/0, COMPARADOR OFF, CUT OFF OSCTUNE=0: OSCCON=%01100101; 4MHZ INTERNAL OSCILLATOR CCP1CON=%00001100; PWM MODE ACTIVE HIGH DEFINE ADC_BITS 8; A/D CONFIGURATION DEFINE ADC_CLOCK 3; 500KHZ CLOCK SOURCE DEFINE SAMPLEUS 50; WAIT 50 uS AFTER ACQUISITION TIME OF 20 uS T RPT: ADCIN 3, V1; READ TRIM POT VOLTAGE ON AN3 AND STORE IT IN V1 GPIO.2=0; CLEAR GP2 FOR I=1 TO 255; LOOP HPWM 1,I,1000; VARIABLE I INCREMENTS THE DUTY CYCLE PAUSE V1; PAUSE IS CONTROLLED BY TRIM POT NEXT I; CONTINUE LOOPUNTIL I=255 FOR I=255 TO 1 STEP -1; DECREMENTING LOOP HPWM 1,I,1000; VARIABLES I DECREMENTS THE DUTY CYCLE PAUSE V1; PAUSE CONTROLED BY TRIM POT NEXT I; CONTINUE LOOP UNTIL I=0 GOTO RPT; END;
Student Assignment: develop a program to deliver an analog pulse on CCP1 every four seconds when the input GPO goes to low logic. And deliver and Analog pulse every two seconds when G goes to logic Low P1 Student Assignment: develop a program to deliver an analog pulse on CCP1 every four seconds when the input GPO goes to low logic. And deliver and Analog pulse every two seconds when G goes to logic Low P1Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started