Serial Port on PSP checksum calculations

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

Moderators: cheriff, TyRaNiD

Post Reply
d4rkn1c0n
Posts: 2
Joined: Thu Sep 21, 2006 11:54 am

Serial Port on PSP checksum calculations

Post by d4rkn1c0n »

Well I am looking into writing software to communicate with the psp through the serial port. I need to know how the checksum for the rs232 transmision is calculated. I have found some stuff on it but it is for a device called a cybiko and they use 2 different checksums depending on the type of data being sent. Here is the link.http://www.devrs.com/cybiko/files/xferinfo.txt The checksum calculations are at the bottom. Thanks for any help.
jimparis
Posts: 1145
Joined: Fri Jun 10, 2005 4:21 am
Location: Boston

Post by jimparis »

What checksum?
If you're talking about emulating the PSP remote, see http://forums.ps2dev.org/viewtopic.php?t=986,
If you're just sending your own data, use whatever checksum you'd like, or just don't use one at all. There is no standard checksum or data format for RS232.
d4rkn1c0n
Posts: 2
Joined: Thu Sep 21, 2006 11:54 am

Post by d4rkn1c0n »

But it said on this sitehttp://mc.pp.se/psp/phones.xhtml that the psp command packet looks like this.
The PSP communicates with the microcontroller inside the remote control using RS232 serial communication (although the voltages are different of course, 0V and +2.5V) using 8N1 framing at 4800bps. The protocol consists of command packages which can be send by either the PSP or the remote control. A package is exchanged as follows:

Sender Receiver Explanation
0xF0 Request to transmit
0xF8 Clearance to transmit
0xFD Packet starts
cmd Command code + phase
params ... Zero or more bytes of parameter data
checksum XOR of the cmd and params bytes
0xFE Packet ends
0xFA/0xFB Packet received correctly
it said xor of the cmd and params bytes. is it a checksum of one byte and it start initially with 0x00 or initially with the first byte of cmd or what?
jimparis
Posts: 1145
Joined: Fri Jun 10, 2005 4:21 am
Location: Boston

Post by jimparis »

d4rkn1c0n wrote:But it said on this sitehttp://mc.pp.se/psp/phones.xhtml that the psp command packet looks like this.
The PSP communicates with the microcontroller inside the remote control using RS232 serial communication (although the voltages are different of course, 0V and +2.5V) using 8N1 framing at 4800bps. The protocol consists of command packages which can be send by either the PSP or the remote control. A package is exchanged as follows:

Sender Receiver Explanation
0xF0 Request to transmit
0xF8 Clearance to transmit
0xFD Packet starts
cmd Command code + phase
params ... Zero or more bytes of parameter data
checksum XOR of the cmd and params bytes
0xFE Packet ends
0xFA/0xFB Packet received correctly
it said xor of the cmd and params bytes. is it a checksum of one byte and it start initially with 0x00 or initially with the first byte of cmd or what?
Go back and read what I said:
jimparis wrote:If you're talking about emulating the PSP remote, see http://forums.ps2dev.org/viewtopic.php?t=986
That thread answers your question:
mc wrote:After the command comes zero or more data bytes, depending on the command, and finaly a checksum, which is XOR of the command byte and all data bytes.
Post Reply