Home
JAQForum Ver 20.06
Log In or Join  
Active Topics
Local Time 20:31 19 Apr 2024 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 : PicoMite MMBasic- IRSEND missing or I am missing something, Plse help?

Author Message
EverLearning
Newbie

Joined: 15/05/2022
Location: United States
Posts: 3
Posted: 12:20pm 15 May 2022
Copy link to clipboard 
Print this post

PicoMite newbie here :-).  Having fun but ran into a problem trying to use IRSEND.  It looks like (despite the manual) that the command is missing / not actually implemented?!?

Running:  PicoMite MMBasic Version 5.07.04


'send IR code

SetPin gp19, dout
Dim integer DevCode, KeyCode

DevCode = 255
Keycode = 90

Print DevCode, Keycode

IRSEND gp19, DevCode, KeyCode

End
> run
255     90

[11] IRSEND gp19, DevCode, KeyCode
Error : Unknown command

>


Tried various versions of that, but it seems that just IRSEND results in the same error.

The IR receive example from the manual runs correctly, fwiw..

Three days of combing the web looking for answers ;-).  Perhaps I am the only one trying to use IRSEND?

Any help, suggestions or pointers GREATLY appreciated!

Thanks, Vic.
 
JohnS
Guru

Joined: 18/11/2011
Location: United Kingdom
Posts: 3649
Posted: 12:43pm 15 May 2022
Copy link to clipboard 
Print this post

I only had a quick look, but the code seems to want
IR SEND
rather than IRSEND

(Also IR CLOSE not IRCLOSE. And so on.)

edit: the manual appears to say the same...

John
Edited 2022-05-15 22:45 by JohnS
 
phil99

Guru

Joined: 11/02/2018
Location: Australia
Posts: 1773
Posted: 12:44pm 15 May 2022
Copy link to clipboard 
Print this post

It appears the version of IR implemented on the PicoMite is different to the manual.
Typing LIST COMMANDS shows IR but not IRSEND.

Tried

IR SEND gp0, 25, 90

and that doesn't give an error, so I assume it works.

Don't use SETPIN as IR does that automatically.
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 8567
Posted: 12:55pm 15 May 2022
Copy link to clipboard 
Print this post

  Quote  It appears the version of IR implemented on the PicoMite is different to the manual.


The manual is correct "IR SEND"
 
phil99

Guru

Joined: 11/02/2018
Location: Australia
Posts: 1773
Posted: 01:02pm 15 May 2022
Copy link to clipboard 
Print this post

The manual that came with the latest version has IRSEND. One word not two.

Edit
Just downloaded another copy of the manual and it is the same.
Cleared cache first.

Checked some older versions. They are all the same.
Edited 2022-05-15 23:20 by phil99
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 8567
Posted: 02:10pm 15 May 2022
Copy link to clipboard 
Print this post

The command listing in both cases is correct. The "special devices" section needs updating
 
EverLearning
Newbie

Joined: 15/05/2022
Location: United States
Posts: 3
Posted: 06:49pm 15 May 2022
Copy link to clipboard 
Print this post

  phil99 said  It appears the version of IR implemented on the PicoMite is different to the manual.
Typing LIST COMMANDS shows IR but not IRSEND.

Tried

IR SEND gp0, 25, 90

and that doesn't give an error, so I assume it works.

Don't use SETPIN as IR does that automatically.


THANKS Folks, that works :-).  IR detector shows (as does the scope) that we are getting what appears to proper pulses :-).

MUCH APPRECIATED!

Of course, now I feel like an idiot as that is the only thing that I didn't try :-) LOL.

And yes, the 05 and 07 manuals that I have both say IRSEND.

Also, FWIW, I used SETPIN and that doesn't appear to affect the IR SEND command.  Just commented that out and it still works :-).

Again, THANKS! Vic.
 
Geoffg

Guru

Joined: 06/06/2011
Location: Australia
Posts: 3165
Posted: 01:34am 16 May 2022
Copy link to clipboard 
Print this post

  matherp said  The command listing in both cases is correct. The "special devices" section needs updating

The manuals in the download have been updated.  They are now at Rev 3.

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

Guru

Joined: 11/02/2018
Location: Australia
Posts: 1773
Posted: 07:34am 16 May 2022
Copy link to clipboard 
Print this post

Another minor item for Rev 4.

VGA manual Page 10 pin diagram "VGA Blue Output" and "VGA 1/2 green Output" transposed.
 
EverLearning
Newbie

Joined: 15/05/2022
Location: United States
Posts: 3
Posted: 09:14pm 16 May 2022
Copy link to clipboard 
Print this post

Just an update here.  Not sure this is going to work for me.  None of the remotes that I have seem to work with IR SEND.  The IR receive manages to capture the codes, but IR SEND has limits :-).

Some examples from the remotes I want to emulate with the pico:
' comments added otherwise the capture (Received) is the example out of the manual and the IR SEND is hacked in by me in the interrupt routine :-).

Extract from the code for reference:

...
SetPin gp6, IR
...
Dim integer DevCode, KeyCode ' variables used by decoder                        
IR DevCode, KeyCode, IRInt ' start ir decoder  
...
Sub IRInt                                                                      
 Print "Received device = " DevCode " key = " KeyCode                          
 IR Send gp18, DevCode, Keycode   ' My addition to example.                                            
End Sub    


Error issues:

Received device =  8415 key =  16  ' Vizio device is 8415 (power key)
[31] IR Send gp18, DevCode, Keycode                                            
Error : 8415 is invalid (valid is 0 to 31)

Received device =  128 key =  152                                              
[31] IR Send gp18, DevCode, Keycode                                            
Error : 128 is invalid (valid is 0 to 31)   ' iview device (128) power key (152)

Received device =  16 key =  149                                                
[31] IR Send gp18, DevCode, Keycode                                            
Error : 149 is invalid (valid is 0 to 127)   ' 152 is sony remote power key


I am a bit confused, it would seem that whatever receive gets should be sendable by SEND?

Or am I doing something wrong / missed something ?

Comments, suggestions, pointers GREATLY appreciated :-)!

Thanks, Vic.
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 8567
Posted: 09:17pm 16 May 2022
Copy link to clipboard 
Print this post

Don't put the IR SEND in the interrupt routine. This will cause problems as the receive interrupt can't trigger normally because the send is blocking the interrupt
 
phil99

Guru

Joined: 11/02/2018
Location: Australia
Posts: 1773
Posted: 10:14pm 16 May 2022
Copy link to clipboard 
Print this post

IR SEND appears to be limited to:-

IR Send pin(x), 31, 127

Codes greater than those can't be sent at all.

The BITBANG BITSTREAM command would be one way to send any bit sequence. Use a diode / resistor AND gate to mix that with a 38kHz PWM square wave from another pin.

To get the original bit sequence you could possibly use Peters CSUB LOG to capture the output of the IR receiver. Or find the transmission protocol on the net and create your sequence from that.




You could eliminate the need for the AND gate by replacing the bit pulses in the bitstream with the required number of 13uS pulses and 13uS pauses to produce the complete 38kHz modulated signal on one pin.
Edited 2022-05-17 10:05 by phil99
 
Print this page


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

© JAQ Software 2024