spartekus
Member level 5
- Joined
- May 27, 2010
- Messages
- 81
- Helped
- 1
- Reputation
- 2
- Reaction score
- 1
- Trophy points
- 1,288
- Location
- Duisburg, Germany
- Activity points
- 1,918
Hi all,
I need to get 2 pwm output (not at the same time, my analog input choose which one will run). one of the pwm is around 1700 hz, another one is around 1900 hz.
any ideas why i read different frequencies at these pins, althought registers are same.
note: OC2RS also change with analog input but it is only for duty cycle as much as i know.
thanks a lot
I need to get 2 pwm output (not at the same time, my analog input choose which one will run). one of the pwm is around 1700 hz, another one is around 1900 hz.
any ideas why i read different frequencies at these pins, althought registers are same.
note: OC2RS also change with analog input but it is only for duty cycle as much as i know.
thanks a lot
Code:
OC1CON = 0b0000000000001110;
OC1R = 0;
OC1RS = 0; //hier müssen die daten eingeschrieben werden
OC2CON = 0b0000000000001110;
OC2R = 0;
OC2RS = 0; //hier müssen die Daten eingeschrieben werden
T3CONbits.TCKPS0 = 1;
T3CONbits.TCKPS = 0;
T3CONbits.TSIDL = 1;
T3CONbits.TON = 1;
IEC0bits.T3IE = 0;
PR3 = 4095; // PERIODENREGISTER LEGT DIE PWM FREQUENZ FEST