2008-11-18

USB keyboard - Flight simulator control

I wanted to help friend building control panel for a flight simulator "on the cheap". I'm not much into gaming scene but it sounded a fun project, and I could use it for other projects.
The first idea that came to mind was to "hack" or "cannibalize" keyboard controller and connect it to switches. Guilherme also mentioned some sort of visual feedback when the switch is activated. For switches I thought of rocker switches, they look like made to be "air borne" all the time. I passed the "word" that I needed a keyboard to all my friends, and waited... Alex had a folding keyboard that wasn't working anymore, he gave it to me to be "sacrificed"... "may God have mercy on its soul"...

I opened the keyboard and separated the membrane, I marked lines and columns with letters and numbers respectively.
Then I wrote and identified all the keys in the membrane, so I could build a list of correspondence between key and of column, line.

Then I identified one line and one particular column, line is marked black and column is marked red. I marked the key "Q".
Then I wired a switch to the keyboard on the "Q" contacts, the second contact would be used to power the LED when the switch was activated.
Well, it didn't worked out exactly as expected... I toggled the switch and "W" appeared... connected the black wire on the wrong line...
There was another problem, once the switch is activated it keeps writing Ws, not what I intended. I would need some more electronics to translate a toggle of the switch to a single key press...
Then I decided to try another alternative, build my own USB keyboard controller. I knew of a firmware only implementation with AVR micro controllers here, since I had some AVRs in the components box I decided to give it a try.
I started with the HIDKeys project, but since I didn't have a ATmega8 I had to change the project for the ATtiny2313. I started with a breadboard version of the project once the software started running OK (being recognized by the PC), I build a small prototype board.


Development was done on the PC (SUSE linux platform) with avr-gcc and for the programming I used the AVR-ISP mk 2 USB programmer. The source is not final and there are still no switches and output indicators, as soon as I finish something I'll publish it.

2008-11-02

Formating a floppy in Mini85

My list of softwear and hardware tasks is becomming shorter by the day. That is the number of new tasks added during the week is less than the tasks I finish during the weekend...
This weekend I finished the formating function and the display help function. On the hardware I changed the regulated power supply by a home build switching power supply, I've also changed the Motor on timer to 30 seconds to reduce wear on the floppies.
I've also created a task lisk on the blog's front page so it's easy to keep track of the TO DO list on the Mini85. I think it is a good idea, to keep a todo list for each project while it is running.I'll keep a list alive and maintained until a new project comes along, then I'll do a new one.
The format routine had a few details, the interrupt routine had to be changed to support the read/write operations and format operations.

Two pictures of the switching power supply, pretty standard. An LM2575-5.0 simple switcher, a RENCO 330uH inductor with IRMS 3 Amp capability (an old sample I had) and a schottky diode 1N5819 (here the diode is only capable of IRMS 1A)...


2008-10-18

Using a CP/M Simulator

Since I started the project I started searching for CP/M simulators. In order to boot and use my system I needed a tool to build CP/M (assembling the CCP,BDOS,CBIOS and CBOOT), and transfering files to the disks. I found many that are a bit outdated here, and two great simulators with loads of cp/m software ready to run: Z80pack and SIMH/Altairz80 .

I setteld with Altair Z80 SIMH because it suited better my project. On the processor side allows you to change form the standard Z80 of most simulators to a 8080 processor, you can easily reduce the memory to 32Kb, it also has the boot disks and source (although in Z80 format) for CP/M 2.2, CP/M 3, and MP/M II. Finally and also very important, not only it supports the disk format I wanted to use (3.5 inch 1.44Mb, i.e. as used by P112) as also supports accessing the floppy disk directly.

As recommended here, I used a image file to transfer the files and then used NTRAWRITE to transfer the files to the floppy. I am using a USB 3.5 inch drive and the other usual tools to read and write CP/M disks didn't work as they used direct access to the UPD765 in regular PC.
The procedure is easy, start altairz80 and type in:
sim> set hdsk1 format=p112
sim> attach hdsk1 \\.\B:
sim> show hdsk1
HDSK1, 1474KB, attached to \\.\B:, P112, WRTENB, QUIET,
T:160/N:18/S:512
sim> go

At the moment I can only use CP/M 3 for reading and writing the disk images, because for CP/M 2.2 one needs to adapt the bios specifically for each hard disk.
When all the files have been transferred to the disk image, close the simulator and use NTrawrite to write the floppy image into the floppy.

2008-10-12

More on Electric Bikes

The electric bicycle dream is not over yet although "in times like these" one must rethink when to invest or buy something. The three essential questions in times of crisis must be answered:
- do I need it?
- will i use it reasonably? (in cases you're in debt already, the question is "can I afford it?")
- can I get a better price?

Well a better price in the drive unit is certainly needed here are the other sites I've found:
http://www.crystalyte-europe.com/
http://elektronenrad.de/
http://www.bobtec.de/

Have a great week.