I have just snipped this straight out of a working program.
Hope it helps.
BrianT

<code>
'************************************************* ***************
'* Name : UNTITLED.BAS *
'* Author : Brian Taylor *
'* Notice : Copyright (c) 2009 Brian Taylor *
'* : All Rights Reserved *
'* Date : 21-Jun-09 *
'* Version : 1.0 *
'* Notes : *
'* : *
'************************************************* ***************

'PortC
Din5540 var portc.0 'Din = IN to Intersema chip OUT
MClk5540 var portc.1 'Intersema master clock PWM 32765 OUT
Drive var portc.2 'LED drive PWM 32765 OUT
DOut5540 var portc.3 'Data FROM the MS5540 IN
SClk5540 var portc.4 'SClk to Intersema OUT
SpareC5 var portc.5 'Spare OUT
TxD var portc.6 'Boot loader and RS232 Output OUT
RxD var portc.7 'Boot & RS232 Input IN
TRISC = %10001000
PortC = %01000000


Initialise:
TRISA = %00000000
PortA = %00000000
TRISB = %11111111
PortB = %11111111 '
TRISC = %10001000
PortC = %10000011
TRISD = %00000110
PortD = %00000000 '
TRISE = %00000000 ' Make certain TrisE.4 = 0
PortE = %00000000 ' Make certain PortE.4 = 0
ADCON0 = %00000000
ADCON1 = %00001111 ' All pins digital
ADCON2 = %00000000
CMCON = %00000111 ' comparators disabled
INTCON2.7 = 0 ' enables weak pull ups for 18F4620
hpwm 1, 0, 32765 'CCP1 on PorttC.2 pin 17 is DRIVE for LEDs
hpwm 2, 128, 32765 'CCP2 on PortC.1 pin 16 is MClk for the Intersema

</code>