Posts with «unix» label

Run UNIX On Microcontrollers With PDP-11 Emulator

C and C++ are powerful tools, but not everyone has the patience (or enough semicolons) to use them all the time. For a lot of us, the preference is for something a little higher level than C. While Python is arguably more straightforward, sometimes the best choice is to work within a full-fledged operating system, even if it’s on a microcontroller. For that [Chloe Lunn] decided to port Unix to several popular microcontrollers.

This is an implementation of the PDP-11 minicomputer running a Unix-based operating system as  an emulator. The PDP-11 was a popular minicomputer platform from the ’70s until the early 90s, which influenced a lot of computer and operating system designs in its time. [Chloe]’s emulator runs on the SAMD51, SAMD21, Teensy 4.1, and any Arduino Mega and is also easily portable to any other microcontrollers. Right now it is able to boot and run Unix but is currently missing support for some interfaces and other hardware.

[Chloe] reports that performance on some of the less-capable microcontrollers is not great, but that it does run perfectly on the Teensy and the SAMD51. This isn’t the first time that someone has felt the need to port Unix to something small; we featured a build before which uses the same PDP-11 implementation on a 32-bit STM32 microcontroller.

Open-Source ARM Development Simplified

The ARM series of processors are an industry standard of sorts for a vast array of applications. Virtually anything requiring good power or heat management, or any embedded system which needs more computing power than an 8-bit microcontroller is a place where an ARM is likely found. While they do appear in various personal computers and laptops, [Pieter] felt that their documentation for embedded processors wasn’t quite as straightforward as it could be and created this development board which will hopefully help newbies to ARM learn the environment more easily.

Called the PX-HER0, it’s an ARM development board with an STM32 at its core and a small screen built in. The real work went in to the documentation for this board, though. Since it’s supposed to be a way to become more proficient in the platform, [Pieter] has gone through great links to make sure that all the hardware, software, and documentation are easily accessible. It also comes with the Command Line Interpreter (CLI) App which allows a user to operate the device in a Unix-like environment. The Arduino IDE is also available for use with some PX-HER0-specific examples.

[Pieter] has been around before, too. The CLI is based on work he did previously which gave an Arduino a Unix-like shell as well. Moving that to the STM32 is a useful tool to have for this board, and as a bonus everything is open source and available on his site including the hardware schematics and code.

Arduino Gets a Command Line Interface

When using an Arduino, at least once you’ve made it past blinking LEDs, you might start making use of the serial connection to send and receive information from the microcontroller. Communicating with the board while it’s interacting with its environment is a crucial way to get information in real-time. Usually, that’s as far as it goes, but [Pieter] wanted to take it a step farther than that with his command line interpreter (CLI) for the Arduino.

The CLI allows the user to run Unix-like commands directly on the Arduino. This means control of GPIO and the rest of the features of the microcontroller via command line. The CLI communicates between the microcontroller and the ANSI/VT100 terminal emulator of your choosing on your computer, enabling a wealth of new methods of interacting with an Arduino.

The CLI requires a hex file to be loaded onto the Arduino that you can find at a separate site, also maintained by [Pieter]. Once that’s running, you can get all of that sweet command line goodness out of your Arduino. [Pieter] also has some examples on his project page, as well as the complete how-to to get this all set up and running. There’s a lot going on in the command line world, in Linux as well as windows. So there’s plenty to explore there as well.

Hack a Day 11 Nov 03:00
arduino  cli  command line  gpio  i2c  microcontrollers  serial  shell  unix  uno  

Kit Review – Maniacal Labs Epoch Clock

Introduction

The subject of our latest kit review is the “Epoch Clock” from Maniacal Labs, a new organisation started by three young lads with some interesting ideas. Regular readers will know we love a clock – so when the opportunity came to review this one, we couldn’t say no.

At this point you may be thinking “what is Epoch time anyway?”. Good question! It is the number of seconds elapsed since the first of January, 1970 (UTC) – and used by Unix-based computers as the start of their time universe. (For more on the theory of Epoch time, check out Wikipedia). For example – 1379226077 Epoch time is Sun, 15 Sep 2013 06:21:17 GMT. That’s a lot of seconds. If you’re curious, you can do more calculations with the EpochTime website.

Moving forward, this clock kit will show Epoch time in full 32-bit binary glory, using a DS1307 real-time clock IC (with backup battery) and is controlled with an ATmega328P-PU – so you can modify the code easily with the Arduino IDE or WinAVR (etc).

Assembly

The creators have spent a lot of time on not only the packaging and out-of-box-experience, but also the documentation and setup guide – so as long as you’re fine with simple through-hole soldering the kit will not present any challenges. The kit arrives in a sturdy box:

… with well packaged components. Everything is included for the finished product, as well as IC sockets, the RTC backup battery and a USB cable so you can power the clock from a USB hub:

The PCB is a good thickness, and has a clear silk-screen and solder mask:

Construction is simple, just follow the step-by-step instructions. Starting with the USB socket for power:

… then the resistors:

… the LEDs:

… all 32 of them. Note that the LEDs don’t sit flush with the PCB, so a little effort is required to keep them aligned:

 Then the rest of the components just fit as expected. I’ve also added the included header pins for an FTDI programming cable and ICSP to keep my options open:

Then simply fit the battery, insert the ICs and you’re done:

Using the clock

The microcontroller is pre-programmed, so you can use the clock straight away. You will however need to set the time first. To make this incredibly easy, there is a special web page that displays the current time and Epoch time, which steps you through the process of setting the time using the buttons.

Or with some code available on the kit github page and a programming cable, you can automatically sync it to the clock. Once setup, the battery will keep the current time in the RTC nicely. The clock is powered by 5V, which is easily supplied with the included USB cable, or you can always hack in your own feed.

So what does Epoch time in 32-bit binary look like? Here’s a short video of the clock in action:

Reading the time requires converting the binary number displayed with the LEDs back to a decimal number – which is of course the Epoch count of seconds since 1/1/1970. Math teachers will love this thing.

But wait, there’s more!

If you get tired of the blinking, there’s a test function which is enabled by holding down both buttons for a second, which turns the Epoch Clock into a nifty Larson Scanner:

To create your own sketches or examine the design files in more detail, it’s all on the clock github page. From a hardware perspective you have an ATmega328P-PU development board with a DS1307 battery-backed real-time clock – with 32 LEDs. So you could also create your own kind of clock or other multi-LED blinking project without too much effort. Review the EpochClockSchematic (.pdf) to examine this in more detail.

Conclusion

I really enjoyed this kit – it was easy to assemble, I learned something new and frankly the blinking LEDs can be quite soothing. The clock would make a great for a conversation-starter in the office, or would make an ideal gift for any Sheldon Cooper-types you might be associated with. Or have competitions to see who can convert the display to normal time. After shots.

Nevertheless it’s a fun and imaginative piece of kit, fully Open Hardware-compliant – and if you’ve made it this far – get some and have fun. Full-sized images are on flickr. Interested in Arduino? Check out my new book “Arduino Workshop” from No Starch Press.

In the meanwhile have fun and keep checking into tronixstuff.com. Why not follow things on twitterGoogle+, subscribe  for email updates or RSS using the links on the right-hand column? And join our friendly Google Group – dedicated to the projects and related items on this website. Sign up – it’s free, helpful to each other –  and we can all learn something.

[Note – The kit reviewed was a promotional consideration from Maniacal Labs]

The post Kit Review – Maniacal Labs Epoch Clock appeared first on tronixstuff.

Tronixstuff 15 Sep 10:29