Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

controlling 2 h bridges with 1 MCU

Status
Not open for further replies.

gedza

Junior Member level 2
Joined
Nov 3, 2010
Messages
22
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,467
Hie.
How are two H bridges with different frequencies controlled by a single MCU.I want to control the first full bridge with 2 alternating signals with 0.5 duty cycle and another one with 2 PWM signals of varying duty cycles simultaneously.If its possible can you please show me the an example code in asm. Thanks
 

Hi!

Genereally I would say yes, it is possible. The way how it can be done depends on the details you haven't provided us with.

- What MCU do you intend to use?
- What pwm frequency is needed?
- What pwm resolution is needed?
- Do you want to implement the whole stuff in sw, or you prefer using pwm hw?

With a member of the STM32F100xx family you simply have to setup two of the several timers to achive the solution...
 

I intend to use the pic16f877 in either asm;proton or basic code .the first bridge will be controlled by two alternating signals at 0.5 duty cycle and frequency 200khz and the other at 20khz with 2 sinusoidal pwm outputs which are 180 degrees out of phase.The code is required for a pure sine wave inverter design project and the supervisor want me to use 1 microcontroller.
 
Last edited:

better use a microcontroller with more PWM Outputs (timers and CCMP)... like some PIC18... or AVR

but,
as you say two alternating signals... you mean one is the inverse from the other? so you need only a single square signal of 200kHz with two complementary output?
and also how is a sinusoidal PWM? i only know digital pwm :) (by saying they are 180° out of phase... does it means also that they are complementary output?

if its that way i could use an AVR atmega32 with two timers...
 

Try using PIC18F1330. It has 6 PWM outputs and many additional features like dead time control and complementary mode.
 

Ihave written this code .Iwant the ccp module to generate 0.5 duty cycle signals at 200khz in the half bridge mode but after simulation I am failing to get the required signal at the output.

TITLE "PWM based pulse generator"


#INCLUDE P16F887.INC




BANKSEL CCP1CON
CLRF CCP1CON
BANKSEL TMR2
CLRF TMR2
BANKSEL PR2
MOVLW 0X09
MOVWF PR2
BANKSEL CCPR1L
MOVLW 0X80
MOVWF CCPR1L
BANKSEL INTCON
CLRF INTCON
BANKSEL TRISC
BSF TRISC,2
BANKSEL TRISD
BCF TRISD,5
BANKSEL PIE1
CLRF PIE1
BANKSEL PIR1
CLRF PIR1
BANKSEL CCP1CON
MOVLW 0X8C
MOVWF CCP1CON
BANKSEL T2CON
BSF T2CON,TMR2ON
BANKSEL PWM1CON
MOVLW 0X02
MOVWF PWM1CON
END

---------- Post added at 03:19 ---------- Previous post was at 02:12 ----------

is it possible to set up the ccp module such that the program will be executing the main program and simultaneously producing the pulses in half bridge mode can you please give me an example if possible.
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top