On my PU-22, i have also a delay if i inject only twice, i now changed my code to 3 injections(only the correct region) and that gets rid of the delay for me. Also played around with the hysteresis setting when injecting, but (injection_threshold-3) seems to be ideal.superg wrote: ↑November 7th, 2018, 3:30 amJust my observation, I experience a delay in boot on my test PAL PSOne if I do inject_SCEX('E') just twice. When increased back to 6 times (the default in kalymos master branch) it's fast again. I think my test PU-18 board was fast regardless of this setting (2 or 6).
For anybody who's interested in my Tiny25 trials:
Installed the Attiny25 today. Also added an external 4.19MHz clock that i found on IC304, Pin 14 for more precise time keeping without crystal oscillator. The voltage levels are 3.8V peak-to-peak but they seem to work nicely as a clock souce with a ~3.5V supply(i replaced all electrolytic caps in my power supply). Also i'm now using brown out detection(not really neccesary), a watchdog for emergency reset(not really neccesary) and Timer0 for some of the timing. Timer0 was primarily to make the code faster because i "only" have about 4MHz left. I also had to move the packing of the individual SUBQ bits into bytes into the small gap between the bytes(at the expense of some memory) because of the slower clock.
This is my SUBQ sniffing, adjusted for the lower clock speed:
Code: Select all
start:
wdt_reset(); //Reset Watchdog, to show that we are still alive
scpos = 0; //reset SUBQ packet position
//Capture bytes without larger gap in between ==> complete SUBQ transmission
while(scpos < NUMBER_OF_BYTES_IN_PACKET){
for (uint8_t bitpos = 0; bitpos < 8; bitpos++) {
TCNT0 = 0;
while (READ(SQCK)) { //Wait for clock to go low
//Timeout resets capture during bootup and in between packages
if (TCNT0 >= MICROSECONDS_TO_TIMER_TICKS(US_SUBQ_TIMEOUT)){
goto start;
}
}
while (!READ(SQCK)); //Wait for clock to go high
bitbuf[bitpos] = READ(SUBQ);
}
//8 bits read, now combining them into bytes
//This is done to have the bits read as fast as possible and have the copying happen between bytes
scbuf[scpos] = bitbuf[0];
for (uint8_t bitpos = 1; bitpos < 8; bitpos++) {
scbuf[scpos] |= (bitbuf[bitpos] << bitpos);
}
scpos++;
}
I'd be glad if anybody finds bugs or can suggest improvements!
https://github.com/danielheinrich/PsNee ... ter/main.c