Why 10ms delay is huge?
If it needs a week then it takes a week.
Reading subroutine starts from line 440 and its loop from 452.
461-464 is putting the address out.
There you have the first 4tcy delay.
466 changes the direction of a port, I guess.
467 has the next delay.
484 then is the actual read.
From pgm_common.c
uint8_t pgm_read_data(void)
{
#ifdef _M8OD
return (uint8_t)cpld_read(PORTC);
#endif /* _M8OD */
#ifdef _MDUINO
return DATA_PIN;
#endif /* _MDUINO */
}
Indented lines are actual read commands.
One for _M8OD and other for _MDUINO.
So despite all your pre read delays you're still actually reading like zap, it's done.
You should replace that 484 line with your own reading procedure.
Address is there and is not changing so you can read as many times as you like.
Maybe you should read 100 times and analyze what you get.
You can replace that 484 line with how ever more stuff also, so you can put there read, delay, read, delay and so on.
Maybe you should modify the board and read using analog pin.
If you have only one analog pin then probably easiest is to read one bit thru the chip and then manually connect it to the next bit.
Though it's probably not helping with weak output.
uint8_t pgm_read_data(void)
{
while(1)
{
_delay_us(20);
uint8_t d0 = DATA_PIN;
_delay_us(20);
uint8_t d1 = DATA_PIN;
_delay_us(20);
uint8_t d2 = DATA_PIN;
if (d0==d1) return d0;
if (d0==d2) return d0;
if (d1==d2) return d1;
}
}
if ((d0==d1) && (d0==d2)) return d0;
if you want all 3 samples to match.
uint8_t pgm_read_data(void)
{
uint8_t result=0xFF, i;
for(i=0; i<5; i++) //5 is number of samples, adjust if necessary
{
result &= DATA_PIN;
_delay_us(20); //can be reduced/removed at all and number of samples increased instead
}
return result;
}
I suggest checking voltages on the pins with oscilloscope. There are failure modes when some pins may not pull exactly to the power rail. So input voltage threshold in reading device can make the difference. EPROM reading threshold is not relevant here since it's a mask ROM.
The problem is that since ground/common is floating on both the laptop and PSU, and my DSO is earth ref., I get sinusoidal waveforms mixed in.
I don’t dare to connect the probe ground/earth in the circuit.
I can see the activity, but meassurements are difficult.
Norwegians and their floating mains.
Measure something stable with the other channel and invert it, then sum both.
The chip getting "ouch hot" is a very bad sign, that should never be happening. Do you perhaps get the polarity wrong and connect +5V from your PSU to Vss instead of Vcc? Did you connect the - output from the PSU to the +5V rail on the board instead of ground, resulting in +10V across the IC? I agree that a second opinion here would be useful, or at least a schematic showing visually how you have tried to hook it up each time.
What are you doing with the PROG pin? Looking at an old datasheet for the Intel 8048/9 series there is a curious note under the programing and verify timing waveforms for the 8048 (I can't see an equivalent for th 8049 - so YMMV), it says:
"Prog must float if EA is low, or if T0=5V for the 8748. For the 8048 PROG must always float."
Do I understand correctly? - the idle Vcc sags from 5V to 1.5V? Looks like there is some pin driven low connected directly to Vcc. Which pins of 8049 are connected to Vcc now? Try disconnecting them one by one while observing the Vcc level to find which one causes the sag.
What are you doing with the PROG pin? Looking at an old datasheet for the Intel 8048/9 series there is a curious note under the programing and verify timing waveforms for the 8048 (I can't see an equivalent for th 8049 - so YMMV), it says:
"Prog must float if EA is low, or if T0=5V for the 8748. For the 8048 PROG must always float."PROG is HI during the entire dump
When idle, 8749 gets a clean 5V at the i/o bus and 0V at VCC.
8049 only get about 1.5V at the bus and VCC / VDD is about 1V.
...
Bought an almost cheap second unit from japan in the hope that dumping the second MCU would be a breeze.
Not so.
The dumping waveforms are almost exactly like the failing one.
It just seems like the LO bits never reach ~0V and VCC is also idle at 1.5V, just as the Data pins are doing.
Something is very awry, if Vcc droops to 1.5V - Check the current demand ? and compare your 8749 with 8049's
Those old parts are NMOS so they need a lot of supply current
You might also want to check the pin-mapping, to make sure it really is an 8049 ?