i,m using a PIC 16f873 and want to generate a triangular wave. do i need tonuse capture mode continuously until the wave reach to top wave for raising edge and return to bottom wave for falling edge?
If you are using an IC solution, you could simply add any n-bit DAC and step up to 2exp(n - 1) and then decrement... if not, using a R-2R ladder could help you, but i think you don't need feedback on the uC to generate this.
i,m using inverter to control the speed of AC induction motor. switching for this inverter by using tyristor or IGBT. 3 phase PWM were be the pulse for this switch..i use 1khz freq for triangular wave and 50hz for sinusoidal wave, by comparing this 2 wave PWM was generated. i want to know, capture mode and compare mode is the right choice to generate this waveform?
Triangular wave at 1kHz (1ms period) can be difficult to generate with PIC's CCP or with a DAC controlled by the PIC. You would need multiple updates per wave period (1ms), that can use a significant portion of PIC's processing time. But if the PIC is not burdened with other tasks (yet... just wait till later in the project...), CCP approach could be viable.
Is the frequency is fixed at 1kHz? There are analog circuits for generating triangular wave. Here's a collection: http://www.discovercircuits.com/T/triangle.htm, or you can google triangular wave circuit. I think you can adopt PWM controller ICs for you application. Some if them have a triangular wave or sawtooth wave generator. These ICs have been used extensively in switch mode regulators. For an example, this chip: http://focus.ti.com/lit/ds/symlink/tl5001a.pdf
The third option would be to use DDS, but I don't know of a DDS chip that can generate a triangular wave. May be someone on the forum can help with that. :?:
i choose to use capture mode for the triangular wave and compare mode for sinusoidal wave..how can i change the condition for CCP1CON from rising edge to falling edge? i,m using c programming and choose to use for loop to generate triangular wave from 0 to 256 for rising edge and from 256 to 0 for falling edge.