Retromaster’s Electronics Projects

…related to old computers and other assorted stuff…

Posts Tagged ‘PIC18’

Cumulus Page Up!

Posted by retromaster on February 8, 2011

First of all, the Cumulus project now has a home page  :).

I’ve made a couple of important updates to the Cumulus firmware. First, I made sure that support for both Epson and Phillips LCD controllers is in place and working well (Nokia 6610 LCDs come mainly in these two flavors, as is well known now). There are a few relevant differences between the controllers, mostly in initialization of the controller and handling of screen orientation.

I also implemented bootloader support (i.e. SD card firmware update). It proved to be a little trickier than I first thought, mostly due to compiler issues and a misleading example from Microchip. The main issue was that the compiler does not actually load the table pointer for the erase operation unless you actually issue a dummy read operation first. Now it all seems to be working fine. Right now, the bootloader is larger than it needs to be (there is an embedded font I used for printing debugging messages on the LCD) and verification is missing but these are easy to fix and finalize (before a binary firmware release is made).

I’ve also populated one of the CumuluBus boards that I received and I am glad to say that it works fine.

Advertisements

Posted in Projects, Retrocomputing | Tagged: , , , , , , , , , | Leave a Comment »

Cumulus LCD Interface

Posted by retromaster on November 1, 2010

I built a user interface daughterboard for Cumulus. It contains a Nokia 6610 LCD screen and a few buttons (I haven’t installed the buttons yet). I decided to give this some priority at this point since it should be quite helpful for debugging.

I chose the Nokia 6610 screen because it’s readily available, cheap, and easy to drive with an SPI interface, with a lot of examples on the net. On the downside, it’s rather small and slow, but I think it’s still quite a bit better than using a character LCD module.

The board contains a LM2660 in voltage-doubler configuration to supply the backlight voltage. It generates 10V from the 5V input from the Cumulus mainboard, and a 120 Ohm series resistor limits the current, with the voltage drop over the backlight being approximately 7V. One interesting quirk is that, the LM2660 datasheet specifies a Schottky diode being required for oscillator startup, but in my case, it seems the diode actually prevented the LM2660 from working. I am not sure what could be the cause of this.

Another issue I had to solve (probably due to my misinterpretation of the LCD pinout) is that connecting the 3.3V pins to the 3.3V supply from the Cumulus mainboard caused the contrast to be completely bogus. Disconnecting the 3.3V supply (leaving only the backlight supply) fixed the issue.

I managed to get both the Epson and Phillips controllers to work. The built-in 18F46K20 SPI module supports only 8-bit transmission. However, the EUSART module can transmit 9 bits in synchronous mode. So, I used the EUSART module. There is one problem, though. The bit order is reversed. This is not a problem for fixed values like commands but care must be taken when transmitting coordinates or color values. It should still perform significantly better than bit banging.

Posted in Projects, Retrocomputing | Tagged: , , , , , , , , , | Leave a Comment »

Cumulus Prototype Assembly Progress

Posted by retromaster on October 13, 2010

Here is a picture of the Cumulus prototype board in its most current state. It is almost fully populated, except for the socket for the 28C EEPROM (I’ve run out of suitable sockets, it seems) and the HCT221 circuitry for MAP signal timing. The CPLD is available through JTAG and the PIC is accessible through ICSP. It took a while to get to this stage, as quite a few things got in the way and others simply went wrong… but now, everything seems to be back on track.

So, what were the problems? First of all, my JTAG Cable decided it won’t work any more… It may have something to do with all the abuse it had to withstand :). Upon building a new one, I got the CPLD connection to work. Very good.

Then I went on to trying the ICSP connection to the 18F46K20, which did not work (to my surprise). So, I spent about a week, debugging on and off, where I checked all the connections, available schematics, etc. The Microchip starter kit schematics had a 8.2V zener diode on the MCLR pin, (my first thought was that was what was missing), but it ultimately turned out to be unnecessary with the PicKit 2, as long as PIC 18F K Series configuration was selected in the software. Finally, I built a couple of very simple boards, basically only with the PIC and ICSP connector on them, just to test the connection to PicKit 2. Those boards worked absolutely fine… Another round of checking, and it turned out that the problem was a fault on the Cumulus prototype board, where the PGD pin had a tiny short to ground. I have no idea how it slipped the first time, but it did. Anyway, now, ICSP is working fine.

So, now I can proceed in two directions. I can finish populating the board, write an Oric test program to the EEPROM (something simple that prints out a text message) and test that the Oric Bus interface is working fine. I can also go on with the UI board, and get the LCD and buttons on it to work, which should be very helpful with the debugging. Hopefully, whichever path I take, things will go a bit more smoothly this time.

Posted in Homebrew PCBs, Projects, Retrocomputing | Tagged: , , , , , , , , , , , | Leave a Comment »

New Project Started: Cumulus

Posted by retromaster on September 18, 2010

I haven’t posted in a little while, mostly because I was busy working on a new project (called Cumulus). It is yet another SD/MMC floppy emulator project, but with a significant twist: It aims to emulate the WD177x/WD179x series of floppy disk controller chips (FDC), too. So, in essence, it is aimed towards certain retro-computers that originally came without built-in floppy controllers (e.g. MSX, CPC464, Oric, Spectrum, etc.). Back in the day, to add a floppy drive to these computers, the user had to install/connect a FDC card to the expansion port. Therefore, it is impossible to use a floppy emulator like TFE or UFE with these computers without the appropriate FDC expansion, which can be difficult to obtain.

There are significant advantages to integration of FDC emulation within a SD/MMC floppy emulator. First of all, there is no physical floppy disk interface (the 34-pin connector) to worry about, which means that MFM-conversion is out of the picture. Furthermore, there is no floppy disk rotation constraint to satisfy, so writes are much easier to implement and SD card performance issues pose much less of a problem.

The challenge here is that the floppy emulator needs to be directly interfaced to the host system bus, so it is difficult (if not impossible) to get away with using just a microcontroller. Consequently, a clean design dictates that the floppy emulator be host-system dependent (due to different CPU bus configurations, expansion port pinouts, glue logic, etc.). Apparently, the whole FDC card needs to be implemented within the floppy emulator.

For a first implementation (as a proof of concept), I decided to target the Oric Atmos computers… Why Oric? Well, actually, completely by chance… Right around the days when UFE was first released, I had just obtained an Oric Atmos, and a couple of people asked me if UFE could be used with an Oric, which got me thinking, and that’s actually where I got the project idea from. I found out that full schematics of the Oric Microdisc interface were available (along with dump and disassembly of the on-board ROM), and to the best of my knowledge there were no existing SD card solutions that could work with the OS software available (which is seemingly quite impressive, btw).

So, I started working on the Cumulus design. Bearing in mind all the issues outlined above, I went for a CPLD (Xilinx XC95 series) and MCU (PIC 18F series) combination for Cumulus. The CPLD will effectively implement the bus interface of the FDC chip, together with all the additional glue logic usually found on a FDC card. The MCU will communicate commands and data with the CPLD and handle SD Card access and user interface functions. I am sure it will be a difficult combination to debug, but I think I am up to the challenge :).

I have already finished the schematics and PCB layout. Right now, I am at the prototype manufacturing stage, as can be seen from the scan above. There will also be an optional UI daughterboard with an LCD. This is not absolutely required, since the Oric console can also be used effectively to control the emulator. Hopefully, the project will be successful, and it will breathe a new life into these computers.

Posted in Projects, Retrocomputing | Tagged: , , , , , , , , | 19 Comments »

MF70 CNC Control Board

Posted by retromaster on November 6, 2009

 

Here is the control board for the CNC-converted MF70. I opted for a rather simple design. It contains a PIC18F4550 microcontroller and 3 ULN2003A darlington arrays for driving the steppers. The PIC handles USB communication with the PC host, interprets incoming commands and controls the motor stepping sequences. It is probably a bit of an overkill for this kind of project but I already had some :). There is a ULN2003 per motor, implementing unipolar drive. The motors I use here are 12V, 0.6A motors and with a some current limiting a ULN2003 is able to drive one although not exactly at full torque. The whole system is powered from a 12V, 2A power adapter.

As the pictures show, I had to solder directly to the USB data pins on the board to get the USB communication working reliably. Using the on-board type B USB connector did not work very well, and I guessed that it was due to the rather long differential USB data traces on the single-sided board. To be honest, I did not pay much attention to the impedance of the USB traces and it seems this was a mistake :(. Anyway, I’ve already redone the PCB layout to shorten (and thicken) the USB traces to better meet the impedance requirements. To achieve this, I’ve rotated the PIC sideways in this new layout. I haven’t built the new layout yet, but I guess it might be one of the first PCBs I’ll build with the MF70 CNC when I get it working.

In its current state, the board can step the motors and it is detected properly as “Retromaster MiniStep” by the host OS. I decided to use the WinUSB API on the host side to avoid writing a device driver. Up until now, I tried to get USB control transfers to work with the firmware as that mode of communication seemed appropriate for this type of device. Even though control transfers with no data stage work fine, I could not get control transfers with a host-to-device data stage to work. I did examine the Microchip USB firmware thoroughly and tried several things, but without an in-depth knowledge of how USB control transfers and Microchip silicon work, I could not succeed. What makes matters worse is that Microchip firmware documentation on the subject is rather poor (and likely inaccurate), and to my knowledge none of the available device firmware examples use this kind of control transfer, which leads me to suspect that this functionality of the firmware was never properly tested. Anyway, I dropped the idea, and decided to use bulk transfers instead.

Posted in Projects, Robotics | Tagged: , , , , | 3 Comments »