Arduino Mega 2560shared SRAMProcessor1(ATmega328P)Processor2(ATmega328P)Arduino Nano(DDU)
| parts type | name | number |
|---|---|---|
| MCU | Arduino Mega 2560 |
1 |
| MCU | Arduino Nano |
1 |
| MCU | Atmega328P (DIP) |
2 |
| Memory | 62256 SRAM |
1 |
| IC logic | 74HC245 |
4 |
| IC logic | 74HC595 |
2 |
| IC logic | 74HC04 |
1 |
| IC logic | 74HC125 |
1 |
| IC logic | 74HC165 |
2 |
| Oscillator | Active Crystal 16MHz |
1 |
The BPU is based on Arduino Mega 2560. BPU receives binary and program(load) to RAM(62256 SRAM)
Processor 1 is the first processor based on Atmega328P. It fetches and executes instructions from shared RAM, controlling data access through bus mastery.
Processor 2 is the second processor based on Atmega328P. It alternates with Processor 1 to execute instructions using shared RAM.
The DDU is the data display unit, using Arduino Nano to display system status or outputs.
Your Computer:
Code -> Compile -> Binary -> Arduino Mega 2560(BPU)
Arduino Mega 2560(BPU):
Binary -> Dual328P
- Processor1,2
RESET PinLOW (use:rstpython compiler.py COM6 --monitor) - Load Binary(8bit) in RAM (kill the Serial Monitor and
python src/BPU/compiler.py <filepath> <port> <bank> <page> -b) - Processor1,2
RESET PinHIGH (use:runonpython compiler.py COM6 --monitor)- -> Processor starts.
-
Processor 1AcquireBus Mastery(Processor 1 PC4LOW; also RAMA14on that net)
-
Processor 1Read Data from62256 RAMand processing Instruction Fetch & Execute
-
Processor 1releaseBus MasterytoProcessor 2(Processor 1 PC4HIGH)
-
Processor 2Read Data from62256 RAMand processing Instruction Fetch & Execute
When you use Active Crystal(Oscillator), You need to configure the Fuse Bits to enable clock output on Processor 1 and Processor 2.
If you don't have an active crystal, you can use this method(both methods need to configure fuse bits unless you use Passive Crystal.). This section explains how to configure fuse bits using only Arduino without a separate oscillator or active crystal to set up 16MHz generator and read mode.
-
Connect the Uno (A, programmer) to the PC via USB.
-
In Arduino IDE, select File > Examples > 11.ArduinoISP > ArduinoISP and upload it to the Uno to be used as programmer.
-
Connect the programmer Uno (A) and the target ex)Nano (B) as per the table below:
| Programmer Uno (A) | Target (B) |
|---|---|
| D10 | RESET |
| D11 | D11 |
| D12 | D12 |
| D13 | D13 |
| 5V | 5V |
| GND | GND |
-
Connect the computer and the programmer Arduino (A) with the upload cable.
-
Windows Environment (PowerShell)
Change to the avrdude directory:cd "C:\Users\user\AppData\Local\Arduino15\packages\arduino\tools\avrdude\8.0.0-arduino1\bin"Verify connection:.\avrdude.exe -C ..\etc\avrdude.conf -c avrisp -p m328p -P COM3 -b 19200 -v
Note: Ensure the COM port (COM3) and baud rate (19200) are consistent with your setup.
Show the FuseBit Set:.\avrdude.exe -C ..\etc\avrdude.conf -c avrisp -p m328p -P COM3 -b 19200 -U lfuse:r:-:h -U hfuse:r:-:h -U efuse:r:-:h
Set 16MHz clock out:.\avrdude.exe -C ..\etc\avrdude.conf -c avrisp -p m328p -P COM3 -b 19200 -U lfuse:w:0xBF:m
Set clock read mode:.\avrdude.exe -C ..\etc\avrdude.conf -c avrisp -p m328p -P COM3 -b 19200 -U lfuse:w:0xE0:m
Set default:.\avrdude.exe -C ..\etc\avrdude.conf -c avrisp -p m328p -P COM3 -b 19200 -U lfuse:w:0xFF:m -U hfuse:w:0xDA:m -U efuse:w:0xFD:m
- Connect the BPU to the PC.
- Write code in your PC, compile to binary and send to BPU.
- BPU will load the binary to RAM.
- when you use
:runto BPU, Processors will start to work.
Overview of this repository (Arduino sketch folders follow the usual FolderName/FolderName.ino layout):
Dual328P/
├── LICENSE
│
├── PinManual.md
├── README.md
│
├── .vscode/
│ └── settings.json
│
├── examples/
│ ├── bench/
│ │ ├── single.asm
│ │ ├── dual_0.asm
│ │ ├── dual_1.asm
│ │ └── write_single_vs_dual_bench.py
│ │
│ │
│ ├── simple_examples/
│ │ ├── test1.asm
│ │ ├── test1.bas
│ │ ├── test2.asm
│ │ └── test2.bas
│ │
│ └── upload_test/
│ ├── bench32K.asm
│ ├── bench16K.asm
│ └── write_bench.py
│
│
├── modifiedISP/
│ └── modifiedISP.ino
│
└── src/
├── BPU/
│ ├── compiler.py
│ ├── BPUmega/
│ │ └── BPUmega.ino
│ └── BPUnano/
│ └── BPUnano.ino
│
├── DDU/
│ ├── DDU128x64/
│ │ └── DDU128x64.ino
│ └── DDU16x2/
│ └── DDU16x2.ino
│
├── SMU/
│ ├── SMUeditor.py
│ ├── SMUmega/
│ │ └── SMUmega.ino
│ └── SMUnano/
│ └── SMUnano.ino
│
└── VMF/
├── proc1VMF/
│ └── proc1VMF.ino
└── proc2VMF/
└── proc2VMF.ino
This project is under the GNU General Public License v3.0 license. See the LICENSE file for details.
-
Third-Party Credits: Modified ArduinoISP: This project includes a modified version of the ArduinoISP sketch.
Original Author: Copyright (c) 2008-2011 Randall Bohn (BSD License).
Modifications: include 8MHz clock output on D9.
The original copyright notices are preserved in the source code as per the BSD license requirements.