'--------Title--------

' File......hpwm3.pbp
' Started....1/21/08
' Microcontroller used:  Microchip Technology 16F88
'                        microchip.com
' PBPro Code, micro-Engineering Labs, Inc.
'             melabs.com   
 
'--------Program Desciption--------

' Uses HPWM command to set the motor speed
' of a motor.  

'--------Revision History---------

'---------Constants/Defines-------
    
'---------Variables---------  

'---------Initialization--------
   
    TRISB = %00000000      	'Sets all pins of PORTB as outputs
												
	ANSEL = 0               'Configure all pins to digital
                            'operation since not using ADC
                            '(Analog to Digital Converter)
                                
    OSCCON = $60	        'Sets the internal oscillator in 
                            'the 16F88 to 4 MHz   

'--------Main Code--------   
   
        
    
    hpwm 0,255,245      'Motor is driver by Channel 1, (RB0) on
                        'the PIC16F88.  The Dutycycle is set at
                        '127, sending a 50% duty cycle pulse.  
                        'The frequency is set for 245 Hz.
                        'This command will continue to run
                        'in the background while the program is
                        'executing the rest of the program 
                        'instructions.
loop:

    goto loop
                          
    end
        
