Learn about Compiling

compilingMatt Godbolt has created an intriguing webpage letting you enter C++ code and then watch the resulting assembly code. You can try it right here.

The compilers supported are gcc, lcc and clang in various versions. Hardware target architectures are ARM, ARM64, AVR, PowerPC and x86. Not all combinations of compilers and architectures are available, but this is enough to spend some time experimenting.

You can also enter compiler optimizations. This lets you discover how intelligent modern compilers are. It is nice to see how complex you can go and still get a pre-calculated constant back.

The code for the whole setup is available on github, and other languages than C++ can be explored. For instance, here is a version for go.

Posted in Programming | Leave a comment

Tiny, open source, M0 board

The ARM PRO MINI is a tiny, open source, board based on a Cortex M0 MCU. The whole project, including schematics and BOM, is available on github.

arm_pro_mini_2

The MCU is an NXP ARM M0 LPC11U35FHI33/501. This means that the Eclipse-based LPCXpresso IDE can be used to develop code in C/C++. Another alternative is to use the ARMmbed Online IDE (you will have to register to get to the compiler section, it is free). The ARM PRO MINI comes with a convenience library, making development easy.

The pins can be multiplexed between various functions, so the potential configurations differ a bit. The possibilities can be summarized as follows:

  • 0-8 ADC channels
  • Up to 26 GPIO pins
  • 0-2 SPI interfaces
  • 0-1 UARTs
  • 0-1 I2C interfaces
  • 1 USB port
  • Power pins (4.5-16V in, regulated 3.3V and 5V out)

Via dangerousprototypes.

Posted in ARM, Electronics, M0, Platforms | Leave a comment

Raspberry Pi 2 – Double the Power – Same Price

Just in from Raspberry Pi Foundation:

Let’s get the good stuff out of the way above the fold. Raspberry Pi 2 is now on salefor $35 (the same price as the existing Model B+), featuring:

  • A 900MHz quad-core ARM Cortex-A7 CPU (~6x performance)
  • 1GB LPDDR2 SDRAM (2x memory)
  • Complete compatibility with Raspberry Pi 1

Because it has an ARMv7 processor, it can run the full range of ARM GNU/Linux distributions, including Snappy Ubuntu Core, as well as Microsoft Windows 10.

What does this mean? It means more power, more software and the same interfaces.

The new CPU is a quadcore ARMv7 CPU, meaning that standard Linux distros as well as Windows 10 works on the platform (why would you want to tinker with Windows when you have Linux is beyond me, but anyway).

The RAM has doubled to 1GB, which is great. If nothing else, it can be used to cache more data from disk. Because, let’s be honest about this, the biggest problem with the Pi right now is the I/O speed of SD cards. A small eMMC would have been a welcome addtion.

While considering all this shiny stuff, it is also important to notice that the original Raspberry Pi will remain in production. This is important for many, many customers using this in a wide range of applications.

Posted in Raspberry Pi | Leave a comment

Retro Arcade Repairs

IMG_20150129_085303A friend of mine, kralleman, is crazy about retro games and their hardware. I mean properly crazy. Crazy enough to appear on national TV, as well as having three episodes of a local retro gaming show dedicated to his own collection (1, 2, 3). He is also a part of the team running the RetroSpelsMässan in Gothenburg. Go visit it if you have the chance!

He recently purchased a classic Atari Breakout table that needs repairs. I had the opportunity to have a look the main logic board of the game. This is amazing. TTL 74′ chips in long rows. So, without further ado, enjoy!

IMG_20150129_085258

IMG_20150129_085253

Posted in Electronics, Retro | Comments Off

Tickless idle in FreeRTOS

freertosAs things become more and more mobile, portable, or even wearable, power consumption becomes important. FreeRTOS moves in this direction by supporting a tickless idle process. But first, what is really the problem?

When a system has nothing to do, it goes to the idle task. This can be a simple loop, doing nothing. Doing nothing, however, consumes power. One way to attack this is to reduce the performance of the processor while in the idle task. However, in most modern OSs, including FreeRTOS, there is a timer task running. This means that the processor leaves the idle task quite frequently, using power.

To get away from this, FreeRTOS supports a tickless idle task. By setting the configUSE_TICKLESS_IDLE, the idle task suppresses ticks and the processor stays in a low power mode for as long as possible.

The actual implementation relies on a function called portSUPPRESS_TICKS_AND_SLEEP. This method is highly CPU specific and is currently supported on ARM Cortex-M3 and ARM Cortex-M4 ports. If you happen to use FreeRTOS on a different piece of silicon, you can implement the function yourself.

Posted in Uncategorized | Comments Off

Impressive 6502 Home Computer

Dirk Grappendorf has been working on a serious looking MOS 6502 based computer. Over at his site, you can follow his development diary.

homecomputer-6502-final-6

The computer was developed between September 2014 and January 2015. Quite impressive, given the outcome! The entire design is available from Dirk’s git repository over at github.

Starting with the exterior, the machine lives in a 3D printed case (love the orange!). The keyboard has been salvaged, but the original circuitry has been replaced. This is a computer resembling the C64 and similar, but with Windows keys :-)

homecomputer-6502-complete

Looking into the hardware, the machine even contains a proper SID chip for that classic chip tune sound.

The finish of the hardware and case are impressive. So is the software. It includes everything expected from a mid-80’s home computer, including a BASIC interpreter. It is also possible to develop using C or assembler.

Posted in 3D Printing, Electronics, Open Hardware, Programming, Projects, Retro | Comments Off

Raspberry Pi as an Amiga Floppy Drive

As you probably know, the combination of retro computing and tinkering with embedded platforms tickles the mind of us here at DigitalFanatics. Someone who really hit that spot is Maurizio Ramondo and his Amiga Drive project.

Basically, it is about using a RaspberryPi as an Amiga floppy drive emulator. All the schematics and software are available for free. The schematics are for Eagle.

Amiga RPI Drive Design

The system consists of two parts – an interface board, letting the Raspberry Pi speak to the Amiga via the Floppy connector, and the Raspberry Pi software, emulating two Amiga floppy drives. The result is a system that can hold two disks at a time, but it also sports a change button, allowing you to switch to two new disks. This lets you play large games such as Monkey Island (four floppies, 720kB each, so almost 3MB).

Posted in Raspberry Pi, Retro | Comments Off

x86 timeline

Computer World has a nice timeline of the x86 processor family.

Posted in Uncategorized | Comments Off

FreeRTOS 8.2.0 Released

freertosVersion 8.2.0 of FreeRTOS, the open source, embedded RTOS has been released. The changelog reveals all the details. Some of the details are:

  • The new task notification feature, providing a fast, lightweight mechanism for inter-process exchange of limited data.
  • Following the trend of increased system resources, more inlining is used. This increases performance at the cost of space.

In addition to kernel updates and fixes, the demos have been updated.

Posted in FreeRTOS | Comments Off

Emulator Preventing Tricks

One application of reverse engineering is the creation of emulators of old systems. This is often done to preserve the technology and to address the lack of access to functioning hardware.

One such system is the Game Boy Advance. Produced between 2001 and 2008, it is a fairly recent system. It is Arm based, has a farily small screen, a Z80 coprocessor and a relatively small RAM (256kB + 32kB + 96kB). From an I/O perspective, it is a fairly limited system, which helps. However, the cartridge system means that games are not only a piece of ROM, but can contain more functionality.

The mGBA emulator team recently posted a blog post on some of the tricks used by game vendors (in this particular case, Nintendo themselves) to prevent emulators from working. An interesting read, both from a hardware and software perspective.

Posted in Electronics, Retro | Comments Off