Tag Archives: Amiga

Stellaris Mod Player V2

After having issues with the latest version of Code Composer Studio from TI I decided to port this project over to Keil uVision instead. While doing so I took the opportunity to tidy up the code and add a few new features.

One such feature is auto play next module. If enabled next module in the list will play automatically. Auto play is enabled by simply placing a empty file named “autoplay.dat” in the mods folder of the SD card which is detected during power up.

Auto play WILL NOT work with all modules. To detect the end of the module has been reached the code looks for the point where the playback index equals the total song length which would normally roll back to the start of the module. If the composer has used JUMPTOORDER the module may never reach the end. There is no way to determine if the jump is legitimate or the end of the module has been reached.

Source and project files compatible with Keil uVsion V5 are all available in my GitHub account along with pre built images in binary and hex format.

 

There’s life in the old dog yet…Part 3

After a bit of reading around the subject it appears the majority of Amiga video problems are either related to issues with the RAM or the Agnus (Address Generator) chip. The RAM chips are all soldered directly into the board so I re-soldered all of those and still the same issue.

Then I remembered when I first got my brand new Amiga back in the day the first time I plugged it in I had a similar issue. I phoned the computer shop where I had bought it and they said “Its most likely because one of the chips is not seated correctly in its socket. Unplug every thing and hold it flat about two inches above a soft surface (like carpet) and then drop it”. You can imagine my horror. But they assured my if it didn’t work they would replace it with no issues. Much to my relief at the time it worked.

The Agnus chip sits in a 84 pin PLCC socket so I removed Agnus from her socket and set to work re-soldering all of the pins. I reseated Agnus and put everything back into the case before reapplying the power. Much to my relief it appeared to work and since the floppy emulator was still connected it booted straight to the Amiga Pi Drive front end.

Using Maurizios Amiga Pi Drive emulator couldn’t be simpler. The front screen shows a list of all of the ADF (Amiga Disk File) and ADZ (compressed ADF) files found on the SD card. Four floppy drives are shown on the right. The interface only supports drives 0 and 1 (SE0 and SEL1 lines from the motherboard). Drive one may be disabled if you wish to fit a real drive.

Amiga Pi DriveEach drive can be loaded with a number of ADF or ADZ files. The first file in each drive drive will be loaded when emulation is started. For all intents and purposes the Amiga sees a real floppy in this drive and begins to boot it. Pressing the “Change” button loads the next file in the list into the drive. If changes are made on that drive pressing the “Write” will write the contents back to the file on the SD card.

Imgp0746The internet is rife with Amiga emulation sites so finding all my favourite games wasn’t difficult. I downloaded a few I put them on the SD card. Then it was just a case of reminiscing those good old 16 bit classics. I must admit though playing games on my old Cruiser joystick felt a bit alien after playing with modern console controllers. Still the playability of the old Amiga games still win hands down in my opinion.

 

There’s life in the old dog yet…Part 2

Stop the press. After going down the avenue of replacing the internal floppy drive for a few days (found a couple on eBay but who’s to say these aren’t going to fail in the near future after all these things are over 20 years old) it dawned on me there must be a more up to date solution.

I know some of the later Amiga models the 600 and 1200 featured a 44 pin ATA connector allowing for a 2.5″ internal hard drive to be fitted. And with a suitable connector this hard drive may swapped out for a compact flash (CF) card or I believe even an SD card with the correct hardware upgrade. Unfortunately this is not an option on the old Amiga 500.

The only option appears to be a floppy drive emulator something like Lotharek’s Floppy Drive Emulator. Which allows you to load Amiga Disk Files (ADF) from an SD card or USB mass storage device. Again these are pricey with Lothareks emulator retailing at around 70 euros!!!

So I was toying with the idea of purchasing a second hand drive from eBay when I stumbled upon a floppy emulator a guy (Maurizio Ramondo) had designed for his Amiga 500 using a Raspberry Pi. Like a lot of people I bought a Raspberry Pi when it was first launched. Up until now all its been doing is running Xbox Media Center under my TV.

InterfaceThe Amiga RPI Drive connects GPIO lines from the Raspberry Pi to the Amiga floppy connector via an interface board which takes care of all of the level shifting. The floppy drive I/O being 5V and the Raspberry Pi GPIO being 3.3V. I redrew Maurizios original schematic just for my own benefit. I wanted to have a 26 pin socket so I could connect a ribbon cable from the Raspberry Pi directly to the interface.

The circuit is fairly simple. Each input line is pulled high and then passes through a voltage divider to bring the level down to a more reasonable 3.3V for the Pi. The outputs from the Pi go through a 74LS06 open collector output inverting buffer allowing the signals from the Pi to be pulled up to 5V by the Amiga. The 5V supply voltage is supplied from the floppy drive power connector on the Amiga motherboard. The RDY line is managed directly by the interface and is used to help protect the bus when there are external drives disabling the CHNG line and the DKRD line. The remaining lines are all under software control. The interface only supports two drives since only the SEL0 and SEL1 lines are brought out on the floppy connector. The second line, SEL1 can be disabled via a switch allowing a real external floppy drive to be connected. Maurizio recommends that a Raspberry Pi Model A is used since the Amiga is only able to supply approxitaely 550 mA whereas the Model B he claims draws around 700 mA under certain conditions.

Img_3435Because of the strict timing required to emulate Modified Frequency Modulation (MFM) used by the Amiga floppy drive Maurizio does not use the Linux kernel. Everything was written from scratch. I wont go into any more detail if you want to know more then I suggest you visit his website. Maurizio even provides an SD card containing the kernel and all the files required to boot the Raspery Pi. The SD card even includes a copy Xcopy III allowing you to rip your own disks as well.

The more observant are probably thinking there seems to be a distinct lack of connections. The remaining interconnections are all made underneath the board so the rats nest of wires is hidden from view.

Using the emulator is fairly straight forward too. On power up the emulators front end is loaded. This allows you to queue any number of ADF files into a specific drive. The user then selects the play button and the first disk in drive 0 is loaded. The interface has two switches “change” and “write”. The change switch swaps to the next the disk in the drive. The “write” switch writes any modified disk contents back to the the ADF file on the SD card.

Img_3441After removing the internal floppy drive I was originally going to extend the internal floppy drive and power cable out of the side of the Amiga where the floppy disk slot is. Hence the reason for all of the switches being fitted to the strip board. But after removing the drive it seem to make more sense (space permitting) to mount both the interface board and the Raspberry Pi in place of the original floppy drive. To my surprise it all fitted. I did have to remove the shielding  over the motherboard so I am hoping I don’t have and EMI issues. I then mounted two more push buttons for the “Change” and “Write” functions and a toggle switch for disabling the second drive and fed the connections back to the interface board.

With the interface board completed, the kernel copied to an SD card and everything fitted into the Amiga case I powered everything up. The Pi appeared to power up fine however now all I get on the display is a green screen. Well its too late now so this is going to have to wait for another day. No one said working with these retro machines was going to be easy.

 

There’s life in the old dog yet

After a recent trip to my parents house and being gently persuaded to take all my old “junk” with me I found my trusty old Amiga tucked away in the loft complete with old boxes of disks. The case had severely yellowed which seems very common with these old computers.

Img_3423

Back in the day I spent my formative teenage years virtually glued to the keyboard of this thing. After the initial infatuation with playing games had worn off I taught myself 68000 assembler and started writing utilities and demos which I guess with the exception of writing a bit of BASIC on my old Amstrad CPC 464 was my first real venture into programming.

So fast forward 20 plus years would it still work ? The first thing I did was take it apart. Just to check everything was still in one piece and check nothing had been damaged. Now being designed when it was all components are through hole. No surface mount in here. Img_3426The majority of the chips are all socketed with the exception of the memory. Everything looks good a bit of dust but that’s about all. Even the battery on the memory upgrade seems to be good a tiny bit of leakage but not enough to have damaged anything.

Initial power up was fine. The red power LED illuminates and the internal floppy starts clicking. So far so good. After connecting the AV-scart lead to my 40″ Samsung LCD TV no picture. Just a white screen. Not good. In the past I had always used an old 15″ Sony CRT TV/monitor which has long gone now. However after rummaging through the box of peripherals I found the original TV modulator. Feeding the composite video from the modulator to a scart-phono adaptor worked just fine. Few so there doesn’t appear to be anything wrong with the Amigas video output stage.

So how am I going to get a decent (ish) picture on a modern LCD TV ? I guess there are a number of options. A lot of people use scan doubler/flicker fixers. Something like the Indivision ECS scandoubler from Amigakit.

Img_3430This simply slots into the video chip (Denise) socket and runs a 15 pin SUB plug to provide VGA output up to 1024×768. There are also a number of scandoublers on eBay that appear to be based on the CGA/EGA/YUV to VGA converters I used in my Weecade arcade machine. Both these options retail for around £80 which is more than I really wanted to spend just to get an old computer up and running.

After a bit more googling I found an article talking about the signal voltages on the video port. It seems these voltages may be too high for most modern TVs. The SYNC signal from the Amiga is apparently around 4.8V peak-peak. Which makes sense if the Amiga is running 5V TTL throughout. Modern TVs expect a synch signal on the composite video or synch on green with a peak voltage of around 1V peak-peak. Since they would probably be operating at 3.3V/1.8V levels. The composite synch input has a 75R terminator which when coupled with a 330R resistor along with the 47R inside the Amiga gives a SYNC voltage of around 1V peak-peak.

So I connected a 330R resistor between pin 10 of the Amiga video port (TTL synch) and pin 20 of the scart lead (composite video). For each of the colour signals Red, Green and Blue I added a 220uF electrolytic just to block any DC bias on those signals. The AV mode signal (pin 8) on the scart was fed from the 12V signal on the video port via 1K resistor. The RGB mode signal (pin 16) was fed from the 5V signal on the video port via a 75R resistor. The logic grounds (pin 13 video port, pin 18 scart) were connected together. The remaining video grounds on each connector were tied together. The audio signals from the scart to two phono plugs was left untouched. Again a couple of small electrolytic capacitors could have been added but I choose not to bother.

After hooking everything backup and firing up the Amiga the iconic start-up screen appeared in all its glory. First hurdle overcome.

With everything up and running I tried booting from the original workbench disk. After inserting the disk the drive starting making some rather strange noises the AmigaDOS screen appeared but then the disk error dialogue appeared soon after. After trying a hand full of other disks it became clear the drive has had its day.

Time to find a replacement internal floppy drive.

 

Stellaris Mod Player

I while ago I bought a couple of Stellaris® LM4F120 launch pad evaluation kits. I really wanted to play around with the ARM processors and the Stellaris offers and extremely low cost introduction. This board features a  LM4F120H5QR ARM® Cortex™-M4F processor with 256KB of flash memory, 32KB of RAM, 2KB of EEPROM, two 12-bit analog to digital converters, a USB 2.0 device port, a hibernation module, other serial connectivity and flexible GPIO. The board comes with on-board emulation, which means you can program and debug your projects without the need for additional tools. All this for around £10.

Support for these boards on-line is huge both from Texas Instruments and from other people who have been using them in their own personal projects.

My boards have been sitting in my drawer for months I had used them initially but only running the test code under debug and familiarising my self with the tool set and the StellarisWare library (an extensive suite of software designed to simplify and speed development of stellaris-based microcontroller applications).

One project that did catch my eye was a MOD player a guy named Ronen K had implemented on his Stellaris Launchpad. The player had been ported from another project based on a Microchip PIC32 by Serveur perso.

You can see Ronens work on his blog here and here.

What really impressed me is the audio is generated from driving the GPIO pin with a PWM signal. According to his blog Ronen spent a fair amount of time redoing the PWM/timer code to get it to work on the Stellaris and the timing is fairly crtical. But wow it sounds awesome. A small LC filter (10 Khz cutoff) was added to help improve the audio.

For those who don’t know the MOD file format is a file format used to represent music. The format was very popular on the Commodore Amiga. Having had an Amiga as a teen I really wanted to relive some of those old memories.

Once I had Ronens code up and running playing files from the SD card I decided to add a 1.8″ TFT display module I had lying around. This allowed my to have a menu showing all of the mod files found on the SD card. The user could then choose which file to play. The display also shows some basic information such as the mods title, number of patterns etc all extracted from the mod file being played.

Check out the video to see it in action. Gives you a warm feeling hearing some of those old demo tunes again. The Amiga really was an awesome bit of kit.