Last updated 9 July 2010


Cartoon of the day Copyright © J.D. "Illiad" Frazer.
A Forth-related one Copyright © J.D. "Illiad" Frazer.
Cartoon of every other day.
Tech support for your family and friends.

Back in the days when we used to send printed catalogues all over the world, there was a section in the catalogue with this title. This page is the electronic edition of that section. Please send contributions.



How many generations?


With some reluctance, we can no longer guarantee that new MPE code for Windows is fully compatible with the Windows 9x operating systems. The last PC in the building capable of running Windows 98 is about to be retired, and we have had both Vista and Windows 7 to deal with in the last few years. We can just about cope with three generations of the operating system - anything more is impossible to guarantee.

Despite that, we're not going to do anything to break Windows 9x deliberately, it's just that all reference to Windows 9x has disappeared from MSDN - references now start at Windows 2000. A number of our clients have made similar decisions. Defining Windows XP, service pack 3, as the base system seem to be a common decision.

In a similar vein, when our stock of CDs is exhausted, clients needing a physical delivery of software (as opposed to download delivery) will receive a USB stick.


ARM Cortex-M3 compiler


The cross compiler for ARM and Cortex devices is now available. Performance looks good and the code size reduction compared to ARM 32-bit instructions is real. One nice feature of the Cortex is that there is no assembler start-up code - it's all high-level Forth. Benchmark results indicate that Cortex code is about 20% faster than ARM7 code for the same clock speed with NXP LPC17xx devices.

By careful design of the assembler and VFX code generator, the compiler supports both the ARM and Thumb-2 (Cortex) instruction sets. In most cases, existing code for ARM7 devices can be recompiled with no target source code changes. The compiler is shipped with the same ARM target code as before, plus new target code for Cortex-M3 devices.

We currently have support for the STM32, NXP LPC17xx and TI/Luminary devices. Atmel and Energy Micro devices will follow. Options for Cortex-M1 and Cortex-M0 cores will follow according to demand.

See the cross compilers page.


In praise of competent chips


After several years dealing mostly with the latest ARM chips, it was something of a shock to go back to our previous standard device before ARM. In those days we used Hitachi's (now Renesas) H8/300H family for a wide range of projects. This family has had a resurgence lately in its H8/Tiny form, and Renesas are being aggressive with the pricing. The single chip 32 bit CPUs can be had (in serious volume) for less than GBP 1.00 per chip with sensible quantities of Flash and a good selection of peripherals.

The chips aren't bad at all! For devices designed down to a price, the peripherals follow the "just work" philosophy too. They may not be structured like high-end parts, but the code for them is short and some of it even worked first time!

While updating the compiler and doing the H8/Tiny port, it was a bit of a revelation to find that the Renesas chips and tools "just worked" ... and quietly. During the Cortex-M3 development (see above), we managed to break every tool chain we laid our hands on - there were quite a few. The Renesas tools aren't glitzy, but they just do the job. A very pleasant surprise.

We have started looking at another old favourite and bought a low-cost evaluation kit. The chips are probably great, but the tool-chain requires more patience than we have time for. The local FAE's reaction is to give us the top-of-the-range toys. I don't want the latest software whizz-bangs, I just want it to work.


Forth Library Action Group (FLAG)


There's a huge amount of Forth source code scattered around the Internet in one form or another. In order to coordinate the availability of library code in source form, Stephen has started the FLAG project (Forth Library Action Group). This is not an MPE project, it is done in Stephen's "ample spare time".

FLAG

If you have code to contribute, comments or criticisms, please contact Stephen directly.


VFX Forth v4.4 for Windows, Linux and DOS


The VFX Forth chassis has been running for a while and the chassis is still good. With the Forth200x standard coming up for a formal release, and with VFX Forth for Linux attracting seriously "guru" programmers, we decided it was time for an overhaul. VFX Forth 4.3 ws a "rapid technology development" release. If you are still using a v4.3 release, please upgrade to the latest v4.4 production release. All purchased VFX Forth systems, now have one year of free upgrades, so it will not cost you anything!

The major change is the replacement of the source inliner by a tokeniser. The tokeniser is simpler, generates better code and reduces problems with some "guru" code. The EXTERN: interface for calls to DLLs and shared libraries has been rewritten to support more data types including floats, doubles and long longs.


Linux console
The Linux console

The PowerNet implementation for Linux is being used for building management with the little Ebox PCs. A port of Bernd Paysan's Minos GUI tools and Theseus GUI designer provide visual interface support.

We have been very gratified by everyone's reaction to this product, not to mention the number of downloads! A console version with minimal technical support is free of charge. A download is available from the VFX Forth for Linux page. Three paid for versions are also available, varying in functionality, source code and technical support level.

With the release of the Forth 7 cross compilers, the cross compilers are available under Linux as well as Windows.

.

Lessons from the website redesign


After ten or more years of the same website design and ten years of updates, the MPE website had become old-fashioned and accumulated a great deal of "cruft". It was difficult to maintain while keeping a consistent presentation. It was time for a new chassis! All this inspired a look-around for suitable templates to start from: if reinventing the wheel is a bad thing in Forth, it certainly isn't a good idea for things outside our core disciplines.

Discussing this with the Architect one day after looking at many sites to see what I liked, she directed me one she likes, the Armitage Shanks Bluebook. As a site for busy professionals, it's a revelation in ease of navigation. After looking at the JavaScript books for too long, we concluded that some third-pary tools were a good idea. The ones we ended up with were found by the "stumble on" method of trying various phrases in search engines. If you know of better tools or other tools you think are essential, please let me know.

Colour picker

Asking a visually literate person such as any designer to sit next to you while you manipulate six-digit hexadecimal numbers by trial and error to find a colour is not a good idea! They have a very low boredom threshold. We needed a colour picker that would give us the magic numbers for the chosen colours.

We used the one from SpiceBrains. US$19.95 well spent. The Architect was happy.

Menus

I have a low boredom threshold with JavaScript, mostly because I do not use it very often. The result is that relearning the twiddly bits costs much more than just buying a bit of code. Because we saw it when looking for the colour picker, we spent another US$19.95 for the MLDDM package from SpiceBrains. You even get technical support.

The lower level packages come with a truly beautiful bit of deliberately obfuscated JavaScript. One of these days we'll buy the unlimited version with the proper source code!

HTML validator

Postel advised people writing TCP/IP stacks to be strict in what you send, and generous in what you will receive. As Bernd Paysan pointed out recently, the problem with Postel's approach to web design is that everyone has to deal with a vast amount of bad and technically invalid HTML and scripts. After doing the first VFX Forth (which was very brutal), we soon realised that we and our clients were writing better code. The motto is "crash early, and crash often". Then you will fix your bugs!

Having adopted that approach, and being on the Forth200x standards team, we could hardly take a different approach to the new website. After looking at the freebies, we went with CSE HTML Validator. Its ability to validate your whole site (including style sheets and JavaScripts) by pressing one button justifies the Pro version on its own. Non-webbies like us can use it.

An observation that initially surprised me was that some of our pages became much smaller while coping with the validator's rejection reports. On reflection, what we were doing with style sheets and JavaScript in particular was to factor our code in the same way as we should in Forth. It has the same benefits. Far too much HTML is written using "call by text editor". Now we only have to change code in one place (factor) and everything that uses it adjusts. Just as with Forth factoring, writing JavaScript in small chunks pays off. And I can understand it.


Forth meetings


Face to face meetings with people you have only met electronically are very productive.

EuroForth is consistently the best international Forth conference, attracting people from as far away as Australia, South Africa and the USA. EuroForth 2009 was held at Exter University in the UK after a very productive Forth200x standards meeting, which should see the Forth2009 standard being released as a public draft during 2010 before it goes to an standards body. After that, the process continues as a rolling draft in preparation for 201x or 202x. Details of EuroForth 2010 are now available.

EuroForth

2010 Hamburg, September 24-26
EuroForth home page
EuroForth 2010

2009 Exeter
EuroForth 2009 papers
EuroForth 2009 photos

2008 Vienna.
Papers,
Photographs.

Forth Tagung

Forth Tagung is the annual German Forth conference. It is a pleasant and relaxed experience. Details appear on the Forth-Gesellschaft web site.
Forth-Tagung.


Honesty in advertising


The excellent Swig wine merchants have a sense of humour to be envied. We recently received this from them.

Our South African pre-arrival offer is now available online.
www.swig.co.uk
Those of you that received a copy through the post, please note that there is a typographical error in the first paragraph. The wines will be delivered to you in August (not November!). Obviously, we deliberately include clerical errors of this nature in all our mailouts as a mark of authenticity. If you ever receive a Swig offer without any howling cock-ups in it, please discard it as it will doubtless be a fake.


Program Management


I have long been a fan of "Joel on Software", which is probably the most accurate (and funny) column about writing commercial software. After a blip, he has returned to form.

"Lacking a program manager, your garden-variety super-smart programmer is going to come up with a completely baffling user interface that makes perfect sense IF YOU'RE A VULCAN (cf. git). The best programmers are notoriously brilliant, and have some trouble imagining what it must be like not to be able to memorize 16 one-letter command line arguments. These programmers then have a tendency to get attached to their first ideas, especially when they've already written the code."

How to be a program manager
Columns.

If you have to release software on a regular basis, it's amazing what you find when you make a "one-button" build system. It may only be a batch file or script, but it should do everything; build the manuals, compilers and applications, generate the release folders, run the installers, and then release to your issue servers. When you write the scripts, you'll find lots of little things are just in people's heads, and if you don't do those things, the product just isn't "right".


Old printers


For many years, MPE's printing needs have been satisfied by an HP LaserJet and a DeskJet. Since most of our software is now delivered electronically, the DeskJet is not much used. Recently we had to print a CD insert. As ever, when you really need it, we had run out of ink. Two trips to local stores revealed that the colour cartridge was no longer stocked, and that if they were stocked, the damage to the company credit card would be excessive.

We eventually ended up at the local Cartridge World franchise, where one cartridge was refilled, and the other rescued! If you don't use the printer very much, the cartridge may block. Put a bit of hot water on a paper towel, stand the inky end of the cartridge on it for a few minutes, and you may well get a usable cartridge. If that fails, apply a small vacuum cleaner nozzle and repeat. Greener, cheaper and local - thank you, Terry.


New toys


In uncertain economic times, you can either clamp down on spending or try to kickstart the economy single-handed. Stephen's been buying toys. Of course, there's always a real need for them.

The little Asus Eee is a gem! A client needed a low cost laptop with a price below GBP 200, so we tried an Asus Eee. It came with Xandros Linux, which was quickly replaced by the Ubuntu Eee distribution. During the USB development it rapidly became the standard Linux box for testing. The real indicator that that the Eee is a design classic is that my wife played with it for far longer than any other computer I've ever bought.

And because a client needed his theatre lighting controllers to work with Macs, well, we just had to have one - for testing, you understand. Not because they're just gorgeous and fast, and there are other things we need one for. More expensive than a Wintel box, but impressive.


USB drivers v2


There's a category of software that can be roughly classified as "nothing works until everything works". USB drivers fall into this class. USB is one of the few jobs where buying a protocol analyser was a lifesaver. Most jobs can be debugged with a knife, fork, soldering iron and an oscilloscope. Not this one! The upgrade to version 2 of the USB software maintained this tradition as we now support Linux and Mac OS X as well as Windows, as well as virtual serial ports and composite devices. If only the Mac's USB implementation was as good as the rest of it. That was tough!

The result of all this is that we now have a layered USB driver system:

  • USB hardware driver,
  • USB core layer interfaces to the hardware layer and the class drivers,
  • Mass Storage Class (MSC) driver, as in memory sticks.
  • Communication Device Class (CDC) driver, as in RS232 serial converters.
  • Composite memory stick and serial device

It's been very nice to write this using the ARM VFX compiler and not having to write a line of assembler. We much enjoyed ourselves when Windows first went "ding-de-dong" and recognised the device as a disk drive.

For my own amusement, I rewrote the endpoint read/write routines in assembler. The result was no observable speed change in operation and only a marginal improvement in the measured time in the interrupt handler.


Forth in the press


After reading a Forth article a few months ago, Stephen got cross and in a fit of energy, sent a proposal to Dr Dobbs Journal. Within a few hours we got asked to do two articles. I was always told not to volunteer for anything! You can see the results.

Modern Forth here.
Extreme Forth here.


Debugging


I believe that the single thing that will improve code most is to teach people how to debug. The process is just formal scientific method. The second most inportant change is to fix bugs before you do anything else. The third is probably to use something like literate programming as part of writing the code - it has greatly improved our code quality, and almost always reveals bugs when we add it to incoming third-party code.

From observation of programmers, some can debug, others cannot. The majority of those who can are not great users of debuggers. If you can't observe, you can't debug. Tools that help me observe are the ones I want. When you debug a TCP/IP stack, Ethereal is much more useful than a debugger.

I once debugged a banknote sorting machine (16 bit TMS9995, a long time ago) with a pair of resistor-ladder DACs attached to the upper and lower 8 bits of the address bus and feeding a scope in X-Y mode. That told me far more about my program than any number of debuggers.

Debugging, especially for hard real time systems, has actually become more difficult rather than less over the years. These days, you can manipulate squillions of bits per peekosecond, and there's not a single pin change! And if you attach the usual invasive debugger, your peeksecond becomes a crashosecond.

Forth is a tool that greatly helps us observe a system.


Recent applications for Forth


These applications are recent uses of Forth, and the list is somewhat constrained by the tendency of clients to want us to sign non-disclosure agreements.


A Forth application you can see

Bill Codington specialises in lighting applications and software for artworks. A recent production is an animated display about the Rio Grande river. It was built using an ARM board and the MPE cross compiler. There are at least 34 separate tasks, 32 of which control lighting effects.



Pollution monitoring

The embedded software for the Total Sulfur Analyzers in the Pilot Project shown in this link was developed on a 68332 platform using MPE's 68xxx cross compiler by Alberto Pasquale at Thermo Fisher Scientific.


Vending machines

It is now possible for vending machines to brew tea and coffee with fresh milk, and to produce a cup of tea acceptable to professional tea tasters. The first trick is to prevent milk seeping into pipes and then going off overnight after the machine has been switched off. The next trick is prevent sedimentation in the boiler/heater mechanisms - it ruins the taste of tea! The final trick is to control the flow of water/steam through the coffee grounds or tea leaves, as these need a "wetting period" during which they swell before releasing flavour to the liquid. All controlled by an MPE system. Buckets were much in evidence during development.


Inside a vending machine
Inside a vending machine

A different project aims to protect vending machines from fraud by the route-men who stock the machines and empty the cash bags. Industry estimates are that each vending machine loses £2 per machine per week. There are 1.5 million machines in the UK alone, so that's about GBP 150M per year. Safer Systems, a vending machine security specialist asked us to help out. The system involves intercepting the local vending machine bus, logging the cash data, and transferring it to an RFID tag on the Custodian cash bag. When the cash bag is read, the cash value can be compared by the reader with what was actually in the bag. Reports are created and transmitted to a remote web site (designed and implemented by our sister company Remote Management Systems). Management can retrieve reports and live data directly from the web site. All the embedded systems involve Forth on ARM CPUs, and the readers use the PowerNet TCP/IP stack to access the remote web site. Sites are scalable to over 25,000 machines.


Seismic data logging


Guralp CMG-5TD
Guralp CMG-5TD

Guralp Systems (see web site make low-noise broadband seismometers, digitizers and networking equipment for science and engineering. Their new CMG-5TD is a complete seismic station in a sensor case, combining the well-regarded CMG-5T accelerometer with a full-featured CMG-DM24 to form a low-noise strong motion instrument with output over RS232 serial links, modem or (optionally) direct to local area networks over Ethernet.