Vista Normal

Hay nuevos artículos disponibles. Pincha para refrescar la página.
AnteayerSalida Principal

SWD Interface Simplifies Debugging

28 Agosto 2024 at 23:00
Hands hold a set of white, 3D printed connectors above a wooden table. They look like a cross between a ballpoint pen tip and a spider. The shorter one on the right has yellow, green, black, purple, and white wires coming out the top.

The proliferation of microcontrollers has made it easier than ever to add some smarts to a project, but sometimes there just isn’t enough space for headers on a board, or you feel a little silly soldering something that will get used to flash a program then languish inside your build. [Dima] wanted to make his boards easier to flash, and developed a PCB footprint and flashing tool pair that makes use of the mounting holes on his boards.

While some debugging tools might use a clamp or tape, [Dima] discovered that using sprung pins only on one side of the connector wedged his fixed locator pin (originally a 1 mm drill bit) into the hole removing the need for any other holding mechanism.

His original prototype worked so well that it took him some time to get back around to making a more reproducible design that didn’t involve fine soldering and superglue. After enlarging the contact pads and several iterations of 3D printing, he developed an interface connector that uses standard jumper wires and a steel rod to provide a sturdy and reliable connection for flashing boards with the corresponding footprint. He’s currently a little disappointed with the overall size of the connector though, and is soliciting feedback on how to make it smaller.

While [Dima]’s MCU of choice is the STM32, but this design should be applicable to any other microcontrollers using a five wire system, or you could take one off for USB. Having trouble finding the SWD points on an existing device? Try this method.

Thanks to [DjBiohazard] for the tip!

Single-Stepping the 6502 Processor

18 Julio 2024 at 20:00

Although marketing folk and laypeople may credit [Steve Jobs] as the man behind the success of Apple, those in the tech world know the real truth that without [Steve Wozniak] nothing would have ever gotten off the ground during the early days of the computer company. As an exhibit of his deep knowledge of the machines he was building, take a look at this recreation of a circuit by [Anders] which allows the 6502 processor to step through instructions one at a time, originally designed by [Woz] himself, even though there are still myths floating around the Internet that this type of circuit can’t work.

Like a lot of Internet myths, though, there’s a kernel of truth at the middle. The original 6502 from the mid-70s had dynamic registers, meaning they would lose their values if the chip was run below a critical clock speed. Since single-stepping the processor is much lower than this speed, it seems logical that this might corrupt the data in the registers. But if the clock is maintained to the registers the processor can be halted after each instruction, allowing even the original 6502 to go through its instructions one at a time.

[Anders]’s project sets up this circuit originally laid out by [Steve Wozniak] but updates it a bit for the modern times. Since the technology of the era would have been TTL, modern CMOS logic requires pull-up resistors to keep any inputs from floating. The key design of the original circuit is a set of flip-flops which latch the information on the data bus, and a switch that can be pressed to let the processor grab its next instruction, as well as a set of LEDs that allow the user to see the value on the data bus directly.

Of course, a computer processor of this era would be at a major handicap without a way to debug code that it was running, so there are even dedicated pins that allow this functionality to occur. Perhaps the Internet myth is a bit overblown for that reason alone, but [Anders] is no stranger to the 6502 and has developed many other projects that demonstrate his mastery of the platform.

❌
❌