Introduction: Z80-MBC2 Programming the Atmega32a

Before you can use the z80-MBC2, later building it, you take to program the Atmeg32. These instruction show you how to use a cheap arduino mini as a programmer to upload the code.

Supplies

Your z80-MBC2 display board discriminate and freshly reinforced willing for the atmega32a

An arduino mini (or whatever version you get hanging around)

The software for the atmega32 from https://hackaday.io/visualise/159973/files

Add stomach for the Atmega32 chip from https://github.com/MCUdude/MightyCore

Maltreat 1: The Programmer

I used a dedicated Arduino miniskirt clone. I well-stacked this into an ICSP coder a age ago and use IT for all sorts. Mostly uploading boot loaders (Eastern Samoa we will instantly)

You can make your own version either dedicated or temporary using any Arduino board (328A or to a higher place). You program your board using the Arduino-IDE. The software for the ICSP coder is found below the file, examples menu, search ArduinoISP. Open the object lesson and upload the computer program to your board.

Next you need to connect the pursuit pins to the ICSP header on the MBC2. Use 6 female-to-male Beaver State female-to-female, depending connected the arduino you are using, connector leads, connected like this (also run into pinout above).

For some Arduino boards the pins may vary, read the notes at the top of the inning of the sketch you scarce uploaded or see https://www.arduino.cc/en/Instructor/BuiltInExample... many more pages exist to help you key out the correct pins.

Arduino	Name	ICSP 10	Readjust	5 11	MOSI	4 12	MISO	1 13	SCK	3 GND	Gnd	6 +5v	Vcc	2

Step 2: Connecting to the Z80-mbc2

Tone closely at the MBC2 board to identify pin 1(MISO) on the ICSP. Join your wires from the programmed Arduino Miniskirt to each PIN happening the MBC2 header.

IMPORTANT: Earlier powering the board up hit the SD-CARD and REAL Clock Time modules. Likewise disconnect any USB serial connections you may feature. The only connections to the MBC2 are to the ICSP header.

Step 3: Bring Support for the Atmega32 Chip

It's now time to download the confirm pack for the atmega32, you can economic consumption the board manager as described on the developers github site https://github.com/MCUdude/MightyCore#boards-manager-installation

Care this:

  • Susceptible the Arduino IDE
  • Open the File > Preferences menu particular.Go in the following URL in Additional Boards Managing director
  • URLs:https://mcudude.github.io/MightyCore/package_MCUdude_MightyCore_index.json
  • Open the Tools > Board > Boards Handler... menu item.
  • Wait for the platform indexes to finish downloading.
  • Scroll down or usance the search option to find MightyCore until you see the MightyCore entry and clink on it.
  • Click Install.
  • Afterwards installation is perfect short the Boards Director window.

Step 4: Combust the Boot Loader

Earlier you select the Atmega32, make sure you have selected the programmer to manipulation,

Tools menu, Computer programmer, choose arduino as ISP.

You can now use the Arduino-IDE to pick out the Atmega32 silicon chip ready to upload the bootloader.

From the Tools menu, choose Board, MightyCore, then Atmega32

Now you should be healthy to upload the bootloader,

Choose Tools, Burn Bootloader.

When it's finished the green LED should make up doing a look-alike flash, this indicates the bootloader is waiting to be told what to boot. You may demand to press readjust to get this.

Your ready and waiting to upload the actual sketch exploited in the MBC2 board, now the bootloader is installed you can upload the MBC2 software directly to that, now you have a bootloader you give notice likewise upload any future upgrades using the stairs to a lower place.

Power off (unplug the programmer) re-connect your USB sequential cable. You don't need to use the ISP programmer to double-dyed the upload from now on.

Step 5: Program the MBC2 Software

Fix the latest reading of the package from https://hackaday.io/project/159973/files

It will be named something like, S220718-R240620_IOS-Z80-MBC2.zip. There are 2 versions, this nonpareil and one called 'lite' the lite one does non support booting from the SD-Card.

When you unzip it make a point it's all in a folder by the cookie-cutter name as the zip file cabinet, this is the default for most unzipping utilities.

Nonunion the ino file in the Arduino IDE

Cause sure you cause the objurgate board chosen in the Tools, Board menu. Atmega32. Also check mark that the USB port is selected and the correct defaults like the picture above.

You can now click -> (compile and upload) to plan the Atmega32a.

All done

Step 6: Trouble Shot and Comments

To that extent,

I take in used 3 different variants and managed to get this technique to work will all of them, merely some required extra work:

Mini Clon:

Works as is or leastwise mine does!

Micro clone:

Non sure this is an official board. it's in essence a mini but without the aboard USB adapter. This seems to have got the readjust come out, you can leave the DTR cable from the USB/TTL adapter disconnected, so preventing the reset.

arduino duemilanove:

Again this control panel has the readjust issue, and as umteen else have already same, you postulate to add a 10-25uf capacitor between the reset fall on the circuit card and ground.

Power issue:

Some clones don't seem to provide enough on-going happening the 5v supplying to power the Z80-mbc2 and themselves resulting in random errors. It the briny tutorial it's suggested you get into't connect the usb/ttl twist during programming (the main ttl connexion not the one on the programmer). But to help with power you can connect this, but fair-and-square the +5v and 0v pins, then male plug both usb plugs into the horde computer. This may help with random errors.

Be the First to Plowshare

Recommendations

  • Anything Goes Contest 2022

    Anything Goes Contest 2022