Home
JAQForum Ver 24.01
Log In or Join  
Active Topics
Local Time 07:12 02 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 2 of 2    
Author Message
panky

Guru

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

@Geoff

Fix works fine, thanks. Out of curiosity, can you indicate where the issue was? I had a look at the source but my very rudimentary knowledge of C was not enough to see the problem.

Cheers,
Doug.


... for matherp - problem also exists on the MZ 144 board running 5.03.04
... almost all of the Maximites, the MicromMites, the MM Extremes, the ArmMites, the PicoMite and loving it!
 
robert.rozee
Guru

Joined: 31/12/2012
Location: New Zealand
Posts: 2442
Posted: 06:09pm 20 Apr 2017
Copy link to clipboard 
Print this post

geoff: is there any chance you could also roll in the fix for the cut-and-paste bug in the editor? i've tested the fix fairly well, and it does work. in the file editor.c, edit the line:
for(p = txtp; p <= mark; p++) if(*p == '\n') nbrlines--;

to instead read:
for(p = txtp; p < mark; p++) if(*p == '\n') nbrlines--;

ie, replace "<=" with "<" in order to not decrement nbrlines in response to a CR character sitting right after (but still outside of) the block of marked text.


cheers,
rob :-)
 
Geoffg

Guru

Joined: 06/06/2011
Location: Australia
Posts: 3292
Posted: 07:31am 21 Apr 2017
Copy link to clipboard 
Print this post

  panky said  Fix works fine, thanks. Out of curiosity, can you indicate where the issue was? I had a look at the source but my very rudimentary knowledge of C was not enough to see the problem.

Thanks Doug,

The second line below (uSec(600);) was missing. It was in all versions up to 5.0 but then went AWOL! How come? I don't know.


for(i = 0; i < 12; i++) {
uSec(600);
if(cmd & 1)
IRSendSignal(pin, 92);
else
IRSendSignal(pin, 46);
cmd >>= 1;
}


Geoff
Geoff Graham - http://geoffg.net
 
Geoffg

Guru

Joined: 06/06/2011
Location: Australia
Posts: 3292
Posted: 07:47am 21 Apr 2017
Copy link to clipboard 
Print this post

  robert.rozee said   geoff: is there any chance you could also roll in the fix for the cut-and-paste bug in the editor? i've tested the fix fairly well, and it does work.

Hi Rob, that release was just intended to test the fix for the IR bug and I have plenty of other improvements to go before the next release - but your bug fix is so simple that I have recomplied the source with your fix (now ver 5.3.4) and attached it below.
2017-04-21_174354_Micromite-V5.3.4.zip

Hopefully that has fixed it.

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

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

Success!!

Received the PicKit yesterday and have managed to upgrade the firmware no problem - IR SEND is working brilliantly, first time.

Thanks for the incredible response Geoff and all for investigating. I'm getting such a hit off of this!

I'll post a link to the end result when it's time, I intend to make it flash!

Cheers all
Joe

 
lew247

Guru

Joined: 23/12/2015
Location: United Kingdom
Posts: 1702
Posted: 08:55pm 14 Nov 2020
Copy link to clipboard 
Print this post

I've been considering using Infrared instead of HC-12 as a MM to MM link

I've been reading the manual and while it's probably dead simple for those that understand it, to me it doesn't make sense
Could anyone explain it in a simple way?

I won't be using any device code? but another MM so I don't know the key code

I'll be using this on a Pi-Cromite as the TX and Armmite as the RX
IF I've understood properly then this "may" work
pin 20 is the MM pin
system "wget -q -O-  "+p$+"https://api.darksky.net/forecast/458113cd1162af4b1f0677d08822fbaf/53.440120,-2.106181?units=uk2&exclude=flags,alerts,minutely"+p$,a()
prob$=JSON$(a(),"currently.precipProbability")'Chance of Rain/Snow
vis$=JSON$(a(),"currently.visibility")'visibility
cloud$=JSON$(a(),"currently.cloudCover")'Cloud Cover
IR SEND 20,vis$,cloud$,prob$ : PAUSE 26 : IR SEND 20,vis$,cloud$,prob$ :IR SEND 20,vis$,cloud$,prob$


I can't believe it's this simple and it maybe that you can only send numbers?
But I saw earlier that you can do MM to MM communication

Is there a way to do this so it will work?
 
TassyJim

Guru

Joined: 07/08/2011
Location: Australia
Posts: 6283
Posted: 09:59pm 14 Nov 2020
Copy link to clipboard 
Print this post

  Quote  IR SEND pin, dev, key
Generate a 12-bit Sony Remote Control protocol infrared signal.
'pin' is the I/O pin to use. This can be any I/O pin which will be automatically configured as an output and should be connected to an infrared LED.
Idle is low with high levels indicating when the LED should be turned on.
'dev' is the device being controlled and is a number from 0 to 31, 'key' is the simulated key press and is a number from 0 to 127.
The IR signal is modulated at about 38KHz and sending the signal takes about 25mS.


The SONY codes can be any number from 0 to 127 so you can send text as individual characters. The system doesn't care of you are turning on your TV or feeding the cat. It's just a number to the firmware.

You have to send the characters one at a time where 'key' is asc(char)

It will be slow.

Jim
VK7JH
MMedit
 
lew247

Guru

Joined: 23/12/2015
Location: United Kingdom
Posts: 1702
Posted: 09:10am 15 Nov 2020
Copy link to clipboard 
Print this post

  TassyJim said  
The SONY codes can be any number from 0 to 127 so you can send text as individual characters. The system doesn't care of you are turning on your TV or feeding the cat. It's just a number to the firmware.

You have to send the characters one at a time where 'key' is asc(char)

It will be slow.

Jim


Ah, that means you can't send a decimal point...  so that means you cannot use it as a serial transmiter/receiver because you can only send numbers and not letters?
Edited 2020-11-15 19:46 by lew247
 
TassyJim

Guru

Joined: 07/08/2011
Location: Australia
Posts: 6283
Posted: 10:59am 15 Nov 2020
Copy link to clipboard 
Print this post

You can send ANY of the 128 characters including letters, numbers, punctuation etc.
It will be very slow.
To send a character, you give it's ascii code.

Jim
VK7JH
MMedit
 
lew247

Guru

Joined: 23/12/2015
Location: United Kingdom
Posts: 1702
Posted: 02:08pm 15 Nov 2020
Copy link to clipboard 
Print this post

  TassyJim said  You can send ANY of the 128 characters including letters, numbers, punctuation etc.
It will be very slow.
To send a character, you give it's ascii code.
Jim


IF I've got you right I have to convert vis$, cloud$ and prob$ to their ascii codes then send them in one go?


If I IR SEND 20,vis$,cloud$,prob$ : PAUSE 26 : IR SEND 20,vis$,cloud$,prob$ :IR SEND 20,vis$,cloud$,prob$


with vis$ being 10.7  which would be 49484655
and cloud$ being 203  which would be 504851
and prob$ being 70%   which would be 554837
so in effect it would be I could send

IR SEND 20,49484655,504851,554837 : PAUSE 26 : IR SEND 20,49484655,504851,554837 : IR SEND 20,49484655,504851,554837

or would it be
IR SEND 20,49484655504851554837 : PAUSE 26 : IR SEND 20,49484655504851554837 : IR SEND 20,49484655504851554837
 
TassyJim

Guru

Joined: 07/08/2011
Location: Australia
Posts: 6283
Posted: 08:11pm 15 Nov 2020
Copy link to clipboard 
Print this post

For n = 1 to len(vis$)
ch$ = mid$(vis$,n,1)
IR SEND 20, asc(ch$)
next n
VK7JH
MMedit
 
TassyJim

Guru

Joined: 07/08/2011
Location: Australia
Posts: 6283
Posted: 10:14pm 15 Nov 2020
Copy link to clipboard 
Print this post

Here is a working example.
You will need to change the IR sending pin number to suit your hardware.
 OPTION EXPLICIT
 OPTION DEFAULT NONE
 DIM INTEGER p = 15 ' IR sending pin
 DIM INTEGER dev = 4 ' anything will do as long as the receiver uses the same number
 
 DIM cloud$ = "203"
 TIMER = 0
 sendIR cloud$
 PRINT TIMER

SUB sendIR txt$
 LOCAL INTEGER n
 LOCAL ch$
 FOR n = 1 TO LEN(txt$)
   ch$ = MID$(txt$,n,1)
   IR SEND p,dev,ASC(ch$)
 NEXT n
END SUB

It takes 58mS to send 3 characters which is about 50 characters per second.
Very slow!

Jim
VK7JH
MMedit
 
lew247

Guru

Joined: 23/12/2015
Location: United Kingdom
Posts: 1702
Posted: 11:47am 16 Nov 2020
Copy link to clipboard 
Print this post

Thanks Jim. I totally understand how to send the data  

now to work on understanding how to reverse it and extract the data on receive
 
     Page 2 of 2    
Print this page


To reply to this topic, you need to log in.

The Back Shed's forum code is written, and hosted, in Australia.
© JAQ Software 2025