Discussion in "8051 Discussion Forum" started by    jona    Oct 14, 2014.
Tue Oct 14 2014, 04:19 pm
#1
Atmel says that their AT89S52 can operate from 0mHz to 33mHz. So, can I feed it 12 cycles at a time, then pause, then anther 12 cycles and so on into pin 19 on the 40-pin DIP (after first removing the crystal and caps) and thereby have the cpu single step? I see one potential problem: 24 cycle instructions, would it be patient enough to wait for the next 2 clock cycles in order to complete the instruction. Does S1P1 begin with a falling or with low level? It's hard to tell from the sketches of the CPU timing.


[ Edited Tue Oct 14 2014, 07:23 pm ]
Wed Oct 15 2014, 11:17 pm
#2
yes providing customized clocks to processor you can single step 8051 controller. It is actually something very interesting if someone is making a hardware emulator for single step execution. I suggest you to give clock cycles depending on type of instruction you're going to execute. so lets say if its a 24 cycle instruction give 2 bursts of 12clocks and if 12 cycles then 1 burst and you can keep burst @12Mhz how 'bout that?
Thu Oct 16 2014, 05:18 am
#3
I employed two AT89S52 boards, #2 with crystal and caps, and #1 with crystal and caps removed and a clock signal introduced to pin 19. #2 has a program the issues 24 clocks with each invocation of INT0. I invoke INT0 with a Hall switch to assure there's no bounce. If I examine closely the ATMEL datasheet, it looks like S1P1 begins with a falling edge, but I doubt that the timing diagram was to taken so literally (see the end of this paragraph). Anyway, I initialized with the clock pin low, then raised it and lowered it 24 times, leaving it low before returning from the interrupt and executing sjmp $. #1 has a short repeating program with only 24-clock instructions. It works: every time I invoke INT0 on #2, #1 executes one instruction. Then I changed #2 to output 12 clocks per invocation of INT0, and it still works. #1 waits patiently for the second set of 12 clocks to execute one 24-clock instruction. Finally, to complete my torture of an AT89S52, I shifted the phase by starting with the clock high, then lowering it and raising it 12 times, and it works the same as before. Apparently the AT89S52 takes whatever it can get.

I recall back in the day Intel provided a way to single step, but it involved overhead. I don't remember the details except that the processor ran continuously in the background. Maybe it was part of their SDK51, which was a horrible learning device: the student didn't know what was part of the SDK and what was part of the 8051.

Thanks for your reply.
Mon Oct 20 2014, 02:30 pm
#4
I also checked in Intel manual however I could not find any relation of default level or sampling edge for input clock. I think somehow it's been taken care automatically? Well thanks for sharing this wonderful single step information.

Get Social

Information

Powered by e107 Forum System

Downloads

Comments

Bobbyerilar
Thu Mar 28 2024, 08:08 am
pb58
Thu Mar 28 2024, 05:54 am
Clarazkafup
Thu Mar 28 2024, 02:24 am
Walterkic
Thu Mar 28 2024, 01:19 am
Davidusawn
Wed Mar 27 2024, 08:30 pm
Richardsop
Tue Mar 26 2024, 10:33 pm
Stevencog
Tue Mar 26 2024, 04:26 pm
Bernardwarge
Tue Mar 26 2024, 11:15 am