Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for the Minicommand hardware #32

Merged
merged 32 commits into from Jun 22, 2019
Merged

Add support for the Minicommand hardware #32

merged 32 commits into from Jun 22, 2019

Conversation

jmamma
Copy link
Owner

@jmamma jmamma commented Jun 17, 2019

In order to achieve this, we must:

MCL Changes:

  1. Modularise the MegaCommand code such that we can turn off features to save space.

Core changes:

  1. Change timer code/ports to be compatible with ATMEGA64
  2. Adjust UART ports for Minicommand (megacommand port names are offest by 1)
    Minicommand does not have a second transmit port so we can disable this.
  3. Specify SD Card pins for Minicommand
  4. Specify LED pins for Minicommand
  5. Re-enable boot_loader interrupt/sysex listener for firmware recieve via midi.
  6. Adjust stack memory requirements:

The ATMEGA64 processor only has 4KB of onboard SRAM where as the MegaCommand has 8KB.

We can't use a stack size of 8KB with the ATMEGA64 as the upper 4KB will be unavailable when switching memory banks,

@jmamma
Copy link
Owner Author

jmamma commented Jun 17, 2019

Timer code looks like it is compatible across micro-processes.

I've specified the SD Card pin and correct LED config

@jmamma
Copy link
Owner Author

jmamma commented Jun 17, 2019

Timer code needs to be looked at. Timers are not identical.


I think we're around 80% complete on getting the core to compile for the minicommand.

Adjusting the MCL firmware will be another story.

@jmamma
Copy link
Owner Author

jmamma commented Jun 20, 2019

This compiles and links.

However, when using the Makefile, the linker appears to be incorrectly pulling in MCL libraries even when "include MCL.h" is removed.

This was a problem I noted in master branch, but has not been a concern until now.

Compiling master with the Arduino IDE does not link in unused libraries.
Thought this might have to do with --gc-section(s) option but no luck.

@jmamma
Copy link
Owner Author

jmamma commented Jun 20, 2019

Makefile is working correctly now.

With WAVDesigner and OLED display disabled we're only 20KB over the 64KB limit.

That's way better than I was anticipating.

@jmamma
Copy link
Owner Author

jmamma commented Jun 20, 2019

I think the Minicommand build will need to remain it's own branch.

Compiling using the Arduino IDE is probably not possible because of conflicts with platform.txt
and the need for different compile options for the different hardware types

@jmamma
Copy link
Owner Author

jmamma commented Jun 21, 2019

AVR Memory Usage
----------------
Device: atmega64

Program:  126572 bytes (193.1% Full)
(.text + .data + .bootloader)

Data:      21822 bytes (532.8% Full)
(.data + .bss + .noinit)

^ After disabling the ext tracks, the firmware compiles and links
However it looks like the firmware size is 126,572 bytes. which is disappointing.

@jmamma jmamma merged commit aa16bc1 into dev Jun 22, 2019
@jmamma
Copy link
Owner Author

jmamma commented Jun 22, 2019

I've tested these changes to make sure that they are compatible with the dev branch and MegaCommmand hardware.

I've now merged these changes in to dev.

Dev branch is now backwards with Minicommand. I have not tested on the Minicommand yet.

For compiling for Minicommand:

Need to disable OLED_DISPLAY and MEGACOMMAND macro definitions.

and use the Minicommand Makefile: minicommand.mk.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant