TRISB configure i/o as input or output while PORTB is the place to read/write from/to.
try...
Code:
<font color="#000000"> @ device pic16F648A, wdt_off, intrc_osc_noclkout, mclr_off, protect_off
<font color="#000080">DEFINE </font>OSC 4
CMCON = 7 <font color="#008000">' Turn all comparators to fully digital (needed??)
</font>TRISB.3 = 0 <font color="#008000">' IR Output Pin
</font>TRISB.4 = 1 <font color="#008000">' Shutter Input Pin
</font>start:
<font color="#000080">WHILE </font>PORTB.4 = 0 : <font color="#000080">WEND
GOSUB </font>Shutter
<font color="#000080">PAUSE </font>250
<font color="#000080">GOTO </font>start
Shutter:
<font color="#000080">HPWM </font>1,127,38500 <font color="#008000">' Configure HPWM for 50% duty cycle PWM signal at 38.5kHz
</font><font color="#000080">PAUSE </font>500
CCP1CON = 0 <font color="#008000">' PWM OFF
</font><font color="#000080">RETURN
</font>
Bookmarks