PSNee further development

General information to do with the PlayStation 1 Hardware. Including modchips, pinouts, rare or obscure development equipment, etc.
rama3
/// PSXDEV | ELITE ///
/// PSXDEV | ELITE ///
Posts: 510
Joined: April 16th, 2017, 10:54 pm

Re: PSNee further development

Post by rama3 » July 4th, 2017, 11:54 pm

Hm, that is a very different gate connection point. I measured on a test board and the usual gate connection goes to a different pin.
Have you tested this?

damopinn
Curious PSXDEV User
Curious PSXDEV User
Posts: 16
Joined: July 3rd, 2017, 8:53 am

Re: PSNee further development

Post by damopinn » July 5th, 2017, 3:01 am

I found that pin here http://modchip.aeug.org/install/508-pu18-stealth.html.

my ps1 works OK. If you recommend a different pin I can try that too.

I found the pins from different sources. I wanted to bring it all together.

rama3
/// PSXDEV | ELITE ///
/// PSXDEV | ELITE ///
Posts: 510
Joined: April 16th, 2017, 10:54 pm

Re: PSNee further development

Post by rama3 » July 5th, 2017, 6:26 am

Point 5 here is what I most often see: http://www.fatcat.co.nz/psx/install/550 ... m3pu18.jpg

It's not a recommendation for one or the other. Just means I've got to look at this chip's configuration now :/

damopinn
Curious PSXDEV User
Curious PSXDEV User
Posts: 16
Joined: July 3rd, 2017, 8:53 am

Re: PSNee further development

Post by damopinn » July 7th, 2017, 12:35 am

I tried to port the code to my attiny85 but it didn't work.
I added a new define

#define ATTINY

#ifdef ATTINY
// board pins
#define sqck 3 // connect to PSX HC-05 SQCK pin
#define subq 4 // connect to PSX HC-05 SUBQ pin
#define data 2 // connect to point 6 in old modchip diagrams
#define gate_wfck 0 // connect to point 5 in old modchip diagrams
// MCU input / output
#define SUBQPORT PINB // Atmel MCU port for the 2 SUBQ sampling inputs
#define SQCKBIT 3 // ATmega PD6 "SQCK" Mechacon pin 26 (PU-7 and early PU-8 Mechacons: pin 41)
#define SUBQBIT 4 // ATmega PD7 "SUBQ" Mechacon pin 24 (PU-7 and early PU-8 Mechacons: pin 39)
#define GATEWFCKPORT PINB // Atmel MCU port for the gate input (used for WFCK)
#define DATAPORT PORTB // Atmel MCU port for the gate input (used for WFCK)
#define GATEWFCKBIT 0 // ATmega PB1
#define DATABIT 2 // ATmega PB0
#endif

I suppose it's not going to be that easy. I ordered a serial thing there are 2 pins left for debugging. It has a strange behaviour that the disc carries on spinning when I open the door. any ideas?

rama3
/// PSXDEV | ELITE ///
/// PSXDEV | ELITE ///
Posts: 510
Joined: April 16th, 2017, 10:54 pm

Re: PSNee further development

Post by rama3 » July 7th, 2017, 2:40 am

You need to assign all the right bits to the port. Use this cheat sheet:
https://s-media-cache-ak0.pinimg.com/or ... b7f145.png
Now look at the Pin you choose for sqck for example: 3
What bit is pin 3 on PORT B? Right, it's 4.
Confusing, I know :p

#define subq 4 << according to cheat sheet, this is ground

damopinn
Curious PSXDEV User
Curious PSXDEV User
Posts: 16
Joined: July 3rd, 2017, 8:53 am

Re: PSNee further development

Post by damopinn » July 7th, 2017, 2:45 am

I looked at the datasheet on page 64

http://www.atmel.com/images/atmel-2586- ... asheet.pdf

The bit and the pin numbers are the same.

rama3
/// PSXDEV | ELITE ///
/// PSXDEV | ELITE ///
Posts: 510
Joined: April 16th, 2017, 10:54 pm

Re: PSNee further development

Post by rama3 » July 7th, 2017, 2:46 am

The "bits" are the number after the port. Pin 1 is PB5. So you connect your wire to chip pin 1 but the port bit the code works with is 5.

Suggestion:
// board pins
#define sqck 1
#define subq 2
#define data 3
#define gate_wfck 5
// MCU input / output
#define SUBQPORT PINB
#define SQCKBIT 5
#define SUBQBIT 3
#define GATEWFCKPORT PINB
#define DATAPORT PORTB
#define GATEWFCKBIT 0
#define DATABIT 4

Make sure you comment out the old #define ARDUINO_UNO_BOARD (or smth) as well.
Also, check the compiler messages on what the sketech consumes.
ATtiny have very little RAM and my code isn't optimized for low RAM use.
With these MCU's, you can just run out of available RAM and it will silently fail working.

damopinn
Curious PSXDEV User
Curious PSXDEV User
Posts: 16
Joined: July 3rd, 2017, 8:53 am

Re: PSNee further development

Post by damopinn » July 7th, 2017, 3:47 am

i tried this blink program with led on chip pin 6 or pinb1, it works as expected,
i'm using https://github.com/SpenceKonde/ATTinyCore, i suppose that could make a diffrence
it's a coincidence that the pins and bits are the same, i know with a pro mini pin 8 = PB0
As you can see I use pin 1 to set up output and bit 1 to flash the light.

// the setup function runs once when you press reset or power the board
void setup() {
// initialize digital pin LED_BUILTIN as an output.
pinMode(1, OUTPUT);
}

// the loop function runs over and over again forever
void loop() {
bitWrite (PINB,1,1);
delay(100); // wait for a second
bitWrite(PINB,1,0);
delay(100); // wait for a second
}

rama3
/// PSXDEV | ELITE ///
/// PSXDEV | ELITE ///
Posts: 510
Joined: April 16th, 2017, 10:54 pm

Re: PSNee further development

Post by rama3 » July 7th, 2017, 4:01 am

You are writing to PINB, which is only for configuring pins set to input.
Soo.. Probably toggling the pull up resistor? I don't know :p

Use the cheat sheet / my suggestion.

rama3
/// PSXDEV | ELITE ///
/// PSXDEV | ELITE ///
Posts: 510
Joined: April 16th, 2017, 10:54 pm

Re: PSNee further development

Post by rama3 » July 7th, 2017, 4:22 am

If you want to use serial, there's a super minimal implementation described here:
http://www.ernstc.dk/arduino/tinycom.html
TinyDebugSerial can only send messages but it's all you'll need. One pin required.

Oh, even better! Apparently TinyISP lets you program the ATtiny and have debug prints enabled with the same wiring.
https://github.com/Coding-Badly/TinyISP

damopinn
Curious PSXDEV User
Curious PSXDEV User
Posts: 16
Joined: July 3rd, 2017, 8:53 am

Re: PSNee further development

Post by damopinn » July 7th, 2017, 7:50 am

I'll investigate more when my usb to serial thing arrives. At the moment i'm using an arduino as isp to program my attiny85. I changed my blink program to portb and it works the same, but when i change pinmode to pin6 the led is very dim. Any way i'll keep on investigating and learning while I wait.

rama3
/// PSXDEV | ELITE ///
/// PSXDEV | ELITE ///
Posts: 510
Joined: April 16th, 2017, 10:54 pm

Re: PSNee further development

Post by rama3 » July 7th, 2017, 8:13 am

Right.
I've put the single ATtiny45 that I have onto a breadboard and gave it a quick test.
Had no luck but at least the environment is set up and I can upload code to it.
I also think we really need some serial comms to get this working.

pre10c
Interested PSXDEV User
Interested PSXDEV User
Posts: 5
Joined: July 7th, 2017, 5:50 pm

Re: PSNee further development

Post by pre10c » July 7th, 2017, 5:54 pm

So is there any diagram for a european psone? Thanks in advance

damopinn
Curious PSXDEV User
Curious PSXDEV User
Posts: 16
Joined: July 3rd, 2017, 8:53 am

Re: PSNee further development

Post by damopinn » July 7th, 2017, 6:42 pm

https://github.com/SpenceKonde/ATTinyCore has serial TX is AIN0, RX is AIN1 when it's on the pins can't be used for anything else. it explains it about half way down the page. Are you using the same library?

damopinn
Curious PSXDEV User
Curious PSXDEV User
Posts: 16
Joined: July 3rd, 2017, 8:53 am

Re: PSNee further development

Post by damopinn » July 7th, 2017, 7:21 pm

I used my attiny85 with https://github.com/kalymos/PsNee/blob/master/PsNee.ino and it worked fine, commenting out the ntsc fix.
The pin numbers here are the not the same as the physical pins, they are the same as the PINB numbers, if you want to try it, it connects to different points on the ps1.

I was looking at the code and saw
pinMode(subq, INPUT); // PSX spi data in
pinMode(sqck, INPUT); // PSX spi clock in
Do we need to connect subq and sqck to the spi pins miso and mosi?

rama3
/// PSXDEV | ELITE ///
/// PSXDEV | ELITE ///
Posts: 510
Joined: April 16th, 2017, 10:54 pm

Re: PSNee further development

Post by rama3 » July 8th, 2017, 6:27 am

I was looking at the code and saw
pinMode(subq, INPUT); // PSX spi data in
pinMode(sqck, INPUT); // PSX spi clock in
Do we need to connect subq and sqck to the spi pins miso and mosi?
Nah, the PSX subcode format is similar to SPI. That's why I called it SPI data / clock in the comment.
It has nothing to do with the Atmel MCU SPI.

rama3
/// PSXDEV | ELITE ///
/// PSXDEV | ELITE ///
Posts: 510
Joined: April 16th, 2017, 10:54 pm

Re: PSNee further development

Post by rama3 » July 8th, 2017, 8:05 am

⸮⸮⸮``⸮⸮⸮
⸮⸮⸮``⸮⸮⸮
This is the best comms output I could produce. The pin assignment seems totally without rhyme or reason to me.
I got this from ATtiny pin 5, using "pin 3" in the IDE. No diagram matches this so yea, no clue. $1 Arduino boards work great! :p

kalymnos77
Curious PSXDEV User
Curious PSXDEV User
Posts: 23
Joined: June 6th, 2017, 10:39 pm

Re: PSNee further development

Post by kalymnos77 » July 8th, 2017, 8:11 pm

SCPH-102 PSXDEV PIN.jpg
An image for the wiring of the CSHP-102.
Image
You do not have the required permissions to view the files attached to this post.

damopinn
Curious PSXDEV User
Curious PSXDEV User
Posts: 16
Joined: July 3rd, 2017, 8:53 am

Re: PSNee further development

Post by damopinn » July 8th, 2017, 8:21 pm

rama3 wrote:⸮⸮⸮``⸮⸮⸮
⸮⸮⸮``⸮⸮⸮
This is the best comms output I could produce. The pin assignment seems totally without rhyme or reason to me.
I got this from ATtiny pin 5, using "pin 3" in the IDE. No diagram matches this so yea, no clue. $1 Arduino boards work great! :p
maybe "Serial.begin (1000000);" is too high of a value for the software serial. Did you try a lower value?

rama3
/// PSXDEV | ELITE ///
/// PSXDEV | ELITE ///
Posts: 510
Joined: April 16th, 2017, 10:54 pm

Re: PSNee further development

Post by rama3 » July 8th, 2017, 8:42 pm

Nice pic, kalymnos77.

I've tried different MCU clocks, obviously a simpler program, different serial libraries.
Now the MCU appears to be dead anyway, wrong device ID (0x0 or 0xFFFFF etc).

Adding to that, I really dislike these chips. The price is too high, the features lacking, RAM is a joke.
To get my code onto the 45, I had to remove 2 license strings and minimize letters used in my printfs.
Even then, 48 bytes remaining is just a joke.
But the real problem is price. Best I found was 11€ for a 10 pack from China.
I'd rather get 10 Arduino Mini for the same price, really.

Post Reply

Who is online

Users browsing this forum: No registered users and 3 guests