Counting prime numbers with the ATtiny13A

Dave M. has created a prime number machine – TinyPrime – powered by Atmel’s ATtiny13A microcontroller (MCU).

“The ATtiny13A is a neat chip: AVR with 1K of flash, 64 bytes of RAM and 64 bytes of EEPROM,” Dave wrote in a recent blog post.

“I programmed it using a Teensy-2.0-based waldo running Ward Cunningham’s TXTZYME. Every time you push the button, the AVR retrieves the currently-displayed number (which is stored in EEPROM), and then increments it, clicks the counter and tests for primality.”

If the number isn’t prime, says Dave, the machine increments and clicks again.

“When a prime number is reached, it stops and waits for another button press,” he added.

Interested in learning more? You can check out TinyPrime’s official project page here.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s