low level sio

Discuss the development of new homebrew software, tools and libraries.

Moderators: cheriff, TyRaNiD

Post Reply
phobox
Posts: 127
Joined: Mon Mar 24, 2008 6:22 pm

low level sio

Post by phobox »

i was wondering if it it possible to have a low level control on every pin of the remote control port.
i actually need the control only on one pin and i need to set or get a digital value (0=0v; 1=+2.5v, or another voltage).
i'm gonna create a simple hardware and i think the best way to communicate with the psp, since the simplicity of the communication portocol (plain binary), was this one.
is it possible?
how is it possible, software side speaking, to read and set these values?
Ciao! from Italy
J.F.
Posts: 2906
Joined: Sun Feb 22, 2004 11:41 am

Post by J.F. »

The only lines you can control on the serial port are the serial transmit and receive data lines. Search for threads on serial, and look at the serial code in pikey for examples of sending and receiving serial data.
User avatar
Torch
Posts: 825
Joined: Wed May 28, 2008 2:50 am

Post by Torch »

You would probably have much better speed if your hardware had a serial IO as well.
User avatar
jean
Posts: 489
Joined: Sat Jan 05, 2008 2:44 am

Post by jean »

don't know if this helps, but you could use one of the audio-out channels...
User avatar
jean
Posts: 489
Joined: Sat Jan 05, 2008 2:44 am

Post by jean »

don't know if this helps, but you could use one of the audio-out channels...
TyRaNiD
Posts: 907
Joined: Sun Jan 18, 2004 12:23 am

Post by TyRaNiD »

You could always turn on and off the power line (0 -> 2.5V if I recall, might be lower). But I don't think that would be amazingly sensible :P
J.F.
Posts: 2906
Joined: Sun Feb 22, 2004 11:41 am

Post by J.F. »

If it had its own power supply, that might be helpful.
TyRaNiD
Posts: 907
Joined: Sun Jan 18, 2004 12:23 am

Post by TyRaNiD »

Well the issue is being a power pin it probably has a long stabilisation time due to the way it will be wired to sink into a resistive load, not especially useful from the point of view of signalling. Plus the inbuilt function has almost a 3 second power up time, though not sure if that is due to the function or inherent hardware limitations.

Perhaps you would be better off putting in an IR detector and using the IR port on the old PSPs which can be directly controlled :)
phobox
Posts: 127
Joined: Mon Mar 24, 2008 6:22 pm

Post by phobox »

thanks very much guys!
i think that the power pin solution isn't good at all for my matter: i read of about 3 secs of time to change state: not good, my signal changes state in about 50 microseconds, so....
and anyway this(and the audio out one) is a way to send data, no to receve.

the ir port solution sounds good, but is it that fast?

so i think the solution would be to implement the serial protocol, but i don't know much about it.... i can see that the sdk gives me a function:
void pspDebugSioPutchar(int ch);

and the sister one:
int pspDebugSioGetchar(void);

but, a char is made of 8 bits, and what i need to get is the time elapsed between the changes of state, like this:

an impulse consist in a digital 0 for a little time and then digital 1.

-first impulse
-pause of (let's say) 1 sec
-second impulse
-pause of 2 secs
-3rd impulse
-pause of 2 secs
-4th impulse
-pause of 1 sec
-5th impulse
-pause of 2 secs
6th impulse

a pause of 1 sec means a digital 1 and a pause of 2 secs means a digital 0.

this sends 5 bits (the first impulse is the start one)
the second impulse since the time elapsed from the previous impulse is 1 sec corresponds to a digital 1.
with this in mind:
3rd impulse: 0
4th impulse: 0
5th impulse: 1
6th impulse: 0

so the data sent is: 10010

how to decode this via software, i do not mean the algorythm, but i need the communication port and the low level functions.


i hope it was clear!
thanks
Ciao! from Italy
Art
Posts: 642
Joined: Wed Nov 09, 2005 8:01 am

Post by Art »

and anyway this(and the audio out one) is a way to send data, no to receve.
No, but you can use the audio input to receive much quicker than you're talking about.
I'd look at the original recording example.
If not actually, then potentially.
J.F.
Posts: 2906
Joined: Sun Feb 22, 2004 11:41 am

Post by J.F. »

The serial is "standard" asynchronous serial in an 8N1 format (8 data bit, no parity, and 1 stop bit). This is the old standard used by things like RS232. If I remember correctly, the default baud rate is 2400, but it can be changed. There are threads on it here, so use the search for them. If you really need 50 usec response time, I don't think serial will do it for you. You might have to go with the audio lines. Your other choice is to put a USB host device on your project and use the PSP USB.
Phantom8
Posts: 30
Joined: Fri Jun 17, 2005 10:17 am

Post by Phantom8 »

Not sure if the PSP serial port has any one of the DTR, DSR, CD, CTS or RTS. If so, it will very easy to just control these pins.
J.F.
Posts: 2906
Joined: Sun Feb 22, 2004 11:41 am

Post by J.F. »

No, it doesn't. That's why I said the SERIAL was the same, not the control lines.
Post Reply