PDA

View Full Version : Now to something completely different



Ted's
- 4th June 2008, 10:19
Now I am approaching a different task.

I connected a TSOP-IR-Receiver to my device being run by a 16f628a. I want to control it via palmos 3.5 irda or own codes.

Question: Who has already accomplished that task and can give me reliable sources?

mackrackit
- 4th June 2008, 11:05
I remember seeing an APP note on the microchip site a couple of years ago that talk about a project like yours. Do a search there.

Have you done any programming for the palm? If so, (just curious) what developer are you using?

ardhuru
- 4th June 2008, 11:53
Hi, the irda signal is not modulated; so, you first need to get rid of the TSOP-IR-Receiver.

Adding irda capability to a PIC could be achieved a number of ways. Microchip themselves have irda codec solutions. Or, look up www.sirpic.com. The guy there, Ravi, specializes in Micro-to-irda solutions in varying degrees of customization. At this site, you'll also find a software-only irda implementation for PICs contributed by another person.

Regards

Anand

Ted's
- 4th June 2008, 22:18
I remember seeing an APP note on the microchip site a couple of years ago that talk about a project like yours. Do a search there.

Have you done any programming for the palm? If so, (just curious) what developer are you using?

I found it. Nice. One drawback is that the tsop is limited to - I guess - 1k bps meaning that the irda requiring 9600bps won't work so I'll have to work with my own codes and low-level. I hope that low - level does not mean assembler though.

Ted's
- 4th June 2008, 22:23
Hi, the irda signal is not modulated; so, you first need to get rid of the TSOP-IR-Receiver.

Adding irda capability to a PIC could be achieved a number of ways. Microchip themselves have irda codec solutions. Or, look up www.sirpic.com. The guy there, Ravi, specializes in Micro-to-irda solutions in varying degrees of customization. At this site, you'll also find a software-only irda implementation for PICs contributed by another person.

Regards

Anand
Or modulate the signal. This is what I want to do. Being dependend on light situations has always been the greatest drawback of irda.

Is there a sorce code on his site? I couldn't find any...

ardhuru
- 5th June 2008, 03:29
http://sirpic.com/LabCPs2ir.html

Ted's
- 7th June 2008, 01:55
I am using a vb-clone for palm programming.

The only option is to use IrDA.

If I use IrDA,open the connection and send the value 3211 using a baudrate of 38400 and having the TSOP attached to the pic, what should I receive and how do I convert it back to the value via pbp?

Please no links this time. I want to see this problem solved step by step so I can create a code suitable according to this example.

ardhuru
- 7th June 2008, 07:14
Ted, here are my views. Consumer IR, which uses modulation, has range, but cannot handle large data flows; that is why irda is not modulated, to enable a relatively higher bandwidth.

You cannot, therefore, modulate and demodulate the raw irda at each end and expect good results (unless you design a complex data buffering system to be stuck in between).

If you must use irda, you will have to accept the raw irda distance limitations.

Ted's
- 7th June 2008, 10:31
There is no need for high bandwidth.

There is a need for emulating the 38khz carrier frequency using IrDA as IrDA is the only way to access the IR Port.

What I found is that using a baudrate of 38400 makes the PIC-Device understand something(I made a LED flash each time the PIC recieves a High-Low and Low-High-change) but I cannot decode it as I don't understand it. It is no real rs-232-code.

You can help me by sharing pseudo-code for my Palm Programme and PBP-Code for the receiving part.

Ted's
- 7th June 2008, 12:44
I address this to all readers:

There is no need for high bandwidth.

There is a need for emulating the 38khz carrier frequency using IrDA as IrDA is the only way to access the IR Port.

What I found is that using a baudrate of 38400 makes the PIC-Device understand something(I made a LED flash each time the PIC recieves a High-Low and Low-High-change) but I cannot decode it as I don't understand it. It is no real rs-232-code.

You can help me by sharing pseudo-code for my Palm Programme and PBP-Code for the receiving part.

Ted's
- 8th June 2008, 01:11
To the other users: Note that there are some closed source Palm remote control emulators being proof for doability.

There is still a want for a solution.

Darrel Taylor
- 8th June 2008, 01:47
Sorry, there must have been an error of some kind.

Many posts of the same message appeared.

Also edited the last message, since it no longer applied.

ardhuru
- 8th June 2008, 06:21
Thanks, Darrel.

I have no idea why my message got posted repeatedly.

I'm sorry for the inconvenience caused.

Regards,

Anand

Ted's
- 11th June 2008, 18:33
I accept your excuse.

Darrel, do you have a recommendation on how to proceed regarding the main issue?

Ted's
- 24th June 2008, 09:07
I proceeded in the past. I succeeded in creating the signal, but decoding using pbp is a challenge.
The code is rc5.
Here is the pbpcode. Receiver means TSOP1740, 1 = No signal, 0 = Signal:



Palm:
WHILE Receiver = 1
WEND
WHILE Receiver = 0
WEND
WHILE Receiver = 1
WEND
ByteNumber = 5
WHILE ByteNumber > 0
--------Time = 0
--------WHILE Receiver = 0
----------------Time = Time + 1
----------------Pauseus 10
--------WEND
--------IF Time > 140 THEN
----------------DeviceNr.0[ByteNumber-1] = 0
--------ELSE
----------------DeviceNr.0[ByteNumber-1] = 1
--------ENDIF
--------ByteNumber = ByteNumber - 1
--------Time = 0
--------WHILE Receiver = 1
----------------Time = Time + 1
----------------Pauseus 10
--------WEND
--------IF Time > 140 THEN
----------------DeviceNr.0[ByteNumber-1] = 1
--------ELSE
----------------DeviceNr.0[ByteNumber-1] = 0
--------ENDIF
--------ByteNumber = ByteNumber - 1
WEND
ByteNumber = 6
WHILE ByteNumber > 0
--------IF Receiver = 1 THEN
----------------Time = 0
----------------WHILE Receiver = 1
------------------------Time = Time + 1
------------------------Pauseus 10
------------------------If Time = 254 THEN
--------------------------------ByteNumber = 0
------------------------ENDIF
----------------WEND
----------------IF Time > 140 THEN
------------------------Content.0[ByteNumber-1] = 0
----------------ELSE
------------------------Content.0[ByteNumber-1] = 1
----------------ENDIF
----------------ByteNumber = ByteNumber - 1
--------ELSE
----------------Time = 0
----------------WHILE Receiver = 0
------------------------Time = Time + 1
------------------------Pauseus 10
----------------WEND
----------------IF Time > 140 THEN
------------------------Content.0[ByteNumber-1] = 1
----------------ELSE
------------------------Content.0[ByteNumber-1] = 0
----------------ENDIF
----------------ByteNumber = ByteNumber - 1
--------ENDIF
WEND
Goto Palm


Content and DeviceNr are always 0xFF. Why is this so?

If you have questions, ASK!

Thank you.

Ted's
- 25th June 2008, 17:51
To be continued here: http://www.picbasic.co.uk/forum/showthread.php?p=58443#post58443