Electronics > Microcontrollers
8051 Atmel AT89S51 seems not to execute program from flash
adinsen:
Great news! I figured out I could connect the T48 to ICE programming interface. I don't know why I didn't realize that was even possible with the T48 without an adapter :palm:
The programmer now recognizes the correct chip ID of the 89S51 and my test code (including the SDCC runtime) executes perfectly. The screenshot below shows P0 and P2 outputs (P0 has 10k \$\Omega\$ pullups connected trough ~6 cm wire wrap wires).
Conclusion so far, don't use parallel programming with the XGecu programmer :wtf:
Problem solved!!!! :phew: :box: :-+ :clap:
EDIT: It turns out the chips are really 89S52 chips id'd as 89S51 and that the parallel programmer reads the same code as serial when I configure it as 89S52... :-DD
PCB.Wiz:
--- Quote from: adinsen on March 23, 2023, 03:56:53 pm ---Problem solved!!!! :phew: :box: :-+ :clap:
--- End quote ---
Great it is now working 8)
Maybe serial is what they tested ? - The really strange part is that parallel pgm verify worked ?
--- Quote from: adinsen on March 23, 2023, 03:56:53 pm ---EDIT: It turns out the chips are really 89S52 chips id'd as 89S51 and that the parallel programmer reads the same code as serial when I configure it as 89S52... :-DD
--- End quote ---
You mean you can Serially pgm and then read back OK parallel, if you select AT89S52 ?
Did you try program above 4K ? I know they use the same die, but I think they fuse set the size.
What does the parallel programmer read back if you select AT89S51 - ie where does it place your code.
If you read back a part parallel programmed, via serial, where does the code show up ?
adinsen:
--- Quote from: PCB.Wiz on March 23, 2023, 09:37:41 pm ---You mean you can Serially pgm and then read back OK parallel, if you select AT89S52 ?
Did you try program above 4K ? I know they use the same die, but I think they fuse set the size.
What does the parallel programmer read back if you select AT89S51 - ie where does it place your code.
If you read back a part parallel programmed, via serial, where does the code show up ?
--- End quote ---
I can serially program and read back in parallel selecting AT89S52 and I can program the upper 4K in parallel mode ignoring the ID. The serially programmed code programmed as AT89S51 ends up in the lower 4K of the chip when reading it back as an AT89S52. I suspect parallel programming it as an AT89S51 and reading back as AT89S52 will show that the code ends up in the upper 4K.
The T48 programmer probably just leaves P2.4/parallel A12 unconnected in AT89S51 mode. There's no mention of P2.4 in the AT89S51 data sheet about parallel programming, so that should be fine, but the internal pullups will then make it a 1. Perhaps Atmel did not fuse set the size on this batch in the same way they normally do and as you suggest tested them in a way so the defect didn't show up.
PCB.Wiz:
--- Quote from: adinsen on March 24, 2023, 04:53:53 am ---
--- Quote from: PCB.Wiz on March 23, 2023, 09:37:41 pm ---You mean you can Serially pgm and then read back OK parallel, if you select AT89S52 ?
Did you try program above 4K ? I know they use the same die, but I think they fuse set the size.
What does the parallel programmer read back if you select AT89S51 - ie where does it place your code.
If you read back a part parallel programmed, via serial, where does the code show up ?
--- End quote ---
I can serially program and read back in parallel selecting AT89S52 and I can program the upper 4K in parallel mode ignoring the ID. The serially programmed code programmed as AT89S51 ends up in the lower 4K of the chip when reading it back as an AT89S52. I suspect parallel programming it as an AT89S51 and reading back as AT89S52 will show that the code ends up in the upper 4K.
The T48 programmer probably just leaves P2.4/parallel A12 unconnected in AT89S51 mode. There's no mention of P2.4 in the AT89S51 data sheet about parallel programming, so that should be fine, but the internal pullups will then make it a 1. Perhaps Atmel did not fuse set the size on this batch in the same way they normally do and as you suggest tested them in a way so the defect didn't show up.
--- End quote ---
Ah, that all makes sense.
Atmel likely fuse just CODE FETCH to 4k on 89S51, but leave the full 8k flash program, side unchanged. That means the top 4k is still there, but not seen by code, which jumps external at 4096
Thus the 4k part programs and verifies but fails to run. 8)
The programmer vendor will not have run actual code, they just confirm erase/pgm/verify (which all 'works). You could feed back a bug report to the T48 programmer software team ?
These days, the 8k parts are the same price as the 4k parts, so the 4k parts are fading anyway. (and newer LP52 are cheaper than older S52)
adinsen:
--- Quote from: PCB.Wiz on March 24, 2023, 06:55:18 pm ---Ah, that all makes sense.
Atmel likely fuse just CODE FETCH to 4k on 89S51, but leave the full 8k flash program, side unchanged. That means the top 4k is still there, but not seen by code, which jumps external at 4096
Thus the 4k part programs and verifies but fails to run. 8)
The programmer vendor will not have run actual code, they just confirm erase/pgm/verify (which all 'works). You could feed back a bug report to the T48 programmer software team ?
These days, the 8k parts are the same price as the 4k parts, so the 4k parts are fading anyway. (and newer LP52 are cheaper than older S52)
--- End quote ---
Yeah, it could be a good idea to feed them a bug report, OTOH this is likely an incorrectly configured (fused) batch which just slipped through production verification. According to the data sheet, in parallel programming, only address lines 0-11 should be connected. See the snip below.
So here's what I think happens: The chips are fused wrongly for parallel programming and it's possible to access all of the 8K on the die. So there's actually also an A12 on P2.4. The internal pullup on that port, however, sets it to 1...
I'll need a lot of different 82S51's to find out for sure ... :)
Navigation
[0] Message Index
[*] Previous page
Go to full version