Psp and electronics project, need help
Psp and electronics project, need help
Hello. Im working on a little project for my car that involves my psp using lua as a computer. I need to be able to have serial in and out which im told lua can do.
Anyway i need a 5v analog to digital converter and a 0-5v digital to analog converter. Im pretty new with the electronics part so im not sure what kind of converters i would need. Im using a MAP sensor that has a 5v output which i would like to display on the psp. Also i have a pressure solenoid which takes a 0-5v input which i would like to send from the psp. Any help on any of this is very appreciated.
Anyway i need a 5v analog to digital converter and a 0-5v digital to analog converter. Im pretty new with the electronics part so im not sure what kind of converters i would need. Im using a MAP sensor that has a 5v output which i would like to display on the psp. Also i have a pressure solenoid which takes a 0-5v input which i would like to send from the psp. Any help on any of this is very appreciated.
this thread seems to have all the answers:
http://forums.ps2dev.org/viewtopic.php? ... al+dummies
Of course you can "ask" the search function directly next time ;-)
http://forums.ps2dev.org/viewtopic.php? ... al+dummies
Of course you can "ask" the search function directly next time ;-)
I'd forget about LUA if you intend to use the serial port.
It works until you expect to recieve a continuous stream of data
where it chops in and out, and you miss many characters.
For the rest, it sounds like you need to take up programming microcontrollers as well.
One chip could do the rest, and even buffer the serial line so LUA might handle short strings.
The only extra hardware after getting the microcontroller running would be a darlington transistor
to switch a high current 5 Volt supply for the solenoid.
Art.
It works until you expect to recieve a continuous stream of data
where it chops in and out, and you miss many characters.
For the rest, it sounds like you need to take up programming microcontrollers as well.
One chip could do the rest, and even buffer the serial line so LUA might handle short strings.
The only extra hardware after getting the microcontroller running would be a darlington transistor
to switch a high current 5 Volt supply for the solenoid.
Art.
If not actually, then potentially.
There is a micro controller that is used with the Megasquirt (www.megamanual.com) that is a 68HC908 processor. It has the ADC's built in and comes pre programmed. The hard part would be then controlling that via psp's serial port. Also what exactly is used to control voltages digitally. The solenoid uses 0-5 volts to open and close a valve. How can i control that via psp?
Talking to the microcontroller isn't hard with the PSP, but you might
need the RS232 converter for that.
There are ways to do that digitally, by connecting IO ports through different
value resistors to a common point, and by toggling combinations of IO
outputs through the resistors, you can make what's called a resistor ladder.
Again, depending on the application, pulse width modulation might be the way to go,
and again, achieved digitally.
WHen I use analogue ports, it's of rin, not out.
You could use a digital potentiometer which is another cheap chip which
works like a normal pot, but it's controlled with commands from the microcontroller.
need the RS232 converter for that.
There are ways to do that digitally, by connecting IO ports through different
value resistors to a common point, and by toggling combinations of IO
outputs through the resistors, you can make what's called a resistor ladder.
Again, depending on the application, pulse width modulation might be the way to go,
and again, achieved digitally.
WHen I use analogue ports, it's of rin, not out.
You could use a digital potentiometer which is another cheap chip which
works like a normal pot, but it's controlled with commands from the microcontroller.
If not actually, then potentially.
If i can get an ADC that is compatible with the psp serial port i might not need that micro controller at all. I only need one in and one out at a time technically. The map sensor puts out a voltage from 0-5 which goes to the psp and then based on that the psp puts out a voltage from 0-5 to the solenoid. It doesnt really sound that complicated. I might be complicating it or i may be oversimplifying it. I guess i will find out. Which way do you guys recommend?
EDIT: i found these and im hoping they will work even if its in conjunction with something else
A/D http://www.austriamicrosystems.com/03pr ... asheet.pdf
D/C
http://www.austriamicrosystems.com/03pr ... asheet.pdf
EDIT: i found these and im hoping they will work even if its in conjunction with something else
A/D http://www.austriamicrosystems.com/03pr ... asheet.pdf
D/C
http://www.austriamicrosystems.com/03pr ... asheet.pdf
You can probably turn on the USB port and get 5 Volts from the
contacts that power the chotto cam.
but I wouldn't drive a solenoid with it without a darlington transistor
and external power.
It would be possible to have the PSP turn on external devices with a timer
that way. I will be testing that method shortly, but ideally want two outputs,
so hopefully something sneaky can be done with the data line of the USB port,
or a seperate IR receiver will work.
For the PSP, recieving and interpreting an analogue input is a bit complicated
because the microphone is the only analogue input you can access without
opening the unit.
contacts that power the chotto cam.
but I wouldn't drive a solenoid with it without a darlington transistor
and external power.
It would be possible to have the PSP turn on external devices with a timer
that way. I will be testing that method shortly, but ideally want two outputs,
so hopefully something sneaky can be done with the data line of the USB port,
or a seperate IR receiver will work.
For the PSP, recieving and interpreting an analogue input is a bit complicated
because the microphone is the only analogue input you can access without
opening the unit.
If not actually, then potentially.
If you're talking to me I recommend using LUA as a stepping stone only.
I don't recommend using LUA for any program that needs to use the serial port.
In that special case PSP LUAplayer is a particularly bad choice.
I haven't used it for two years or so, but I don't think anyone has addressed the serial port issue yet.
You can't do anything to slow down the transmission from a device you're
not writing the software for, like your car's trip computer, or ECU or whatever
you want a serial communication from.
I don't recommend using LUA for any program that needs to use the serial port.
In that special case PSP LUAplayer is a particularly bad choice.
I haven't used it for two years or so, but I don't think anyone has addressed the serial port issue yet.
You can't do anything to slow down the transmission from a device you're
not writing the software for, like your car's trip computer, or ECU or whatever
you want a serial communication from.
If not actually, then potentially.
What exactly is the problem with lua and the serial port? I wont be reading data from an ECU or anything else. The data would be coming from the ADC then it would be sending data back out to the DAC.
Edit: Do you mean like changing the baud rate? Im not sure thats the same thing but im going to read up on it and find out
Edit: Do you mean like changing the baud rate? Im not sure thats the same thing but im going to read up on it and find out
Nothing to do with the baud rate, it handles the speed it is supposed to work at for each byte,
but to get it to read in any strings there needs to be a rather large gap
in time between every byte being sent.
Slowing the overall communication down.
The amount of information you lose over a normal communication with a
serial device like a PC sending a text file is greater than the amount received.
If the ADC you are talking about is a chip that outputs serially,
then even in a message of two bytes, one would go missing a lot.
You can test the LUA serial terminal by trying to send text you copy/pasted
into Windows Hyperterminal.
The LUA serial terminal program works a littl ebetter if you remove the code that prints a dot every second.
but to get it to read in any strings there needs to be a rather large gap
in time between every byte being sent.
Slowing the overall communication down.
The amount of information you lose over a normal communication with a
serial device like a PC sending a text file is greater than the amount received.
If the ADC you are talking about is a chip that outputs serially,
then even in a message of two bytes, one would go missing a lot.
You can test the LUA serial terminal by trying to send text you copy/pasted
into Windows Hyperterminal.
The LUA serial terminal program works a littl ebetter if you remove the code that prints a dot every second.
If not actually, then potentially.
I guess ill try lua at first just because its easier. The data im sending isnt do or die. As long as it doesnt lose more than like 20% of the data id probably stillbe alright. I wont really know until im at that point. I tried to set up the pspsdk but it keeps saying make is an unrecognizable command so i have to look into that a little more.
You have to watch the voltage that you send to the PSP,
the ADC is probably a 5 Volt signal, where the PSP expects to see 2.5 Volts.
A series wired resistor will take care of that.
See Deniska's GPS docs for the value everyone settled on,
or start with a high value that prevents any communication at all,
and work your way to a lower resistor value that works.
the ADC is probably a 5 Volt signal, where the PSP expects to see 2.5 Volts.
A series wired resistor will take care of that.
See Deniska's GPS docs for the value everyone settled on,
or start with a high value that prevents any communication at all,
and work your way to a lower resistor value that works.
If not actually, then potentially.
AC signals flow along the surface of conductors, so there's no reason for a solid wire. Using strands of smaller wires gives you more surface area for a better signal, and better flexibility. Since you don't need a solid wire, but lots of smaller, thinner wires wound together, string is often used as a core to make the overall wire stronger despite using thin wires.Squall333 wrote:Ok so i have everything i need i took apart the headphones and the wires look wierd. Its like copper wound around string. Whats up with that?
Thank you for that information. How does the power and ground not short each other?J.F. wrote: AC signals flow along the surface of conductors, so there's no reason for a solid wire. Using strands of smaller wires gives you more surface area for a better signal, and better flexibility. Since you don't need a solid wire, but lots of smaller, thinner wires wound together, string is often used as a core to make the overall wire stronger despite using thin wires.
Assuming the wire carries two (or more) separate signal paths, they'll either have another insulator between the two (or more) levels of braiding around the string core, or the individual wire strands will have an insulating coat. An insulator separating the inner braid from the outer braid seems to be more common in my experience.Squall333 wrote:Thank you for that information. How does the power and ground not short each other?J.F. wrote: AC signals flow along the surface of conductors, so there's no reason for a solid wire. Using strands of smaller wires gives you more surface area for a better signal, and better flexibility. Since you don't need a solid wire, but lots of smaller, thinner wires wound together, string is often used as a core to make the overall wire stronger despite using thin wires.