Arduino interface to SD Card

Finally managed to interface to a SDcard to the Arduino. There are several "tutorials" and even libraries written for the Arduino, but my objective was not to use any Arduino library or specific feature (like the integrated SPI port), otherwise porting the code to the mini68k would be more difficult.

I started with this example (this other seems easier) and then started "removing stuff" in order to fit my purposes. I only need the basic initialize, read sectors and write sectors. In order to boot and run CP/M from an SDcard I don't even need to read/write more than a single sector as CP/M reads/writes only one sector, furthermore deblocking (breaking up a 512 byte sector into 128 byte CP/M sectors) is easily managed by most CP/M flavours (CP/M-80,CP/M-86,CP/M-68k, CP/M-Z8000).
I battled with some Arduino functions, I particular serial.print() functions. I'm suspicious that something doesn't quite add up, some of the lines of text that should be printed are skipped for no apparent reason. It could be by the fact that I directly access the port pins (DDRB and PORTB) but since I don't change the serial pins there shouldn't be a problem...
After several tries I managed to write and read a sector of the flash.

The hardware is at its simplest form, it is a basic resistive divisor by 2 for the card inputs CS, SDI and SCK, the SDO output from the card is connected directly to the Arduino input pin.
Pins CD and WP are also connected directly, the card detect(CD) and write protect(WP) switches use a weak pull up feature from the micro. A low voltage drop regulator provides 3.3V to the card.
I used the Sparkfun SDcard adaptor, but since the "freeday disappointment" I promissed never to buy from them until the EURO is >= 2x the US dollar (from that point on I would be stupid, not stubborn). The circuit used is the one of the first example above, except that I didn't bother to have the correct 3.3V input, I decided to go to 2.5V as it is easier to obtain (two equal resistors) and the input tolerance of the SDcard must accept it correctly. Usual (CMOS) input levels are at 60% (2.2V for High or 1) and 30% (for Low or zero) of Vcc (of the card).
Now I only need to port the code to the 68k...


HDSP-2000LP Arduino

A few years ago I bought some 4x 5x7 small LED displays in eBay. I though they looked really cool to be used in a front panel display, instead of using a single line LCD. The datasheet was actually easy to find but driving the display...well that's another story.
The initial objective was to incorporate these displays as front panel to the mini68k, as usual I try to prototype it with the Arduino. It ended up as being quite hard, you must compose the characters as "bitmap" graphics, then shift the 24 bits for "column" one of all the displays, then activate column one for 2ms... then repeat to column 2 to 5.
So first you must compose the combined display bitmap from the individual characters, then shift a sequence of bits and activate the respective column. To do it proper you must have in memory a bitmap for each character, compose the "screen" and the shift the bits and activate the columns in sequence.

As you can see from my first program... it didn't go well... unless you're the Predator and your personal nuke is counting down...
A few more head bangs against the wall et voilà...

Finally insanity takes over and I try to do a space invader... (the following photos are so crappy I forgot to get out of the light shade, late night)

inter character spacing is too wide to make multi-characters symbols (like infinity) unreadable... let alone the space invader that got cut in half... probably from a missile F-111...

The code is here, enjoy...