bit-banging infrared Picaxe

lornetw

New Member
While exploring Hippy's web site (http://www.hippy.freeserve.co.uk/picaxeir.htm), I found an article on using infrared with the picaxe chips without using Infrain. I don't know if anyone has used his program to do infrared control with the Picaxe?

I searched the forums quite extensively and only found another reference to Hippy's site.

His program is exactly what I need - I don't want my robot to freeze while it's waiting for a signal from the remote control (when using the 'infrain' function).

I wonder if I could ask the forum a few questions.

I am using the Picaxe-28x (with the project board), the Panasonic PNA4602M infrared receiver and a RadioShack ($10CAN)universal remote. I know this all works together because I got it working with the 'infrain' function and I can read the 'infra' value.

Question 1: Has anyone ever used the Panasonic PNA4602 IR receiver with Picaxes? I cannot buy the same receiver offered for
sale in the UK (the one shown in the Picaxe manuals) because the dealer in Canada (http://hvwtech.com/) has decided not to
stock all the items available in the UK (I would have to pay a lot just to have one item imported from the UK).

Question 2 and 3: After typing in Hippy's program for bit-banging the infrared signal, I have 2 problems - 1) I have to press the buttons twice to get a reading on the screen (using Debug) and 2) the values are garbled. For instance, if I press the
'5' button(twice), I get some value on the Debug screen for all the b0, b1 variables, etc - but when I press another key twice and then come back and press the '5' key twice again, I don't get the same values I got the first time.

Is there any way to eliminate the double button pressing and get the values of the key being pressed on the remote control?

I just want to read the value of what button is pressed just like the 'infrain' function for use with my robot.

Maybe I will have to play with parameters like min_pulsin, pause_time, bit_time, etc until I get the right combination. I get
the impression that the communications parameters are not quite correct and the receiver is reading bits and pieces of each burst sent by the remote control. Do you know of any quick way to find the proper values or a way of using Hippy's program?

Any help you could give me would be greatly appreciated.

Regards,

Lorne Wilkins
e-mail: lornetw@yahoo.com
 

hippy

Ex-Staff (retired)
I know the code has worked reliably with a controller I have but it obviously cannot be guaranteed for all. It does sound like there is some timing issue, and the simple bit-banged code cannot do all the checks and accurate timing the INFRAIN command does.

The brute force approach may be to keep reading codes until you get a certain number of consecutive codes the same. That could however result in a lot of 'nothing happening' if the error rate is too high. Checking there is no IR for a certain time at the start of the bit-banged code may improve things.

You can try tweaking the code timing constants but it might have to be trial and error. You could have a simple PULSIN loop which can report what lengths of IR pulses you are getting and see how they match with the timing constants used.

If you have access to a scope you can examine the data stream received at the PICAXE pin to see what timing it has and confirm the IR command is being cleanly and consistently received.
 
Top