
Originally Posted by
Darrel Taylor
It should work. But you probably need to invert it.
On the transmit side, where it would previously turn the HPWM ON, make the pin LOW instead.
For PWM OFF, set the pin HIGH, and forget the transistor.
Added: And make sure the CCP module is turned OFF.
<br>
Yes, turn it low instead of high because I have to pull low my receiver pic pin RA0 to trigger the int.
But, and wouldn't it be better, I can also output a positive voltage pulse while the receiver pic is pulled to GND by a WPD resistor and PULSIN listens to a Low to HIGH transition: PULSIN porta.0,1,etcetera
Code:
IF (a.0(0) == 0) THEN
FOR i = 0 to 13 'get a sequence of incoming 14 bits (WITHOUT their prefixes which are 600us pause)
PULSIN PORTA.0,1,ir_pulse[i] ' Read 14 low-going pulses on RA.4, see pbp manual
NEXT i
pin = 0 ' Loop 14 times, record in 5us resolution pulse duration in the word variables array
ENDIF
It would work too?
BTW, why do I need to disable CCP module? It would prevent the output to work fine?
And what's technicaly wrong with using a transistor???
Bookmarks