Home
JAQForum Ver 24.01
Log In or Join  
Active Topics
Local Time 11:17 01 Aug 2025 Privacy Policy
Jump to

Notice. New forum software under development. It's going to miss a few functions and look a bit ugly for a while, but I'm working on it full time now as the old forum was too unstable. Couple days, all good. If you notice any issues, please contact me.

Forum Index : Microcontroller and PC projects : MicroMite to MicroMite IR communication

     Page 1 of 2    
Author Message
jovian
Regular Member

Joined: 16/04/2017
Location: Australia
Posts: 63
Posted: 06:59pm 16 Apr 2017
Copy link to clipboard 
Print this post

Hi all,
I'm new to the forum and MicroMite, I'm chuffed to have joined the Back Shed. Nice to meet you!

I'm using a couple of 44 pin Micromites to build a large A/V system controller comprising of control of a projector via RS232, a couple of screen winch motors, and a central control panel. It all has to happen wirelessly.

I have an IR sender which works over RF. I've been getting good results from it so I decided to use IR as the protocol to chat between micromites.

I've set up two micromites with a simple receive program in one and a send program in the other.

The receive part works a charm, decoding signals from various 3rd party remote controls.

But the IR send I cannot get working. I've followed the suggested circuit design in the manual, using a 2N3904 (instead of BC338) NPN transistor, 50ohm resistor to the LED and 1kohm resistor from pin to the base. With my phone camera I can see the LED pulsing (using the IR SEND command), so I presume it's doing the right thing, but the receiving Micromite sees nothing.

The LED is quite dim compared to the TV remote, so I have swapped resistors and voltages about, but still nothing.

Anyone else had any similar issues? Is there perhaps a more betterer protocol for me to wirelessly transceive small amounts of data between micromites?

Any help would be greatly appreciated.

Cheers
Joe
 
Grogster

Admin Group

Joined: 31/12/2012
Location: New Zealand
Posts: 9610
Posted: 07:24pm 16 Apr 2017
Copy link to clipboard 
Print this post

Welcome.

I assume you are using an IR LED in your transmitter arrangement? Standard LED's will not work..... I expect you are, but I think you should confirm that for us first.
Smoke makes things work. When the smoke gets out, it stops!
 
jovian
Regular Member

Joined: 16/04/2017
Location: Australia
Posts: 63
Posted: 08:02pm 16 Apr 2017
Copy link to clipboard 
Print this post

Hi Grogster
Thanks for the prompt reply. Yes, it's a 3mm infra-red LED. Not as bright as my TV remote's LED (when viewed through the iPhone camera), but considering the TV remote is sensed by the micromite from across the room, I would have thought bright enough.
 
Geoffg

Guru

Joined: 06/06/2011
Location: Australia
Posts: 3292
Posted: 08:56pm 16 Apr 2017
Copy link to clipboard 
Print this post

It should work, I can remember testing the Micromite to Micromite communications and being pleased with the result.

To eliminate the distance issue it would be worth placing the IR sender and receiver just a centimetre apart. At that range even an ordinary red LED will work.

Geoff
Geoff Graham - http://geoffg.net
 
jovian
Regular Member

Joined: 16/04/2017
Location: Australia
Posts: 63
Posted: 09:18pm 16 Apr 2017
Copy link to clipboard 
Print this post

Hi Geoff!

Legend!

Thanks for responding.

Yes it's quite frustrating seeing the LED flash (with the phone) but getting no data across. I'm swapping out components, changed the power source for the sending Mite, about to try another LED... I'll post the solution as soon as I crack it.

Cheers
Joe
 
VK2MCT
Senior Member

Joined: 30/03/2012
Location: Australia
Posts: 120
Posted: 10:58pm 16 Apr 2017
Copy link to clipboard 
Print this post

Hi Joe,

What parameters are you using with the IRSEND command?

John B.
 
jovian
Regular Member

Joined: 16/04/2017
Location: Australia
Posts: 63
Posted: 11:24pm 16 Apr 2017
Copy link to clipboard 
Print this post

Here's the code for the sender. I have implemented the Sony remote protocol of sending three times, even though I presume this is not required for MM to MM communication.
Below is the terminal screen result. First I run the transmitting MM, which prints A% to the terminal (so I know it's going). Then I have swapped the terminal to chat to the receiving MM, then I run the Rx MM.

This is the thing.

I have closed the Tx IR LED in my fist so no light can escape. I have then repeatedly pressed a key on a Kogan IR remote, which responds reliably with "253 42" every time. I've pressed the key 12 times. Then I expose the Tx LED running on the other MM. No signal is registered by the Rx MM, even though the LED is flashing (when viewed through the iPhone camera).

Whilst the Tx LED is transmitting data I combine the LED's outputs and press the button on the Kogan remote four times. This returns "253 32 253 32 252 0 252 0 224 0", as good as proving that the IR Rx is picking up the signal from the LED, as it is interfering with the data being sent by the Kogan remote.

But it will not register data from the Tx LED by itself, no matter what I try.

EMOTICON OF HAMMER ON OWN HEAD :-)

Thanks
Joe

> AUTOSAVE

TOP:
DO
IR SEND 42,B%,A% : PAUSE 26 :IR SEND 42,B%,A% : PAUSE 26 :IR SEND 42,B%,A%
PRINT A%; " ";: A%=A%+1
B%=B%+1 : IF B%=32 THEN B%=0
PAUSE 50
LOOP UNTIL A%=127
A%=0 : GOTO TOP
Saved 185 bytes
> run
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 2
2 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 run
253 42 253 42 253 42 253 42 253 42
253 42 253 42 253 42 253 42 253 42
253 42 253 42 253 42 253 42 253 42
253 32 253 32 252 0 252 0 224 0
 
Geoffg

Guru

Joined: 06/06/2011
Location: Australia
Posts: 3292
Posted: 05:00am 17 Apr 2017
Copy link to clipboard 
Print this post

I presume that you are running the Micromite at the default 40MHz?

There is always the possibility that with the various MMBasic updates that something has broken in the IR SEND command. That feature is not used very much so it could have a problem and not be noticed (until now).

I will test it and report back. The only issue is that with my current commitments it could be after the next weekend before I can get to it.

Geoff
Geoff Graham - http://geoffg.net
 
jovian
Regular Member

Joined: 16/04/2017
Location: Australia
Posts: 63
Posted: 05:34am 17 Apr 2017
Copy link to clipboard 
Print this post

Hi Geoff
I really appreciate that.
I'm using it out of the box, the 44pin ready-assembled kit supplied by micromite.org. I haven't changed the clock speed.
I'll try a BC338 transistor tomorrow. Maybe the 2N3904 is causing the trouble.
Thanks
Joe

> PRINT MM.VER
5.0302
> PRINT MM.DEVICE$
Micromite MkII
 
Grogster

Admin Group

Joined: 31/12/2012
Location: New Zealand
Posts: 9610
Posted: 02:24pm 17 Apr 2017
Copy link to clipboard 
Print this post

If I can find the time, I will also run a test or two - I have plenty of IR LED's and receiver/decoder modules here. I am busy too, but not as much as Geoff at the moment I think.

Decoding an EXISTING remote works fine. I and many others have used it, but yeah - as Geoff says - IR SEND is probably not used that much. Perhaps there is a problem there.

I will post back here if I have anything to report.
Smoke makes things work. When the smoke gets out, it stops!
 
jovian
Regular Member

Joined: 16/04/2017
Location: Australia
Posts: 63
Posted: 05:51pm 17 Apr 2017
Copy link to clipboard 
Print this post

Thanks Grogster

I have since duplicated the IR Tx circuit described in the MM manual identically, with BC338, 56ohm and 1k resistors.

The LED is now brighter in my iPhone camera but the behaviour of the Rx is identical to as described above. The IR SEND command is pulsing the LED but certainly seems to not be sending meaningful data.

I have also swapped the roles of the two MM's, so now every component has been swapped including the power supply.

So if you have a chance to test this function out yourself it would be greatly appreciated!

Cheers
Joe
> PRINT MM.VER
5.0302
> PRINT MM.DEVICE$
Micromite MkII
 
panky

Guru

Joined: 02/10/2012
Location: Australia
Posts: 1114
Posted: 08:10pm 17 Apr 2017
Copy link to clipboard 
Print this post

@Geoff

Looking at the Tx (send) output on a cro, it appears to be sending just carrier - pulses at 12uSec period with even mark/space of approx 6uSec each.

This is 5.03 on a 28 pin 170 using pin 2 as the output pin and dev of 1 and various keycodes.

Using another 170 and a Sony remote, I see normal IR signal and it decodes correctly (eg. dev code 1, key code 18) but when looking at the Tx (send) output above, all I get are the three pulses approx 11mSec long, 26mSec apart with no data in them.

Hope this helps,

Cheers, Doug.

... almost all of the Maximites, the MicromMites, the MM Extremes, the ArmMites, the PicoMite and loving it!
 
jovian
Regular Member

Joined: 16/04/2017
Location: Australia
Posts: 63
Posted: 08:23pm 17 Apr 2017
Copy link to clipboard 
Print this post

Thanks for looking into that Doug
 
Grogster

Admin Group

Joined: 31/12/2012
Location: New Zealand
Posts: 9610
Posted: 09:41pm 17 Apr 2017
Copy link to clipboard 
Print this post

  panky said   @Geoff

Looking at the Tx (send) output on a cro, it appears to be sending just carrier - pulses at 12uSec period with even mark/space of approx 6uSec each.

This is 5.03 on a 28 pin 170 using pin 2 as the output pin and dev of 1 and various keycodes.

Using another 170 and a Sony remote, I see normal IR signal and it decodes correctly (eg. dev code 1, key code 18) but when looking at the Tx (send) output above, all I get are the three pulses approx 11mSec long, 26mSec apart with no data in them.

Hope this helps,

Cheers, Doug.


Well, that's interesting. And should not be..... Looks like our newest member may have found a bug in his first couple of posts!
Smoke makes things work. When the smoke gets out, it stops!
 
panky

Guru

Joined: 02/10/2012
Location: Australia
Posts: 1114
Posted: 11:03pm 17 Apr 2017
Copy link to clipboard 
Print this post

@Geoff,

Further to my post above, reverted to 4.5C on the send unit and all works as it should - coded data out the send unit and correct decoding (running 5.03) in the receive unit (both 28 pin 170's).

Doug.

Edit: Sorry Geoff, hope I haven't led you astray - deeper scaning of the Send signal does show that there are groups of pulses in lumps of 42 (or possibly also the 86 but it is a bit hard to determine where the actual break is as the change appears to be just 8uSec between groups). Output from a Sony remote seems a lot slower with pulse widths in the 100s of uSecs?

In any event, the coding is still not being deciphered by the receive side as valid IR code.

Doug.
Edited by panky 2017-04-19
... almost all of the Maximites, the MicromMites, the MM Extremes, the ArmMites, the PicoMite and loving it!
 
Geoffg

Guru

Joined: 06/06/2011
Location: Australia
Posts: 3292
Posted: 03:28am 18 Apr 2017
Copy link to clipboard 
Print this post

No problem. There definitely seems to be a problem that needs looking into.
Geoff Graham - http://geoffg.net
 
panky

Guru

Joined: 02/10/2012
Location: Australia
Posts: 1114
Posted: 09:24pm 18 Apr 2017
Copy link to clipboard 
Print this post

@Geoff

Have managed to narrow down a bit further where the issue may be.
Set up is your test programs from the manuals but sending a continuous dev code of 1 and key code of 18 (Sony Volume Up key).

Under 4.5, the send burst has pulses for 0's and no pulses for 1's, so looking at the cro I see a 19mSec wide window with a burst of 13uSec pulses for about 2.4mSec then a gap of 600uSecs, then a 600uSec burst of pulses and so on and so forth.

This is correctly decoded by the receive unit as dev code 1 and key code 18

Under 5.03, the send unit sends a near continuous burst of 13uSec pulses for the entire 19mSecs, which effectively equates to a stream of 0's and is decoded by the receive unit as a blank 19mSec widow ie. it is seeing the pulses from the send unit but is interpreting as all 0's. (which in fact is what is being sent).

Had fun getting my head around this
Cheers,
Doug.

... almost all of the Maximites, the MicromMites, the MM Extremes, the ArmMites, the PicoMite and loving it!
 
Geoffg

Guru

Joined: 06/06/2011
Location: Australia
Posts: 3292
Posted: 02:37pm 19 Apr 2017
Copy link to clipboard 
Print this post

I have had an opportunity to look at this and (I hope) found the bug.

Could you try the attached version 5.3.3. Sorry to use you as a tester but I have run out of time to do a full test.

2017-04-20_003659_Micromite-V5.3.3..zip

Geoff
Geoff Graham - http://geoffg.net
 
jovian
Regular Member

Joined: 16/04/2017
Location: Australia
Posts: 63
Posted: 10:23pm 19 Apr 2017
Copy link to clipboard 
Print this post

Great stuff people I'm really impressed. Seriously good .

I've ordered a PicKit3.5 but as it will take 2 weeks I'll have to leave you to the testing of 5.3.3, continue with the code and wait til it gets here.

in the meantime may I say how impressed I am with the Micromite.

If you told me in as a in 1983 that as a 50YO in the 21st century, I'd be programming BASIC with a chip a hundredth of the size and price and a hundred times the speed of my TRS80, I'd have believed it.

The part I'd find mind bending is that it wouldn't be possible to do as a 20, 30 or 40 year old.

Restoring BASIC is not just of great practical value to me - I've rediscovered a large part of myself that I thought had gone forever. It was all a misty nostalgic haze until the MM came along two weeks ago and changed my life.

So thanks for making this possible Geoff, it must be huge amounts of work for you, and I'm grateful for it.

Cheers
Joe

 
CaptainBoing

Guru

Joined: 07/09/2016
Location: United Kingdom
Posts: 2170
Posted: 11:17pm 19 Apr 2017
Copy link to clipboard 
Print this post

  jovian said  

It was all a misty nostalgic haze until the MM came along



+1
 
     Page 1 of 2    
Print this page
The Back Shed's forum code is written, and hosted, in Australia.
© JAQ Software 2025