Professional Documents
Culture Documents
Coding Pac
Coding Pac
Main Module
In serial receive interrupt module,RECR_DLY or TMR2 is disabled ,then character is received and
stored in temp reg.Character received in Temp reg is shifted and rec_count is incremented and
RECR_DLY is enabled.
In this module, data is received serially.
Serial Recieve
Receive Delay
In this module value send to adc by potentiometer. By varying the value of variable resistor, fire angle is varied from 0 to 180 degree. Switch is connected,
Switch is used for selection between local control(variable resistor) and computer control.
Analogue reading
Display
In this module ramp is generated and pulses are generated. Three square waves one for each phase R,S,T are as input to RB0,RB1,RB2. Initially
RP_Flag=0 and R_PULSE=RP_Flag,it samples previous and next value, if both values are same, counter values increases and ramp is generated when the
input value changes to 1,R_counter=0 and R_PULSE=1 and R_PULSE=RP_Flag ,it samples previous and next value, if both values are same, counter
values increases and ramp is generated.So there are three ramps for each phase R,S,T.
If RP_Flag=1(Positive cycle),R+=1,S-=1,R-=0 and if RP_Flag=0(negative cycle)R+=0,S+=1,R-=1(For reference, consult 3diagram ).
Firing sequence
Firing sequence