PDA

View Full Version : Schmitt trigger on IRED xmtr



Michael
- 19th February 2006, 21:09
I breadboarded a 16F628a pair as an infrared xmtr and rcvr at 38 khz and all seems to be ok except I'm not getting proper function when I combine my 38khz PWM and the data from SEROUT. (T1200)

I see the 38khz (more like 38.4) at pin 1 of my 4093 and see the SEROUT at pin 2 on my scope, yet I'm getting about 20khz at the 4093 output and no function from the remote control.

I've been under the impression that there is no problem driving either TTL or CMOS with a PIC.....is that the problem? Would a 74HCT132 make the difference?

Thanks.

G8RPI
- 20th February 2006, 16:03
Hi Michael,
As the '4093 is a NAND gate, the ouput will be inverted, how are you driving the IR LED?
If you have a two channel 'scope, put 1 channel on your data from the PIC and the other on the output of the '4093. You should see a high level when your data is low and a series of low pulses when the data is high.

HTH,
Robert G8RPI.

Michael
- 20th February 2006, 21:00
Actually that should read N1200 not T1200.

It's a mimic of the circuit I saw on Rentron with a 38khz pwm and serout/serin.

I'm driving a 2n4403 to switch the anode of the xmtr led.....the data looks perect on the rcvr serin terminal. I'm simply using portb to look at the data....

START:

SERIN PORTA.0,N1200, [QUALA,QUALB,DAT]

PORTB.0 = DAT.0
PORTB.1 = DAT.1

AND SO ON

GOTO START


Using a 16f628a--comparators are off.

I see perfect data at serin but nothing on the portb outputs....took the data directly from the sharp module and also through a 4401 buffer.

Oh well.

Michael
- 20th February 2006, 21:11
I need to ask also....

On the 16F628a, if I CMCON = 7 to turn the comparators off....
do set TRISA so the xtal pins are inputs?

On my rcrvr, I'm using A0 for SERIN and the xtal is on A6 and A7

so...

TRISA = %11000001 ?

I was also mixed up on the MCLR function.

The 16C65B I've used to date had to have a 4.7k to V+ or they won't function.

I had had MCLR configured as "reset" in the epic software....only to find out it needed to be an "input" for the chip to work.

(I still don't get that one).

Dave
- 21st February 2006, 11:44
Michael, The reset function can be set to internal, leaving the reset pin available for external use. However this pin can only be used as an input pin and has NO output drive capability. Its all in the data sheet for the processor you are using.

Dave Purola,
N8NTA

Michael
- 21st February 2006, 13:01
Thanks Dave, so in EPIC language that means choose "input" ?

When I chose "reset" in the Epic software and had a 4.7K to V+, the PIC wouldn't function at all.

I chose "input" and it works.

So, will the chip reset regardless of which I choose?

I am going to look at my breadboard this morning and hardwire the SEROUT/SERIN to see if it's an infrared problem.....don't know why I didn't think of that yesterday.

It's called middle aged brain atrophy.

It has to be something simple....maybe in my chip setup. I've always used the 16C65B OTP part....this 16F628 is new to me.