Thinking Outside The IDE To Make A Fast-counting Arduino

[Udo Klein] took on the challenge of counting as fast as possible using an Arduino board. The quest involves a search for short-cuts that will let him drive a 20-bit counter as quickly as possible using the stock hardware. But the catch is that the Arduino environment has some overhead running in the background which will slow things down. He looks into each of these road bumps, then shows one way to get around them.

The code uses a command we don’t normally see in modern C embedded programming; the goto statement. He’s using this to bypass the extra cycles used by the Arduino’s in-built loop() function. The only command that is run within his hacked loop is a deeply nested set of macros. They’re toggling output pins using the hardware XOR built into the AVR chip. This is directly addressing the registers and thereby dumps the slowdown added by the digitalWrite() function.

The result is a software counter that toggles the output lights (see the clip after the break) at about 98.9% of the hardware clock speed. Pretty impressive, but [Udo] figures he can make it just a bit faster yet.

Continue reading “Thinking Outside The IDE To Make A Fast-counting Arduino”

Counting Bees

This is the bee counter which [Hydronics] designed. It’s made to attach to the opening for a hive, and will count the number of bees entering and exiting. We’re not experienced bee keepers ourselves (in fact we’re more of the mind of getting rid of stinging beasties) but we understand their important role in agriculture and ecosystem so we’re glad someone’s making a nice home for them.

Most of the apparatus is a circuit board lined with reflective sensors. There is a double-row of pin sockets on the top of the board which accepts the Teensy+ which monitors those sensors. The bees must pass below this PCB every time they enter or leave the hive, thereby tripping a sensor. In the video after the break [Hydronics] shows off the system with a netbook used to monitor the output. But it sounds like he has plans for an integrated display system in future versions of the bee counter.

Continue reading “Counting Bees”

Auxiliary Scoreboard Reads Status Directly From Memory

[StaticChanger] built a scoreboard to display his kill statistics from Halo for the PC. Yes, we’ve seen kill counters before, but we like the way that he gathers the data. This project is reading the score directly from an address in memory.

Using a program called Cheat Engine, the memory used by a program can be sniffed. After a few passes, the program will help you find a static memory address for your desired data. Once you have that it’s just a matter of using a pointer to that address in your desired programming language. In this case, a C# program polls the value and instructs an Arduino to display the value on a couple of 7-segment displays. Voila, the number appears next to your screen as you see in the image above.