Tag Archives: BASIC

There’s nothing BASIC about this homebrewed computer

Just when you think you’ve seen everything with AVR microcontrollers here at Bits & Pieces, the 8-bit ideas just keep on coming! A Maker by the name of “Dan” has introduced an ingenious new innovation, a homebrew 8-bit computer running BASIC using a single ATmega1284P MCU.


Dan’s sleek design has the ability to generate composite video supported by multiple screens, as well as read PS/2 keyboard input. Running a slimmed down version of the BASIC language, called TinyBASIC, the 8-bit computer boasts over 7kb of SRAM which is available to write programs, while an 8KB EEPROM card (connected to the storage header) can be used to save full-size programs.

According to the Maker’s Hackaday page, “Many GPIO pins are available allowing connections to components such as LEDs, potentiometers, sensors and much more. A L7805 regulator is used to make the system more flexible with the power supply which can be used (compared to using no regulator at all) to power the system such as a 9V wall-mounted transformer or a 12V battery.”


“The computer is easy to assemble at home as all components are through-hole,” Dan notes on the simplicity of this design. “Once all the components from the component list have been gathered, they can all be soldered into place and the system is then ready for use. Simply connect a TV, PS/2 keyboard and power source such as a PP3 battery or wall-mounted PSU. If an EEPROM card is connected, set the jumper to the ‘C’ position to allow BASIC programs to be saved to the card or if internal EEPROM is going to be used, set the jumper to the ‘I’ position (note, the jumper is the same as the type used for IDE hard drive pins used to select master or slave mode so they can easily be found within old computers).

This protoype is an easygoing introduction for Makers looking to become familiar with the BASIC language and homebrewed computers. Inspired Makers can view Dan’s full Hackaday tutorial here.

Atmel-based BASIC computer

 makes us nostalgic

BASIC, or Beginner’s All-purpose Symbolic Instruction Code, is a series of general-purpose, high-level programming languages that emphasizes ease of use. According to Wikipedia, John G. Kemeny and Thomas E. Kurtz designed the original BASIC language at Dartmouth College in New Hampshire way back in 1964.

Multiple dialects of BASIC were written over the years, with the TinyBASIC variant capable of fitting into as little as 2 or 3 KB of memory. This small size made it quite useful in the early days of microcomputers (the mid-1970s), when typical memory size weighed in at 4–8 KB.

Recently, a Maker named Dan decided to design a simple, tiny 8-bit computer to run the succinct TinyBASIC.

As HackADay’s Brian Benchoff reports, the computer is built around the Arduino Uno (ATmega328) and a custom-made AVR-based shield, using TinyBASIC, the TVout library and the PS/2 keyboard library.

“After piecing together a little bit of code, the Arduino IDE alerted Dan to the fact the TVout and PS/2 libraries were incompatible with each other,” Benchoff explained. 

”This inspired Dan to use the ATmega328 as a coprocessor running the TVout library, and using the capacious ATmega1284P as the home of TinyBASIC and the PS/2 library.”

Subsequently, Dan used Fritzing to design a circuit using minimal components, with a custom PCB milled out of copper board.

“After the board was tinned, [Dan] had a beautiful minimalist retro computer with nearly 14kB of RAM free and an RCA display,” added Benchoff. 

The final setup comprises the shield, an Arduino UNO, PS/2 keyboard, RCA capable display (such as an LCD TV), RCA cable and a power source (such as a wall mounted PSU).

Future iterations of the Atmel-powered TinyBASIC computer will likely be based around the stalwart Arduino Mega (ATmega1280), facilitating a TV resolution of 720×480. Additional features could include an SD card slot, LEDs, pots and perhaps even headers for I2C and SPI.

Interested in learning more?

You can check out the project’s official Instructables page here.

17 million wearable bands to ship in 2014

Basic and smart wearable band shipments increased dramatically in the second half of 2013, with analysts at Canalys predicting a significant acceleration of the trend in 2014. Indeed, over 17 million wearable bands are forecast to ship this year, driven primarily by devices with wearable-specific sensors.

According to Canalys analyst Chris Jones, basic band vendors boast greater wearable expertise and have shipped more numbers to date. Nevertheless, the category of smart bands is already growing faster than its basic counterpart.

“Increasingly, smart bands will adopt basic band features as the two categories converge,” he confirmed.

Though currently a relatively small market serving fitness enthusiasts, wearable bands represent a massive opportunity in the medical and wellness segment. 

Indeed, 2014 will be the year that wearables become a key consumer technology, with the smart band segment expected to reach 8 million annual shipments. More specifically, Canalys estimates this number will grow to over 23 million units by 2015 and over 45 million by 2017.

“The wearable band market is really about the consumerization of health,” said Canalys analyst Daniel Matte. “There will be exciting innovations that disrupt the medical industry this year, and with the increased awareness about personal well-being they will bring to users, having a computer on your wrist will become increasingly common.”

To be sure, Canalys analysts say high-margin smart bands that incorporate sophisticated sensor technology will offer vendors enormous profit potential.

“Android will be critical for developing the smart band app ecosystem, though significant changes will be required before it is suitable for wearable devices,” Matte concluded. “[We] expect Android to enter the smart band market soon in a meaningful way. [Of course], battery life and quality of sensor data will [also] be vital metrics of success for all smart bands.”

Computer programming tips

I ran across a neat article in Forbes (of all places!). Titled ”What Does It Take To Be An Expert In Computer Programming?” When I went to look up the author, Eric Pepke, there was not a lot of information other than he worked in Atlanta. Then I noticed he posted a YouTube video titled “DimiDraw v. 0.1”. The description explains “DimiDraw v.0.1 is an as yet unreleased graphics library for the Arduino and similar microcontrollers.” Well anyone that writes code for Atmel-powered Arduinos is OK in my book. So I sent the article to a couple crack programmers I know. Michael said:

Before reading it, I was also thinking that having a basic understanding of hardware architecture was important.  Also, for me, learning Assembly code back in the day gave me a very good understanding of how a processors “thinks” especially when it came to registers and writing complex arithmetic operations.

Back then we didn’t have these fancy development environments with debugging tools, breakpoints, stepping, etc.  Well, actually we had some of that but we were also taught the basics to understand programming better.  Speaking of “basics”, I actually taught myself that in the early 80s.

And Andreas over on the 3rd floor noted: “All I can add is that of all the classes I had during my education ‘algorithms and data structures’ was by far the hardest one. (But also really useful.)”


And regarding Basic, I note Peske was a contributor to the NS Basic language. Modeled on Microsoft Visual Basic, and meant for phones and mobile platforms, a code snippet might be:

Function OKButton_onclick()

   MsgBox “Hello World”

End Function

Now that is a language I can endorse—less gibberish and more directness. I never thought there was any shame in programming in Basic. Especially once I came across complied Basic, QBasic I think it was. I did an little program that spit stepper motor commands out the printer port to exercise a wafer elevator that was in a million-dollar semiconductor etcher I was working on. Once I compiled it, I had to add loops to slow the thing down. It ran so fast the motor could not keep up.


I remember BASIC programming in 9th grade back in the 1960s. Yeah, the Brecksville Ohio school system was really that advanced (still is). One of the problems was to take 5 numbers from the keyboard and then print them out in order. We all slogged into it– a bunch of if-than compares. I think most of us ended up with 200 lines of code. Except for one kid. I think it was Gooding, can’t remember his first name. He just counted from 1 to 1000 and printed out when a match to any of the input numbers hit. There there were, printed out, in order. I think it was 10 lines of code. We all went ballistic– pretty much accusing him of cheating– “It only works for integers!”  or “It won’t do negatives!” or “It stops at 1000!” The teacher was probably trying to get us to think more than to reward Gooding, but she gave him full credit– saying he solved the problem, and in a very elegant way. Yeah, merit badge for Gooding– that is thinking outside the box, and he deserved more than full credit. I hope he is rich and famous now.

And as an added bonus, that Forbes website as a good privacy tip about never giving out your zip code when you shop.

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.