PSP 2 PSP communication example with IrDA
PSP 2 PSP communication example with IrDA
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.
Ok two thing
1. Do TV's use IRDA?
if so is this correct?
1. Do TV's use IRDA?
if so is this correct?
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?#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;
}
EdwardFMA/IchigoKurosaki - PSP Expert
Athlon 64 - Socket 939 - 3000+
1GB 333 DDR-Ram
Geforce 6600 GT PCI-Express
Orbis PSP Development
Open-Source Development
Athlon 64 - Socket 939 - 3000+
1GB 333 DDR-Ram
Geforce 6600 GT PCI-Express
Orbis PSP Development
Open-Source Development
No, use the SIRCS example for this (but works for Sony devices only)EdwardFMA wrote:Ok two thing
1. Do TV's use IRDA?
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.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?
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
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
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.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.
psportal
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!!
ps..... MAJOR PROPS to edward fma again cnt wait t osee more portals!!
-
- Posts: 2
- Joined: Tue Aug 23, 2005 10:04 am
Re: psportal
Copy and mess around with the source (from another portal) in Microsoft Word would probably work too.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!!
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!!
thts all tha info i got for now more later!!
[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
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
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.
BTW My website is down due to me exceeding my 2GB Bandwidth Linit it should be up by Thursday this week
I don't mind all my work is Open Source and can be used just give credit. ;)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
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
Athlon 64 - Socket 939 - 3000+
1GB 333 DDR-Ram
Geforce 6600 GT PCI-Express
Orbis PSP Development
Open-Source Development
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
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