PDA

View Full Version : Using HPWM in half bridge mode on 16f690



Chris Barron
- 29th December 2006, 12:18
Sorry if this has appeared before....I'm trying to use the HPWM command on a 16F690, in half-bridge mode.
The relevant bits to set that mode from the standard mode are in the CCP1CON register.

If I only use the HPWM command the default mode is standard single output PWM
If I insert a line immediately after the HPW comand to set the relevant CCP1CON bits for half bridge then everything works fine.

The problem is that I am looking to make something which could eventually become safety critical and at all times the second PWM output must oppose the first, as it does for proper half bridge operation.

The trouble is that having to add a line to set CCP1CON bits means that the PWM mode works 'properly' in single output mode for a small period of time before I can add the extra CCP1CON instruction.

WHat I would like to know is if there is a simple way to rename the command macro file, change the setting of the CCP1CON bits in that command macro to do what I want and then recompile it, whcih is something I have had difficulty doing in the past.

Chris