baileychic
Advanced Member level 3
- Joined
- Aug 2, 2017
- Messages
- 728
- Helped
- 56
- Reputation
- 112
- Reaction score
- 57
- Trophy points
- 28
- Activity points
- 7,033
I choose cut of frequency as 1800 Hz...
But what about the inductance of the transformer secondary and also about inductive loads like ceiling fans ? Will the output will be still good ?
R = V/I = 220/0.4545 = 484 Ohms.
Can you show output signal for this load ?
const unsigned int sine_table[32] = {
0,96,191,284,375,461,544,621,692,757,814,864,905,937,961,975,979,975,961,937,905,864,814,757,692,621,544,461,375,284,191,96
};
typedef struct {
char index;
char counter;
}INVERTER_TYPE;
INVERTER_TYPE inverter;
//Timer2
//Prescaler 1:1; Postscaler 1:1; TMR2 Preload = 249; Actual Interrupt Time : 62.5 us
void InitTimer2() {
T2CON = 0x04;
TMR2IE_bit = 1;
PR2 = 249;
INTCON = 0xC0;
}
void interrupt(){
if((TMR2IE_bit) && (TMR2IF_bit)) {
//Enter your code here
if(++inverter.counter >= 5) {
CCPR1L = (sine_table[inverter.index] & 0x3FC) >> 2;
CCP1CON.DC1B0 = (sine_table[inverter.index] & 0x01);
CCP1CON.DC1B1 = (sine_table[inverter.index] & 0x02) >> 1;
if(++inverter.index >= 32) {
inverter.index = 0;
CCP1CON.P1M1 = ~CCP1CON.P1M1;
}
inverter.counter = 0;
}
TMR2IF_bit = 0;
}
}
void main() {
asm clrwdt
CM1CON0 = 0x00;
CM2CON0 = 0x00;
SLRCON = 0x00;
ANSELA = 0x07;
ANSELB = 0x00;
ANSELC = 0x00;
ANSELD = 0x00;
ANSELE = 0x00;
ADCON1 = 0x80;
ADCON2 = 0b10110101;
TRISA = 0x07;
TRISB = 0x00;
TRISC = 0x00;
TRISD = 0x00;
TRISE = 0x00;
PORTA = 0x00;
PORTB = 0x00;
PORTC = 0x00;
PORTD = 0x00;
PORTE = 0x00;
LATA = 0x00;
LATB = 0x00;
LATC = 0x00;
LATD = 0x00;
LATE = 0x00;
Delay_ms(100);
TRISC = 0x3F;
CCP1CON = 0x4C;
inverter.index = 1;
inverter.counter = 0;
CCP1CON.DC1B0 = 0;
CCP1CON.DC1B1 = 0;
CCPR1L = 0;
TRISC = 0;
InitTimer2();
asm clrwdt
while(1) {
asm clrwdt
}
}
My previous question got solved....
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?