forums.ps2dev.org Forum Index forums.ps2dev.org
Homebrew PS2, PSP & PS3 Development Discussions
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

PSP 2 PSP communication example with IrDA

 
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PSP Development
View previous topic :: View next topic  
Author Message
Shine



Joined: 03 Dec 2004
Posts: 728
Location: Germany

PostPosted: Sun Jul 10, 2005 12:42 am    Post subject: PSP 2 PSP communication example with IrDA Reply with quote

Source and precompiled for 1.0 and 1.5 firmware. I have tested it with one 1.0 firmware PSP and one 1.5 and it works until ca. 30 cm.
Back to top
View user's profile Send private message
Laurens



Joined: 28 Jun 2005
Posts: 14

PostPosted: Sun Jul 10, 2005 2:42 am    Post subject: Reply with quote

Great, thanks! Nice & simple :) FYI: It's in the svn-repository now, thanks to Jim.
_________________
If a beautiful girl tells you she's done some modeling work in the past, and you ask her what 3D software she used, you might be a gamedeveloper.
Back to top
View user's profile Send private message MSN Messenger
EdwardFMA



Joined: 06 Jul 2005
Posts: 40

PostPosted: Sun Jul 10, 2005 6:17 pm    Post subject: Reply with quote

Ok two thing
1. Do TV's use IRDA?

if so is this correct?
Quote:
#include <pspkernel.h>
#include <pspctrl.h>
#include <pspdebug.h>
#include <pspiofilemgr.h>
#include <stdlib.h>
#include <string.h>

PSP_MODULE_INFO("PSPDEMO4", 0, 1, 1);
PSP_MAIN_THREAD_ATTR(0);

#define printf pspDebugScreenPrintf
#define REPEAT_TIME 0x40000
static unsigned long control_bef_ctl = 0;
static unsigned long control_bef_tick = 0;

int exit_callback(void)
{
sceKernelExitGame();

return 0;
}

void CallbackThread(void *arg)
{
int cbid;

cbid = sceKernelCreateCallback("Exit Callback", exit_callback, NULL);
sceKernelRegisterExitCallback(cbid);

sceKernelSleepThreadCB();
}

int SetupCallbacks(void)
{
int thid = 0;

thid = sceKernelCreateThread("update_thread", CallbackThread, 0x11, 0xFA0, 0, 0);
if(thid >= 0)
{
sceKernelStartThread(thid, 0, 0);
}

return thid;
}

unsigned long Read_Key(void) {
ctrl_data_t key;

sceCtrlSetSamplingCycle(0);
sceCtrlSetSamplingMode(1);
sceCtrlReadBufferPositive(&key, 1);
if (key.buttons == control_bef_ctl) {
if ((key.frame - control_bef_tick) > REPEAT_TIME) {
return control_bef_ctl;
}
return 0;
}
control_bef_ctl = key.buttons;
control_bef_tick = key.frame;
return control_bef_ctl;
}

int main(void)
{
unsigned long ctrl;
int fd = sceIoOpen("irda0:", PSP_O_RDWR, 0);

SetupCallbacks();
pspDebugScreenInit();
printf("Remote for Daewoo DVD Player\n");
printf("Power on/off - start");

while(1)
{
ctrl = Read_Key();
if (ctrl & CTRL_START)
{
unsigned long padHighbyte = 0x000000000000708F;
sceIoWrite(fd, &padHighbyte, 1);
}
}
return 0;
}


2. If you made a Driver that reads a infared device on the serial port could you use the PSP as a Controller on a PC?
_________________
EdwardFMA/IchigoKurosaki - PSP Expert
Athlon 64 - Socket 939 - 3000+
1GB 333 DDR-Ram
Geforce 6600 GT PCI-Express

Orbis PSP Development
Open-Source Development
Back to top
View user's profile Send private message
Shine



Joined: 03 Dec 2004
Posts: 728
Location: Germany

PostPosted: Sun Jul 10, 2005 9:43 pm    Post subject: Reply with quote

EdwardFMA wrote:
Ok two thing
1. Do TV's use IRDA?


No, use the SIRCS example for this (but works for Sony devices only)

EdwardFMA wrote:
2. If you made a Driver that reads a infared device on the serial port could you use the PSP as a Controller on a PC?


Yes, this is possible, but would be better to use SIRCS and a selfmade receiver, because IrDA doesn't work if the PSP is more than 30 cm away from the receiver.
Back to top
View user's profile Send private message
LiquidIce



Joined: 04 Apr 2005
Posts: 55

PostPosted: Mon Jul 11, 2005 3:13 am    Post subject: Reply with quote

Would it be possible to convert an IR code from say, a phillips pronto, into a sircs code that can be sent out from the PSP? There are thousands of pronto codes for download on remotecentral.com, it would be neat to have an eboot which holds a database of all of them.

Regular remotes can have a carrier, a repeat rate alternating bits, etc.. The pronto code is just some hex values with the first few bytes being the freqency, carrier and repeat rate, then an on/off pulse train with a lead out at the end. If you hold down the button on some IR remotes it will send a different code when you release it. (A volume up command for example)
Sircs, sends out the same bytes no matter how long you hold down the button.

So AFAIK, the two code types are incompatible.
Someone please prove me wrong, and post a link to some PRONTO -> SIRCS conversion info.

Some additional reading:
SIRCS protocol:
http://www.edcheung.com/automa/sircs.htm
Back to top
View user's profile Send private message Visit poster's website
Shine



Joined: 03 Dec 2004
Posts: 728
Location: Germany

PostPosted: Mon Jul 11, 2005 3:35 am    Post subject: Reply with quote

LiquidIce wrote:
Would it be possible to convert an IR code from say, a phillips pronto, into a sircs code that can be sent out from the PSP? There are thousands of pronto codes for download on remotecentral.com, it would be neat to have an eboot which holds a database of all of them.


You are right, it is not possible with the SIRCS example, because SIRCS has a fixed carrier and frequency, see this topic for details. But perhaps it is possible to program the IR led of the PSP to use other values by direct accessing the hardware. It should be possible, because it is used for IrDA and SIRCS, which are very different from each other, but for this you have to analyze the kernel in more detail.
Back to top
View user's profile Send private message
BeBopFMA



Joined: 22 Aug 2005
Posts: 3
Location: illinois

PostPosted: Mon Aug 22, 2005 10:05 am    Post subject: psportal Reply with quote

i really liked edwardfma's portal and it is by far tha best one i hav seen but i was wondering if anybody could tell me if there was anyother way besides dreamweaver (cause i didnt wnt to spend 299$ on tha program and tha download didnt wrk)to mak a portal help wuld be grt thankx



ps..... MAJOR PROPS to edward fma again cnt wait t osee more portals!!
Back to top
View user's profile Send private message Send e-mail Visit poster's website AIM Address
djstriker91



Joined: 23 Aug 2005
Posts: 2

PostPosted: Tue Aug 23, 2005 10:09 am    Post subject: Re: psportal Reply with quote

BeBopFMA wrote:
i really liked edwardfma's portal and it is by far tha best one i hav seen but i was wondering if anybody could tell me if there was anyother way besides dreamweaver (cause i didnt wnt to spend 299$ on tha program and tha download didnt wrk)to mak a portal help wuld be grt thankx



ps..... MAJOR PROPS to edward fma again cnt wait t osee more portals!!


Copy and mess around with the source (from another portal) in Microsoft Word would probably work too.
Back to top
View user's profile Send private message
BeBopFMA



Joined: 22 Aug 2005
Posts: 3
Location: illinois

PostPosted: Tue Aug 23, 2005 10:16 am    Post subject: Reply with quote

thankx alot tht will really help. soon i will be posting a link to one of my portals i will hav photos of tha prototype soon, i pln on makin it an alienware theme. features(culd chang)gud size start bar,desktop icons, more games, and i also will be hopefully adding a kind of windows media/ mp3 player i hav a friend whos helpin but dont get ur hopes up.

thts all tha info i got for now more later!!
Back to top
View user's profile Send private message Send e-mail Visit poster's website AIM Address
BeBopFMA



Joined: 22 Aug 2005
Posts: 3
Location: illinois

PostPosted: Tue Aug 23, 2005 12:15 pm    Post subject: Reply with quote

[img]http://final pics_url[/img]

well if u cnt see tha pic email me at my address[clik on mail icon]

but this is the early prototype for my portal!! sry t oedwardFMA for copying his clock an som images but he will recive credit for tha portal too

all for now
Back to top
View user's profile Send private message Send e-mail Visit poster's website AIM Address
EdwardFMA



Joined: 06 Jul 2005
Posts: 40

PostPosted: Wed Aug 31, 2005 2:53 am    Post subject: Reply with quote

Thanks for the Comments i have had to rename my portal to ASR/EdwardFMA Web Portal due to problem with WinPSPortal due to the problems i stopped make the unofficial versions and i'm going to release another one that looks like Windows CE.

Quote:
but this is the early prototype for my portal!! sry t oedwardFMA for copying his clock an som images but he will recive credit for tha portal too


I don't mind all my work is Open Source and can be used just give credit. ;)

BTW My website is down due to me exceeding my 2GB Bandwidth Linit it should be up by Thursday this week
_________________
EdwardFMA/IchigoKurosaki - PSP Expert
Athlon 64 - Socket 939 - 3000+
1GB 333 DDR-Ram
Geforce 6600 GT PCI-Express

Orbis PSP Development
Open-Source Development
Back to top
View user's profile Send private message
dot_blank



Joined: 28 Sep 2005
Posts: 498
Location: Brasil

PostPosted: Wed Nov 23, 2005 1:00 pm    Post subject: Reply with quote

this thread has digressed over towards
portals and what not....

i wouldnt be surprised that these two are
one in the same ...if so shame on you

anyway back to topic :P

if IrDA cannot exceed 30 cm distance
is this a problem with the above example
or is this the brick wall that is the PSP
hardware

to receive or not to receive
home building of own receiver that
converts any pronto codes into sircs
is best option but then how will your
receiver transmit to tv set top box

unless your receiver is hard wired to
said box ;)

added complexity is needed to something
so simple as me trying to control a crappy 17"
no name brand tv box 8) ...
... and not all tvs use sircs...

...what about altering your own tv hardware's
receiver ;) thus making that tv receiver hard wired no

but i digress ....back to what i need to know
is 30 cm the max or what
_________________
10011011 00101010 11010111 10001001 10111010
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PSP Development All times are GMT + 10 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group