Serial connection between PSP and Picaxe Microcontroller

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

Moderators: cheriff, TyRaNiD

Post Reply
Zibro
Posts: 6
Joined: Sat Nov 03, 2007 4:41 am

Serial connection between PSP and Picaxe Microcontroller

Post by Zibro »

Hi,
I try to connect my PSP with a Picaxe (28x1) over the Serial Port of the PSP.
The connection to the PSP is ok, so i can send bytes from the microcontroller to the PSP without any problems.
But when i try to send something back from the psp to the microcontroller nothing happens although all wires are connected.
So here are my Question.
1) Do you have any idea what i could have made wrong ?
2) Is pspDebugSioPutchar("Hello"); this the right code to send something
from the psp?
3) Is it at all possible to send something over the PSP Serial Port or can it only be used to receive something ?

I built up my circuit after the information of this side. http://mc.pp.se/psp/phones.xhtml
Thank you for your help and sorry for my bad english :)




[/img]
jimparis
Posts: 1145
Joined: Fri Jun 10, 2005 4:21 am
Location: Boston

Post by jimparis »

What voltage are you running the microcontroller at?
Is this a fat or slim PSP?
Zibro
Posts: 6
Joined: Sat Nov 03, 2007 4:41 am

Post by Zibro »

It is the fat psp and the microcontroller runs at 3.6 V
jimparis
Posts: 1145
Joined: Fri Jun 10, 2005 4:21 am
Location: Boston

Post by jimparis »

The PICAXE-28X1 has two serial inputs, "serial in" (pin 6) and "ser rx" (pin 18). The chip is actually a PIC16F886, and if we check the datasheet for that we find that pin 6 is a TTL input, and pin 18 is a Schmitt trigger. For VDD=3.6V operation, the minimum input voltage for a logic high (VIH) is 1.7V for TTL and 2.88V for ST. The PSP runs on 2.5V logic, so it definitely won't be able to drive the ST input ("ser rx"), and it might or might not work with the TTL input ("serial in"). You should do proper level conversion between the two, or run the PIC also at 2.5V (especially as you don't want to be applying anything higher than 2.5V on the PSP)

The slim is even trickier as I believe it's 1.8V logic at the SIO port.
Zibro
Posts: 6
Joined: Sat Nov 03, 2007 4:41 am

Post by Zibro »

Hmmm but i have not connected the PSP over the 2 mentioned pins .
The Picaxe can receive on all Input Pins with the command "serin".
So i used the Input 3 (Pin 14) to receive the date of the psp.
But i think that what you said will also apply to this pin (not the same voltage between psp and microcontroller).
So how can i do a proper level conversation between the microcontroller and the psp ? (I don´t have any idea ^^)
Really thx for your help so far ... and i will try to run the Pic with 2.5V.
Zibro
Posts: 6
Joined: Sat Nov 03, 2007 4:41 am

Post by Zibro »

When i try to run the Pic under 2.5V it runs but neither the psp nor the pic receives anything.
And i also tried to give the psp 3.6V (ok i know its hard but the psp is still alive :) ) over the serial port and then the psp receives but the Pic don´t receives something.
Or do i have any mistakes in the circuit ?
Is it possible that you "draw" me a circuit how it "should" work ?

Thanks ^^
jimparis
Posts: 1145
Joined: Fri Jun 10, 2005 4:21 am
Location: Boston

Post by jimparis »

Zibro wrote:Hmmm but i have not connected the PSP over the 2 mentioned pins .
The Picaxe can receive on all Input Pins with the command "serin".
So i used the Input 3 (Pin 14) to receive the date of the psp.
But i think that what you said will also apply to this pin (not the same voltage between psp and microcontroller).
When i try to run the Pic under 2.5V it runs but neither the psp nor the pic receives anything.
Pin 14 is also a Schmitt trigger, so even if you run the PIC at 2.5V it will still require 2.0V to switch, and I don't know what the PSP's high output level is.

If you run the PIC at 2.5V, the guaranteed output-high level is 1.8V and the input-high requirement is 2.0V, so even another PIC wouldn't be able to communicate on those lines! (interesting)

The right chip for level conversion would be something like the TI SN74ALVC164245 (there are probably smaller/simpler versions out there, that's just one I've used before)

An easier solution would be to just try using a TTL input instead of a ST input on the PIC: pins 2-10 and 21-28 should all be TTL. Pins 11-18 are ST. Depending on the PSP's output level, I think this might work in both directions if the PIC is running at 3.6V.

To prevent overvoltage to the PSP, you might want to add a resistor between SEROUT & PSP, but it might not be necessary.
Art
Posts: 642
Joined: Wed Nov 09, 2005 8:01 am

Post by Art »

sounds like one transistor will solve all your problems,
and use the pic's own supply voltage to input to it's serial line.
Seems odd to have to buy one when you are already using millions of them, but, hey,. you want it to work...
If not actually, then potentially.
Zibro
Posts: 6
Joined: Sat Nov 03, 2007 4:41 am

Post by Zibro »

Good idea with the transistor. Because the problem with the pins 1 to 10 and 21 to 28 is that they can´t be used with the command serin ... the pins 21 to 28 are outputs and the others are inputs but portA and so they only can be used as on/off trigger or analogue.
But i will try to make it working with the transistor.

Thanks so far ^^
But now it is 0:00 o´clock here and i will try this tomorrow.
THX
Zibro
Posts: 6
Joined: Sat Nov 03, 2007 4:41 am

Post by Zibro »

Ok i tried it with a NPN Transistor but it didn´t work.
So I measured the Voltage of the PSP Serial Output (Pin 3) and found out that it seems to be negative.
Therefore i think i have to use a PNP Transistor.
I hope it will finally do :)
Post Reply