![Smile :)](./images/smilies/icon_smile.gif)
I'm a french guy living in France and I would like to share with you a little device I've done after browsing many very interesting Oric forums topics.
=> NB: a french translation of this text is included in the zip file below.
First, I would like to thank, for their inspiration and code examples:
- Daniel Coulom and his SDLEP READER (http://dcmoto.free.fr/bricolage/index.html)
- Lutz Lisseck and his SimpleSDAudio library (https://www.hackerspace-ffm.de/wiki/ind ... pleSDAudio)
- Fabrice Broche for his excellent book "L'Oric à nu" (I still have mine
![Smile :)](./images/smilies/icon_smile.gif)
Oric-1 was my second computer when I was a teenager (the first one was a ZX-81 !)
![Smile :)](./images/smilies/icon_smile.gif)
But now, after many technological improvements, it's possible to quite easily read a SD card using a simple Arduino board for a cost of only a few euros !
So I've done this device which links a micro SD card, an Arduino Nano board and the Oric via the printer port (using the expansion port would require more logic circuits for decoding) and load quickly and easily classic ".TAP" files for Oric.
=> REQUIREMENTS:
================
- An Arduino Nano (or equivalent) based on an Atmel 328 (to have enough input/output ports) with its USB cable in order to connect it to a computer and program it.
- A micro SD card board INCLUDING a voltage regulator (to convert 5V into 3.3V).
- A micro SD card (the smallest possible as an Oric file is just a few Ko's !).
- A LCD display 2 lines of 16 characters (to display file names and messages).
- A classic TTL 74LS244 buffer. It should also work with a more recent 74HC244.
- Four push buttons (I used a micro joystick I had since many years which was waiting to be useful one day. Your time has come little joystick !
![Smile :)](./images/smilies/icon_smile.gif)
- Four 4.7 Kohms resistors and one 1 Kohms (for the buttons).
- One 220 ohms resistor for the LCD backlight and one 1.5 Kohms for the contrast.
- A 2x10 pins connector for the Oric printer port.
- A short 20 conductors cable.
- A 11 single row male strip. You can use a larger one and cut it to 11 pins.
- A 830 (min) points breadbord with its cables.
Here are some examples references:
https://www.ebay.fr/itm/1276-ATmega328P ... 1012223048
https://www.ebay.fr/itm/1007-Micro-SD-C ... 0966700407
https://www.ebay.fr/itm/1182-1602-16x2- ... 0983523750
https://www.ebay.fr/itm/1038-40-Pin-2-5 ... 1022505442
https://www.ebay.fr/itm/1324-MB102-Brea ... SwfCZZ2QPX
And other components can be buyed on online or physical electronic components stores.
You will need also:
- The Arduino code below to manage the SD card file list and send the selected file to the Oric.
- The Oric-1 patched ROM below. NB: For the moment only Oric-1 version (as it is the most compatible with games).
So you will need a 16Ko 27128 eprom component too and a way to program it.
Another option is to enter into the Oric the loader code below but it's quite tedious to do...
=> But maybe someone will be able to reduce its size ?
Regarding this point, as I have an eprom programmer (this model is working very well: [url]https://www.ebay.fr/itm/SPECIAL-OFFER-T ... pXV~PB[url]), I don't have yet decided in which way the loader code could be stored without patching the ROM.
=> Don't hesitate if you have some interesting suggestions !
And that's it !
I have assembled all the modules together on a breadboard. Ideally the next step would be to solder them together on top of each other in order to have a compact module that can be clipped at the back of the Oric with the LCD display on top. Or else to make a small printed circuit board if someone is used to do this.
Find the schematic below (thanks to Fitzing).
=> SOME COMMENTS (please read carefully):
=========================================
The Arduino Nano 328 board:
---------------------------
-> 30 Ko of FLASH for programs. Only a third is used currently, so plenty of room for improvements.
-> 2Ko (only!) of RAM, so 50 files could be loaded in the list max for the moment, as there are only 1 Ko remaining for the directory table.
=> Maybe someone has an idea on how to manage more files ? manage file blocs ??
-> 14 digital IO (D0..D13):
- TX(D)1 and RX(D)0 are already used by the board for USB communication. Fortunately they have a 1 Ko resistor pullup. So I reused them for Strobe and Ack signal with the Oric. BUT YOU HAVE TO DISCONNECT TEMPORARELY RX0 FROM THE STROBE PIN TO PROGRAM THE ARDUINO otherwise it fails ! A switch can be added on this pin.
- D2 to D7 are used for the LCD display.
#define pinLCD_E 2 // Enable
#define pinLCD_RS 3 // Register Select
#define pinLCD_D4 4 // Data 4 (4 bits configuration)
#define pinLCD_D5 5 // Data 5 (4 bits configuration)
#define pinLCD_D6 6 // Data 6 (4 bits configuration)
#define pinLCD_D7 7 // Data 7 (4 bits configuration)
- D8 and D9 are used for the printer data (see below why).
- D10 to D13 are used for the SD card communication.
#define pinCS 10 // pin CS (SS) SD card (SPI)
// Pin 11 pin MOSI pour SD card (SPI) by default
// Pin 12 pin MISO pour SD card (SPI) by default
// Pin 13 pin SCK pour SD card (SPI) by default
-> 8 analog IO (A0..A7):
- Fortunately these can be configured as digital IO, BUT NOT FOR A6 and A7
![Sad :(](./images/smilies/icon_sad.gif)
- A6 and A7 are the only remaining pins for the buttons but they are analog. So there are connected on a 5V voltage divider. 2 resistors splits the voltage. The buttons are grouped by 2. When no button are pressed A6 and A7 read approximatively 1.9V. If "UP" is pressed for example, then one resistor is shorted and the voltage increases to 3.4V (not 5V as there is also a protection resistor). If "DOWN" is pressed then the other resistor is shorted and the voltage decreased to 0V.
#define pinOUT0 A0 // Data 0 (output)
#define pinOUT1 A1 // Data 1 (output)
#define pinOUT2 A2 // Data 2 (output)
#define pinOUT3 A3 // Data 3 (output)
#define pinOUT4 A4 // Data 4 (output)
#define pinOUT5 A5 // Data 5 (output)
#define pinOUT6 8 // Data 6 (output. Using D8 as A6 an analog input only)
#define pinOUT7 9 // Data 7 (output. Using D9 as A7 an analog input only)
#define pinACK 1 // "Ack" Oric = CA1. TX1 (OUT). If = 0 then data ready to be read by Oric
#define pinSTROBE 0 // "Strobe" Oric = PB4. RX0 (IN). Used as a more simple "Busy" signal actually. If = 0 then Oric is ready to receive data
- The Oric SD card board is currently powered by the USB cable. An additional wire should be added to get the +5V from the Oric expansion port.
The Oric printer port:
----------------------
- The printer port (actually the VIA 6522 chip) is setup as an input port (and not an output port).
- The Strobe pin is set by the Oric and used as a Busy signal which is simpler to manage than a Strobe signal. The Strobe pin is actually connected to the PB4 (B port) of the 6522.
- The Ack signal is set by the Arduino board when data are available in the buffer.
- Strobe = 1 => Oric is not ready.
- Strobe = 0 => Oric is ready to receive data.
- Ack = 1 => Not data available in the buffer.
- Ack = 0 => Data (one byte) are available in the buffer. Ack is set to 0 for a short period (100 micro secondes). Be careful it cannot be reduced too much or the Oric will not have enough time to read the data.
- The loader:
----------------
I first wrote the little assembler loader program on the Oric in order to be able to receive data. Then I decided to patch the Oric ROM so the CLOAD function can be used as usual except it will read data on the printer port.
What the loader is doing:
- Disable interrupts.
- Configure the Ack pin (actually the 6522 CA1 pin) to detect a "falling" edge (1 to 0 transition).
- Configure the printer port (actually the 6522 A port) as an input port.
- Display "Searching..."
- Receive the start of the file (0x16, 0x16, 0x16).
- Receive the synchronisation byte (0x24).
- Receive the file header (file name, start address, end address, file type: Basic or ML, auto or not).
- Display "Loading..." + file name.
- Receive the content of the file until the end address is reached.
- Reenable interrupts.
- Launch the loaded program (if auto) or return to Basic prompt.
=> AND NOW HOW TO USE IT
![Smile :)](./images/smilies/icon_smile.gif)
==============================
Buttons:
UP => previous file in the list
DOWN => next file in the list.
RIGHT => send the selected file !
LEFT => shut down the SD card properly.
- Connect the device to your Oric printer port.
- Format the micro SD card in FAT32 (FAT16 should work too). File fragmentation is not supported. Avoid delete and add files. Reformat the SD card instead (very quick) and copy your files onto it.
- Copy a max of 50 (see above why) Oric "XXXXXXXX.TAP" files on it. Only short names (8 + 3) are supported so rename them if needed (before doing the copy).
- Remove the SD card and insert it into the SD card board.
- Connect the Arduino board to a computer via USB, open the Arduino program into the Arduino IDE and compile it as a check. With the current version of the IDE 1.8.5, it should compile without any issue as all the code is within one file.
- Disconnect RX0 from Strobe (see above why).
- Program the Arduino. It should reboot and the LCD should display "Loading dir...", then the first 2 files found. NB: All this process has to be done only the first time of course.
- Reconnect RX0 to Strobe (see above why).
- Browse the list with the "UP" and "DOWN" buttons.
- Turn your Oric on. Enter CLOAD"" and hit RETURN. You must have the patched ROM so the Oric will read data on the printer port instead of the cassette port.
- Oric should display "Searching...".
- Send the selected file with the "RIGHT" button.
- The message "Sending..." + size of the file should be displayed on the LCD. There is a timeout (2 min.) if the Oric is not responding.
- Oric should display "Loading..." + file name.
- Usually it takes less than 5 (!) secondes to load a file. As a bonus it works also with multi part files as long as they are calling the CLOAD function in the ROM and the timeout is not reached.
- The message "File sent !" should be displayed on the LCD.
- The program should start automatically on the Oric (if it's an AUTO file, for example a game).
- When you have finished or if you want to change the SD card content, don't forget to shut down properly the SD card with the "LEFT" button to avoid data corruption !
Here is a demo:
Now you can play again to l'Aigle d'or and many other hits !
Enjoy !
![Smile :)](./images/smilies/icon_smile.gif)
EdL