OK, we got the logic analyzer working and I think some of the commands are taking a lot longer than I had expected.

The horizontals are not even close to 50% duty cycle as one is high for 960 usec and low for 140usec (the other horizontal is opposite). I was shooting for more in the neighborhood of 140usec for both the high and low for both clocks. In addition, I can't seem to see the vertical on the logic analyzer at all. Maybe i need to adjust some settings, but I'm gettin kinda worried.

thanks for all the help.

My updated code is below:

' Connect analog input to (RA0)
' Connect clocks to PORTB
' PORTB.0 is the Reset Clock
' PORTB.1 is the Vphase1 clock
' PORTB.2 is the Vphase2 clock
' PORTB.3 is the Hphase1 clock
' PORTB.4 is the Hphase2 clock
' The reset will be connected to a HWPM clock pin #17, USE FEEDBACK WIRE!!
' Connect pin 2 from the DB9 connector to PORTC.6
' Have a +5V source ready to touch PORTA.2 to trigger clocking process

include "modedefs.bas"

' Define ADCIN parameters
Define ADC_BITS 8 ' Set number of bits in result
DEFINE OSC 20 ' Sets clock speed to 20Mhz


' Define HPWM parameters
DEFINE HPWM1_TIMER 2
DEFINE CCP1_REG PORTC
DEFINE CCP1_BIT 2 ' RC2

TRISC.1 = 0 ' HPWM automatically does this for you, but just in case
CCP1CON = %00001100 ' PWM mode

HPWM 1,127,3600 ' RC2/CCP1 3.6kHz @ ~50% duty

' Define interrupt parameters
INTCON2 = %01000000 ' External Interrupt on Rising Edge
INTCON.7 = 0 ' Disables global interrupts
TRISA = %11111111 ' Set PORTA to all input
ADCON1 = %00001110 ' Set PORTA digital, except for bit 0
TRISB = %00000001 ' Set PORTB to all output, except for bit 0
Pause 500 ' Wait .5 second
Pause 500 ' Wait .5 second

horizpulse var byte
vertpulse var byte
adval var byte ' Create adval to store result

horizpulse = 1 ' Initialize counters, initial states
vertpulse = 1
PORTB.1 = 0
PORTB.2 = 0
PORTB.3 = 1
PORTB.4 = 0
PORTB.5 = 0 ' LED off indicates that the camera is not transferring data

buttonloop:
IF PORTA.2 = 1 then
PORTB.5 = 1
GOTO vertloop
else
PORTB.5 = 0
GOTO buttonloop ' Waits for 5V that signals shutter is closed
ENDIF
vertloop:
horizpulse = 1
PORTB.1 = 1
PAUSEUS 139
PORTB.1 = 0
PORTB.2 = 1
PAUSEUS 139
PORTB.1 = 1
PORTB.2 = 0
PAUSEUS 139
PORTB.1 = 0
PAUSEUS 270
vertpulse = vertpulse + 1
IF vertpulse < 512 THEN
GOTO horizloop
ELSE
PORTB.5 = 0
GOTO buttonloop
ENDIF
horizloop:
INTCON.1 = 0 ' Resets interrupt flag to 0
Resetcheck: ' Loops back to make sure the PORTB.3 goes low and
IF INTCON.1 = 0 THEN ' PORTB.4 goes high as close
GOTO Resetcheck ' to the external trigger's rising edge as possible
ENDIF
PORTB.3 = 0
PORTB.4 = 1
PAUSEUS 139
PORTB.4 = 0
PORTB.3 = 1
PAUSEUS 15
ADCIN 0, adval ' A/D 8 bit value from PORTA.0 into adval
SEROUT2 PORTC.6,16390,[DEC adval] ' Output 8 bit word serially to PC from C.6
PAUSEUS 87
horizpulse = horizpulse + 1
IF horizpulse < 784 THEN
GOTO horizloop
ELSE
PAUSEUS 270
GOTO vertloop
ENDIF
END