Caching In On Program Performance

Most of us have a pretty simple model of how a computer works. The CPU fetches instructions and data from memory, executes them, and writes data back to memory. That model is a good enough abstraction for most of what we do, but it hasn’t really been true for a long time on anything but the simplest computers. A modern computer’s memory subsystem is much more complex and often is the key to unlocking real performance. [Pdziepak] has a great post about how to take practical advantage of modern caching to improve high-performance code.

If you go back to 1956, [Tom Kilburn’s] Atlas computer introduced virtual memory based on the work of a doctoral thesis by [Fritz-Rudolf Güntsch]. The idea is that a small amount of high-speed memory holds pieces of a larger memory device like a memory drum, tape, or disk. If a program accesses a piece of memory that is not in the high-speed memory, the system reads from the mass storage device, after possibly making room by writing some part of working memory back out to the mass storage device.

Continue reading “Caching In On Program Performance”

Hackaday Links Column Banner

Hackaday Links: June 16th, 2019

OpenSCAD has been updated. The latest release of what is probably the best 3D modeling tool has been in the works for years now, and we’ve got some interesting features now. Of note, there’s a customizer, for allowing parametrizing designs with a GUI. There’s 3D mouse support, so drag out that weird ball mouse from the 90s. You can export in SVG, 3MF, and AMF. Update your install of OpenSCAD now.

New Hampshire is the home of BASIC, and now there’s a sign on the side of the road saying so. This is a New Hampshire state historical marker honoring BASIC, invented at Dartmouth College in 1964. Interestingly, there are 255 historical markers in New Hampshire, usually honoring bridges and historical figures, which means there’s an off-by-one error depending on implementation.

Because robots a great way to get kids into technology — someone has to repair the future robot workers of the world — DJI has release the RoboMaster S1. It’s a robot with four Mecanum wheels, something like a Nerf turret, a camera, and WiFi. The best part? It’s programmable, either through Scratch or Python. Yes, it’s drag-and-drop programming for line following robots.

If you have a C by GE Smart Light Bulb and connect a new router to your home network, you will need to disassociate your C By GE Smart Light Bulb with your old network. To do this, you first need to turn your bulb on for eight seconds, then turn off for two seconds, then turn on for eight seconds, then turn off for two seconds. Then turn the bulb on for eight seconds, and finally turn the bulb off for two seconds. Finally, turn the bulb on for eight seconds, then turn the bulb off for two seconds. Your bulb should blink three times, indicating it has dissociated with the WiFi network. If this procedure does not work, your light bulb is running an older version of firmware. This is why you put a physical reset button on your stuff, people.

Have a lot of Raspberry Pi hats but you want to play around with the ESP32? No problem, because here’s a Pi-compatible GPIO ESP32 board. It needs a catchier name, but this is an ESP32 that’s mostly compatible with the 40-pin connector found on all Pis. Here’s a Crowd Supply link.

 

Split Flap Clock Keeps Time Thanks To Custom Frequency Converter

Why would anyone put as much effort into resurrecting a 1970s split-flap clock as [mitxela] did when he built this custom PLL frequency converter? We’re not sure, but we do like the results.

The clock is a recreation of the prop from the classic 1993 film, Groundhog Day, rigged to play nothing but “I Got You Babe” using the usual sound boards and such. But the interesting part was getting the clock mechanism keeping decent time. Sourced from the US, the clock wanted 120 VAC at 60 Hz rather than the 240 VAC, 50 Hz UK standard. The voltage difference could be easily handled, but the frequency mismatch left the clock running unacceptably slow.

That’s when [mitxela] went all in and designed a custom circuit to convert the 50 Hz mains to 60 Hz. What’s more, he decided to lock his synthesized waveform to the supply current, to take advantage of the long-term frequency control power producers are known for. The write-up goes into great detail about the design of the phase-locked loop (PLL), which uses an ATtiny85 to monitor the rising edge of the mains supply and generate the PWM signal that results in six cycles out for every five cycles in. The result is that the clock keeps decent time now, and he learned a little something too.

If the name [mitxela] seems familiar, it’s probably because we’ve featured many of his awesome builds before. From ludicrous-scale soldering to a thermal printer Polaroid to a Morse-to-USB keyboard, he’s always got something cool going on.

VR On The 6502

The MOS Technology 6502 was one of the more popular processors of the 1980s. It ran the Commodore 64, the NES in a modified form, and a whole bunch of other hardware, too. By modern standards, it’s barely fit to run a calculator, but no matter – [Nick Bild] built a VR game that runs on the retro CPU anyway!

[Nick]’s project is built on his 6502 computer, the Vectron 64. Being a breadboard build, it’s easy to modify things and add additional hardware, and that’s precisely what he did. The VR system uses two 320 x 240 LCD screens, one for each eye. These are controlled over SPI, but the humble 6502 simply doesn’t have the speed to clock out enough bits fast enough for a video game. Instead, additional hardware is added to generate pulses to run the screens. There’s a bunch of other neat hacks as well that help make the game playable, like overclocking the CPU to 1.75 MHz and drawing common elements to both screens at the same time.

To test out the VR system, [Nick] coded a basic Asteroids VR game. It’s not really practical to demonstrate the game without the hardware, but we’d love to try it out. There’s something compelling about a low-resolution VR game with 8-bit graphics, and we hope to see the concept further developed in future.

More grunt would make this project even more capable, and for that, a 6502 running at 20MHz could come in handy. Video after the break.

[Thanks to Fred Gimble for the tip!]

Continue reading “VR On The 6502”

This Upgraded Power Wheels Toy Is Powerful Enough To Need Traction Control

A Lamborghini Aventador Is beyond the budget of all but the most well-heeled fathers, but [CodeMakesItGo] came pretty close with a gift for his young son. It was a Lamborghini Aventador all right, but only the 6V Power Wheels ride-on version. As such it was laclustre even for a youngster in its performance, so he decided to give it a 12V upgrade. This proved to have enough grunt to cause wheelspin on those hard plastic wheels, so a further upgrade was a traction control system featuring a NodeMCU. No other child has such a conveyance!

Veterans of the Power Racing Series or Hacky Racers might have expected to see a Chinese motor controller in the mix, but instead he’s used a set of relays for simple on-off control. The traction control has a pair of 3D-printed sensor wheels that operate upon a corresponding  pair of optocouplers to provide feedback to the NodeMCU. A set of different drive options were tried, with finally an H-bridge board being found to be most reliable.

The video below the break shows the hardware, and goes into some detail on the software. The NodeMCU’s WiFi is used to provide some tweakability to the system on the go. The traction control turns out to lower the standing start speed a little, but makes the machine more controllable by its driver. he certainly seems happy with his toy!

Long-time readers will know this isn’t the first Power Wheels upgrade we’ve shown you.

Continue reading “This Upgraded Power Wheels Toy Is Powerful Enough To Need Traction Control”

A TTL CPU, Minimising Its Chip Count

By now we should all be used to the astonishing variety of CPUs that have come our way created from discrete logic chips. We’ve seen everything from the familiar Von Neumann architectures to RISC and ever transport-triggered architecture done in 74 TTL derivatives, and fresh designs remain a popular project for many people with an interest in the inner workings of a computer.

[Warren Toomey]’s CSCvon8 is an interesting machine that implements an 8-bit computer with a 64-bit address space using only 17 chips, and without resorting to any tricks involving microcontrollers. It implements a fairly conventional Von Neumann architecture using TTL with a couple of tricks that use modern chips but could have been done in the same way in decades past. Instruction microcode is stored in an EEPROM, and the ALU is implemented in a very large EPROM that would probably once have been eye-wateringly expensive. This in particular removes many discrete TTL chips from the total count, in the absence of the classic 74181 single-chip part. To make it useful there is 32k each of RAM and EEPROM, and also a UART for serial access. The whole is brought together on a neat PCB, and there is a pile of demo code to get started with. Everything can be found in the project’s GitHub repository.

At the start of this article we mentioned a couple of unconventional TTL CPUs. The transport triggered one we featured in 2017, and the RISC one is the Gigatron which has appeared here more than once.

Home Made Gears Save This Shredder

It’s very likely that a majority of readers will have had a gear fail in a piece of equipment, causing it to be unrepairable. This is a problem particularly with plastic gears, which shed teeth faster than a child who has discovered the financial returns of the Tooth Fairy.

[BcastLar] has a shredder with a gear that has, well, shredded. He’s posted a video series over three parts that while ostensibly about fixing his shredder, is in reality a three-part tutorial on how to create custom gears using FreeCAD. While the principles of a gear are readily apparent to most observers their intricacies hide significant complexity which he does a great job of explaining. How to measure the parameters of a given gear, explaining mysteries such as pitch angle or beta, he breaks everything down in easy to understand steps.

His tool of choice is FreeCAD, and while he explains that FreeCAD has the ability to make gears from scratch the tool employed in the videos is the Gear Workbench plugin. He shows how this software removes the complexity of creating a gear, and shows the process on his screen as he creates the custom shredder part.

Finally, the process of 3D printing the gear is explained. You might ask why not machine it, to which he responds that tooling for non-standard gear profiles is prohibitively expensive. We’ve placed all three videos below the break, and we think you might want to make yourself a cup of tea or something and work through them.

Thanks [Andy Pugh] for the tip.

Continue reading “Home Made Gears Save This Shredder”