Tag Archives: Karl Lunt

LED SMD firefly built around an ATtiny85

A Maker by the name of Tyson has created an “electronic firefly” built around Atmel’s popular ATtiny85 microcontroller (MCU) and a custom PCB.

Additional project components include:

  • (2) 12 pf 0805 capacitors
  • (1) 100 kOhm 1206 resistor (for reset line)
  • (1) 1 MOhm 1206 resistor (for LED discharge)
  • (1) CR2032 battery holder (BC2032-E2 at Digi-Key)
  • (1) CR2032 battery
  • (1) Clear Orange 5mm LED (754-1271 at Digi-Key)
  • (1) 32 kHz crystal (535-9166-1 at Digi-Key)
  • (1) 8 to 12 oz Mason Jar
  • 2-3 oz sand

Before kicking off, Tyson reviewed Karl Lunt’s asynchronous fireflies project, with the overall goal of simulating intermittent blinking in low-light conditions like a firefly.

“Using the existing project, I did need to modify a few things. First off, I was using an ATtiny85 instead of the ATtiny13a, as well as an external clock,” Tyson explained in a recent blog post.

“Luckily, the external clock only required a few fuses to be set as far as programming went and a couple load capacitors to allow it to be used with the MCU. The ATtiny85 required a few code changes because the output port for the LED and mux for ADC had to be changed among other registers.”

In terms of the PCB, Tyson used photo paper for the print and Eagle to create the necessary traces. He then soldered on the ATtiny85 and set the appropriate clock speed.

Interested in learning more about building LED fireflies with Atmel’s ATtiny85 MCU? You can check out HackADay’s coverage here, the project’s blog page here and the source/board schematics here.

KLBasic for Atmel AVR MCUs

Like many of you, I have fond memories of BASIC, a nifty acronym for Beginner’s All-purpose Symbolic Instruction Code. Back in the early 90’s I wrote a couple of RPG fantasy text games in the language on my (286) PC, complete with color changes (on a black background) and rudimentary speaker beeps. Ah, those were certainly the good old days, well, at least for me.

But I digress. Yes, BASIC has been around for a long time and doesn’t appear to be going anywhere due to its rather obvious nostalgia factor. Recent versions (and there are many) include QB64, Bywater BASIC, Gambas, FreeBASIC, PureBasic, Power BASIC, RealBasic, True BASIC, Quite BASIC, Small Basic, RFO BASIC and Mintoris Basic.

Unsurprisingly, there is even an iteration of the wildly popular language – dubbed KLBasic and written in C – for Atmel AVR microcontrollers.

“My BASIC is a C rewrite of Gordon Doughman’s assembly language program. When I started work on KLBasic, I was trying to solve what I saw as a long-standing problem. I did not have a target-resident tool for working with MCUs that provided immediate feedback and interaction with the low-level parts of the device,” explained KLBASIC creator Karl Lunt.

“There are variants of Forth, of course, and I have done some work with amforth for the AVRs. Very much low-level, but I also wanted a tool that was friendly for beginners, and Forth can have a steep learning curve. Frankly, I have very fond memories of tools from decades ago, such as TinyBasic, Radio Shack’s TRS-80 Model 100, and QuickBasic. Those tools started my interest in microcontrollers, which has not slackened yet. Perhaps KLBasic or some variant of it will inspire a new generation of kids to get started with MCUs.”

According to Lunt, the goal of KLBASIC is to hand the community the source code for a working, target-resident interpreter/compiler for a simple language. Lunt also said he hopes others will build on his work, taking the design in new directions and adding new features along with improvements.

Interested? You can find the source files for the core (target-independent) routines here and the source files for AVR target implementation here.

Oh, and yes, you may also want to check out this Arduino-BASIC interpreter created by Usmar A. Padow, which includes an LCD, (PS/2) keyboard and SD card.