fastgpio-arduino icon indicating copy to clipboard operation
fastgpio-arduino copied to clipboard

Support for Atmega2560

Open stephanbrunner opened this issue 7 years ago • 10 comments

Hi all,

Is there a technical reason for not supporting the Arduino Mega? I'm thinking of writing the extra code, but I'm not sure if I will bump into some technical limitations...

Thanks, Stephan

stephanbrunner avatar Feb 02 '18 15:02 stephanbrunner

You should be able to add support for ports A through G on the ATmega2560 without any technical limitations. To support the other ports, I believe you would need to make major changes to the assembly code.

DavidEGrayson avatar Feb 02 '18 17:02 DavidEGrayson

I see. I'll try, but probably go with a hacky version then. If I get something worth pushing I'll let you know. Thanks! And a beauty of a library by the way.

stephanbrunner avatar Feb 03 '18 10:02 stephanbrunner

this do the same in Marlin fast io for 2560 https://github.com/MarlinFirmware/Marlin/blob/1.1.x/Marlin/fastio.h https://github.com/MarlinFirmware/Marlin/blob/1.1.x/Marlin/fastio_1280.h

ryanaltair avatar Apr 02 '18 06:04 ryanaltair

Has anyone had any luck hacking this to work on the 2560 yet?

StormTrooper avatar Apr 18 '19 14:04 StormTrooper

I have a hacky version I can share with you, but not generalized enough to be worth publishing. That would be a cool job to do though. Unfortunattely, because I didn't plan to publish the code, I made some codestyle addaption. Sorry for that. The technical changes may only be in the #define sections to define the chips pinout. But I don't really remember.

Hope that helps anyway: FastGPIO_MEGA.h.txt

stephanbrunner avatar Apr 19 '19 11:04 stephanbrunner

Thanks very much. I think its done the job.

StormTrooper avatar Apr 21 '19 16:04 StormTrooper

I installed the latest version and still no official support of ATMega 2560. Please make it official.

stuart1975 avatar May 25 '19 22:05 stuart1975

Find a hacky version attached to my comment 1 month ago. That shound serve for some use cases, not all gpios are supported though. At some point someone probably will write an update supporting all gpios.

stephanbrunner avatar May 26 '19 08:05 stephanbrunner

I have a hacky version I can share with you, but not generalized enough to be worth publishing. That would be a cool job to do though. Unfortunattely, because I didn't plan to publish the code, I made some codestyle addaption. Sorry for that. The technical changes may only be in the #define sections to define the chips pinout. But I don't really remember.

Hope that helps anyway: FastGPIO_MEGA.h.txt

Was really hoping to try this, but I'm getting some errors that are beyond my c/c++ abilities...

FastGPIO_MEGA.h:424:71: error: impossible constraint in asm _FG_SBI(pinStructs[pin].portAddr, pinStructs[pin].bit);

Any update on officially supported 2560?

jkwphysics avatar Nov 04 '19 05:11 jkwphysics

Some code might help. : )

stephanbrunner avatar Nov 06 '19 21:11 stephanbrunner