Possibilty of sending & receiving IR signals using a single 18M2

Pauldesign

Senior Member
I've been struggling to send and receive IR coded signals using the multitasking feature of the 18M2.

Have some body done this before? and if not, is it possible to accomplish this using just a single 18M2.

In the interim, i've sent IR signal using Task 0 program (which is working) and i can detect the signal on the IR received pin using an LED.

By just using only one task in 18M2, i can also transmit and receive IR signals (by checking for a pin state) but not coded data but i can't decode the coded transmitted data.

I can troubleshoot it if is a code bug but all i inquiring is, is it possible and straight forward without any complex coding to achieve it?

Rgds
 

manuka

Senior Member
More toy buggy details please - just 1 way control with visual feedback? Just what data are you sending out?

FWIW even an 08M (which can have hangup issues awaiting data) can both take in IR signals (via a 3 leg sensor on pin 3) and output (on other pins via an IR LED). Stan.
 

hippy

Ex-Staff (retired)
I've been struggling to send and receive IR coded signals using the multitasking feature of the 18M2.
How are you attempting to send and receive IR signals ?

If using IROUT and IRIN to receive what it sends you won't get that to work on an 18M2 as it's single core multi-tasking, not multi-core parallel processing. The IROUT is a blocking command so all tasks temporarily suspend while being executed, only when the IROUT completes can another task execute and run an IRIN command, at which point it would be waiting for IR which has long since been sent and passed by.
 

Dippy

Moderator
Read and comprehend hippy's comments above first.


I can't speak for the 18M2 specifically, but wasn't this type of thing covered a couple of weeks ago?

We'd need more details to confirm, but is this a device for detecting IR reflections?
If so, and it came as a pleasant surprise to me, that the hysteresis of one of those IR receiver modules was enough to allow the pulse to be detectable.
If, however, you are doing a simple IR LED out >>> | <<<< IR photodiode receive then no chance unless SOL is less where you live.
 

Pauldesign

Senior Member
If using IROUT and IRIN you won't get that to work on an 18M2 as it's single core multi-tasking, not multi-core parallel processing. The IROUT is a blocking command so all tasks temporarily suspend while being executed, only when the IROUT completes can another task execute and run an IRIN command, at which point it would be waiting for IR which has long since been sent and passed by.
Hey Hippy;

That reply was spot on even without all the details provided. What you said is exactly what i've been doing and the same unsure thought i've been having but just wanted to double check and thanks very much for the confirmation. ;)
 

hippy

Ex-Staff (retired)
To send and receive IR at the same time two possible options exist ...

Bit-banging : turn PWM on to drive IR, pause, turn PWM off, pause again and also bit-bang IR in.

Using serial to modulate the IR LED and using high-speed serial to background receive the IR sent.

If its just for obstacle detection you can drive the IR from PWMOUT and then simply check the TSOP18 output, low when there is an obtstruction, IR being reflected back, high when it it isn't.
 

Pauldesign

Senior Member
Thanks for the replies guys;

I thought it was possible to accomplish it with few hardware (just 1 TSOP1838 to receive different SIRC codes from 3 IR Tx; a PICAXE-18M2 and ULN2803) and software (basic irout and irin commands) and nothing fancy or complex.:D

Regards
 
Top