= = = DUO MEGA = = = Designed by Jack Eisenmann = INTRODUCTION = The DUO Mega is a multi core 8 bit computer featuring a robust operating system. The goals of the system are to be efficient, reliable, easy to use, and open source. The concepts of this computer should be expandable with more cores, additional memory, and alternative processor models. = HARDWARE = List of components - (x8) Breadboard: http://www.king-cart.com/phoenixent/product=SOLDERLESS+BREADBOARDS+%2526+PROTOTYPE-DESIGN+ACCESSORIES/exact_match=exact - (x2) Wire: 3051/1 BK005 - (x16) 8 bit microcontroller: ATMEGA328P-PU - (x16) 16 MHz crystal oscillator: MP160B - (x32) 20 picofarad capacitor: 140-100N2-200J-RC - (x3) Arduino Uno board for ISP, skeleton, and ethernet shield: A000066 - (x1) 32 KB SRAM: CY62256NLL-70PXC - (x6) Octal D type flip flop: CD74AC374E - (x1) Octal buffer: CD74HC244E - (x1) Octal transceiver: SN74HC245N - (x1) 512 KB Flash memory: SST39SF040-70-4C-PHE - (x1) Display and keyboard driver: http://microvga.com - (x1) Ethernet shield: A000072 A core will consist of a single ATMega microcontroller. There will be two types of core: worker core and manager core. Cores will all share an 8 bit data bus. This data bus sends commands and information between cores. A worker core may not use the data bus unless permitted by the manager core. Each worker core is addressed by an 8 bit identifier. When the machine starts up, the manager core poles every identifier to find worker cores. Then the manager loads instructions from flash memory into worker cores. The manager core may then behave as an interface for flash read and write operations. The machine will have a single pool of shared memory in a 32 KB SRAM chip. The manager core is responsible for access to shared memory. The manager core is also expected to interface with peripheral devices. Devices connected to manager core - Debug port (direct connection) - Shared memory (addressed with 2 flip flops) - Flash memory (addressed with 3 flip flops) - Micro vga (signals through 1 flip flop and 1 buffer) - Ethernet shield (direct connection) = SOFTWARE = Under the DUO Mega operating system, all programs will be written in Megaliter bytecode. This bytecode interpreted by the worker cores. Megaliter bytecode will be compiled from Megaliter source code. The user interface of the operating system is based on a stack of windows. Note that the DUO Mega only supports color text graphics. Every window will be 80 by 6 characters. Each program will run on at least one worker core. The number of worker cores allocated to a program depends on user preference. When the user opens a program, the operating system will first prompt the user for the number of cores to allocate. One window will be dedicated to the operating system. This window is called the manager window, and cannot be closed. The manager window displays program information, a clock, files, directories, and other useful information. = CORE COMMUNICATION PROTOCOL = - 8 bit data bus - 2 bit manager control (poll and status) - 1 bit worker control (status) Signals for writing from manager to worker 1. Manager puts data on the bus and raises status 2. Worker reads data on the bus and raises status 3. Manager removes data from bus and lowers status 4. Worker lowers status Signals for writing from worker to manager 1. Manager raises status 2. Worker puts data on the bus and raises status 3. Manager reads data on bus and lowers status 4. Worker removes data on bus and lowers status Manager commands A manager command begins with polling a worker by id. Then the manager sends a command name to the worker. 1 = startWorker 2 = stopWorker 3 = writeResourceToWorker [fileHandle] [amount] [data] [data?] [data?]... 4 = processWorkerCommand 5 = reportPromptValue [amount] [data] [data?] [data?]... 6 = resetWorker 7 = readResourceFromWorker [fileHandle]: Worker replies with a byte array. 8 = checkWorkerExistence: Worker replies with a 7. Worker commands A worker command is only processed when the manager sends processWorkerCommand. 0 = doNothing 1 = sendDebugValue [amount] [data] [data?] [data?]... 2 = promptDebugValue 3 = drawText [posX] [posY] [amount] [data] [data?] [data?]... 4 = drawBar [posX] [posY] [width] [color] 5 = drawImage [posX] [posY] [width] [amount] [data] [data?] [data?]... 6 = clearWindow 7 = getKey: Manager will reply immediately with a single byte. 8 = promptValue 9 = readSharedMemoryByte [index]: Manager replies with a single byte. 10 = readSharedMemoryByteArray [index]: Manager replies with a byte array. 11 = writeSharedMemoryByte [index] [data] 12 = writeSharedMemoryByteArray [index] [amount] [data] [data?] [data?]... 13 = getNumberOfAllocatedCores: Manager replies with a single byte. 14 = getCurrentCoreIndex: Manager replies with a single byte. 15 = getNumberOfFiles: Manager replies with a single int. 16 = getFileName [which]: Manager replies with a byte array. 17 = createFile [name] [size] [type]: Manager replies with an int. 18 = openFile [name]: Manager replies with an int. 19 = readFile [fileHandle] [index] [amount]: Manager replies with a byte array. 20 = eraseFile [fileHandle] 21 = writeFile [fileHandle] [index] [value] 22 = getFileSize [fileHandle]: Manager replies with an int. 23 = getFileType [fileHandle]: Manager replies with a byte array. 24 = deleteFile [fileHandle] 25 = runFile [coreAmount] [fileHandle] 26 = includeFile [fileHandle]: Manager replies with a byte array. = FILE ALLOCATION TABLE = Each entry will be 32 bytes long. There will be a maximum of 128 entries occupying the first 4 KB of flash. Entry format: [2 byte name length] [14 byte name characters] [2 byte file size] [2 byte type length] [6 byte type characters] [4 byte file address] [2 byte unused gap] If an entry is unused, the file size will be 0x0000 or 0xFFFF. = CORE SETUP NOTES = 1. Load File > Examples > ArduinoISP onto a complete Arduino board. 2. Select Tools > Programmer > Arduino as ISP 3. Select Tools > Board > Arduino Duomilanove w/ ATMega328 4. Connect complete Arduino board to core. 5. Perform Tools > Burn Bootloader 6. Connect skeleton Arduino board to core. 7. Upload sketch.