![]() |
| Forums | Gaming News | Videos | Downloads | Today's Posts | Mark Forums Read | Chat | FAQ | Members List | Contact |
| ||||||
This is a discussion on PSP OBDII Software for Cars within the PSP Development Forum forums, part of the PSP Development, Hacks, and Homebrew category; I'm interested in writing OBDII software for the PSP to pull and display date from my car. I know I ...
![]() |
|
|
LinkBack | Thread Tools |
|
|
#1 |
![]() |
I'm interested in writing OBDII software for the PSP to pull and display date from my car. I know I would need to build a serial adapter for my PSP. The only programming language I have time to write it in at the moment would be LUA. Would a program like this be possible to write? Or does LUA have too many limitations to read and interpret data from the PSP's serial port?
|
|
|
|
|
|
#2 | |
![]() Enter Custom Title
|
Thats an idea..i know some company made a gameboy advance program called Delta Dash or something that has monitors on it for the Subaru WRX/STI and maybe others. (I have a WRX modded to stage 2)
what car are you planning on monitoring?
__________________
Quote:
|
|
|
|
|
|
|
#4 | |
![]() Enter Custom Title
|
Just rolled on this link from my friend i showed.
http://forums.qj.net/f-psp-speculati...car-27595.html
__________________
Quote:
|
|
|
|
|
|
|
#10 | |
![]() Enter Custom Title
|
I saw a skyline once in real life...very nice
__________________
Quote:
|
|
|
|
|
|
|
#14 |
|
Well I am no programer but it sounds possible to do it, I looked herehttp://www.lua.org/faq.html and it said that it was similar to C++. Some of the other OBD diagnostic softwares are done in JAVA or C, C++ and the like it really makes me thing that it should work. Of course you will have to deal with the hardware side of it. Taking the J type innterface and changing it to work with thePSP may be the biggest hurdle. I will look for some of the like I have for PC programs and interfaces. Some include free plans for the hardware.
|
|
|
|
|
|
|
#16 |
|
I need to check and see if the 07 Mustang uses PWM, ISO, or VPW to communicate. Of course you can just make a generic box or just buy one.
-= Double Post =- here is one place in the UK for you, http://www.cardiagnostic.co.uk/software.htm Last edited by lanelander; 11-08-2007 at 01:25 PM.. Reason: Automerged Doublepost |
|
|
|
|
|
|
#22 | ||
![]() |
Quote:
Quote:
__________________
[fieldset="My Releases"][LIST][*][URL="http://forums.qj.net/showthread.php?t=105194"]warPSP: WarXing Suite[/URL][*][URL="http://forums.qj.net/showthread.php?t=121266"]skyPSP: Webcam Suite[/URL][/LIST][/fieldset] |
||
|
|
|
|
|
#23 |
![]() ![]() ...in a dream...
|
I've yet to see someone say you can do definitely do this in Lua, so I'll say it. You can definitely do this in Lua. (by this, i mean write to/read from the serial port)
Check the LUa samples that come with Lua player, demonstrates SIO port usage. It's just as easy in C as in Lua, but Lua much faster for the on-the-fly debugging and portability. Best of luck
__________________
...you'll never know what it's like... spending your whole life in a dream...
Launch a Kitten out of a Cannon and win real cash! Checkout my newly updated site for all my projects (Kitten Cannon, BOXHEAD, Light Cycle 3D) |
|
|
|
|
|
#24 |
![]() ![]() Bush Programmer
|
No it isn't possible in LUA, it should be, but unless it has been fixed the serial port has never worked correctly
since Shine stopped working on it. If you try to recieve a string of characters from an external device you will only end up capturing a small percentage of the bytes that were transmitted. The keyboard example works because in computer terms, it takes a very long time between Human key presses. That is why I needed to use a seperate microcontroller for my first GPS project. The microcontroller as a go between retransmitted to the PSP the same thing it recieved from the GPS, only a lot slower, and with more time between transmitted bytes. Otherwise it couldn't have been done with PSP LUAplayer. |
|
|
|
|
|
#25 |
![]() |
Art, and SG57, thank you for answering my question.
Well, if it isn't possible in Lua, I'm probably going to abandon the whole idea for now. After seeing some sample code for simple PSP programs, I think it would take way too long for me to learn how to program for the PSP before anything productive started happening. At least I didn't start spending money on cables for this yet. |
|
|
|
|
|
#26 |
![]() ![]() Bush Programmer
|
It really is any more difficult in C.
I've written virtually the same program in both. I don't know how you'd look at the LUA sample and understand it, and then look at the C sample and not understand it. I think LUA doesn't make use of any hardware FIFO buffer, and just waits for the next byte it sees when serin is called. Everything else about your idea is valid. I have used the PSP to recieve data from the serial line that would be connected to my car's trip computer (if it had one fitted). |
|
|
|
|
|
#28 |
![]() |
__________________
[fieldset="My Releases"][LIST][*][URL="http://forums.qj.net/showthread.php?t=105194"]warPSP: WarXing Suite[/URL][*][URL="http://forums.qj.net/showthread.php?t=121266"]skyPSP: Webcam Suite[/URL][/LIST][/fieldset] |
|
|
|
|
|
#29 |
![]() ![]() Bush Programmer
|
Is the C serial sample really harder to understand?
Although the LUA example is a bit more than just serial recieve in this case, the serial stuff looks about the same to me, and if anything, the LUA example is more complicated, and harder to modify. You already know what you want to do. YOu could skip the "Hello World", and go straight to the serial sample which will probably already do what you want when you match the baud rate, and make the correct cable. There's little programming involved until you want to do something with the data you receive. Code:
/*
* PSP Software Development Kit - http://www.pspdev.org
* -----------------------------------------------------------------------
* Licensed under the BSD license, see LICENSE in PSPSDK root for details.
*
* main.c - Basic sample to demonstrate the remote port sio.
*
* Copyright (c) 2005 James Forshaw <tyranid@gmail.com>
*
* $Id: main.c 1095 2005-09-27 21:02:16Z jim $
*/
#include <pspkernel.h>
#include <pspdebug.h>
#include <pspdisplay.h>
#include <pspsdk.h>
#include <pspctrl.h>
#include <stdio.h>
#include <string.h>
PSP_MODULE_INFO("REMOTE", 0x1000, 1, 1);
/* Define the main thread's attribute value (optional) */
PSP_MAIN_THREAD_ATTR(0);
int main(void)
{
pspDebugScreenInit();
sceCtrlSetSamplingCycle(0);
sceCtrlSetSamplingMode(PSP_CTRL_MODE_ANALOG);
/* Initialise SIO and install a kprintf handler */
pspDebugSioInit();
pspDebugSioInstallKprintf();
/* Install a stdout handler */
pspDebugInstallStdoutHandler(pspDebugSioPutData);
Kprintf("Hi from %s!\n", "Kprintf");
printf("Also hi from stdio\r\n");
pspDebugScreenPrintf("Press X to exit, tap away on your terminal to echo\n");
sceDisplayWaitVblankStart();
while(1)
{
SceCtrlData pad;
int ch;
sceCtrlReadBufferPositive(&pad, 1);
if(pad.Buttons & PSP_CTRL_CROSS)
{
break;
}
ch = pspDebugSioGetchar();
if(ch >= 0)
{
pspDebugScreenPrintf("Received %d\n", ch);
if(ch == '\r')
{
pspDebugSioPutchar('\r');
pspDebugSioPutchar('\n');
}
else
{
pspDebugSioPutchar(ch);
}
}
sceDisplayWaitVblankStart();
}
sceKernelExitGame();
return 0;
}
Code:
function scroll(image, dx, dy)
new = Image.createEmpty(image:width(), image:height())
new:blit(dx, dy, image)
return new
end
function printTerminal(text)
for i = 1, string.len(text) do
char = string.sub(text, i, i)
if char == "\n" then
terminalY = terminalY + 1
terminalX = 0
else
terminal:print(terminalX * 8, terminalY * 8, char, green)
terminalX = terminalX + 1
if terminalX >= 60 then
terminalX = 0
terminalY = terminalY + 1
end
end
if terminalY >= 34 then
terminalY = 33
terminal = scroll(terminal, 0, -8)
end
end
end
function normalizeLinefeed(text)
-- terminal programs like Hyperterminal sends just a \r for return key, convert it
result = ""
for i = 1, string.len(text) do
char = string.sub(text, i, i)
if char == "\r" then char = "\n" end
result = result .. char
end
return result
end
printTerminal("initializing SIO...\n");
System.sioInit(2400)
infoString = "starting echo...\n"
printTerminal(infoString);
System.sioWrite(infoString)
ping = 0
while true do
text = normalizeLinefeed(System.sioRead())
ping = ping + 1
if ping == 60 then
ping = 0
text = text .. "."
end
printTerminal(text)
System.sioWrite(text)
screen:blit(0, 0, terminal, 0, 0, terminal:width(), terminal:height(), false)
screen.waitVblankStart()
screen:flip()
if Controls.read():start() then break end
end
|
|
|
|
|
|
#30 |
|
Ok Sorry I was gone so long. I found that page I was lookng for. This site not only shows hardware, software but also information on the handshake that happens in communication. Let me know if this helps.
![]() http://obddiagnostics.com/ |
|
|
|
|
![]() |
| Tags |
| cars , obdii , psp , software |
| Thread Tools | |
|
|