Welcome, Guest. Please Login or Register
Arduino IDE for Visual Studio
 
 
When Logging a Support Issue in the Forum, please ensure you have also:-
  • Enabled vMicro > Compiler > Show Build Properties and Verbose
  • Re-Compile your program with these settings enabled
 
Save the new Output to a Text File and....
Support requests without the output above may be impossible to answer, so please help us to help you
 
  HomeSearch Tutorials & Wiki visualmicro.com LoginHelpRegister  
 
Page Index Toggle Pages: 1
Send Topic Print
Writing to/from Registers for SAMD51 Chip Family (Read 181 times)
Phillip A. Gonzales
Junior Member
**
Offline



Posts: 18
Writing to/from Registers for SAMD51 Chip Family
Jul 9th, 2019 at 2:20am
 
I am trying to write to the registers on the ATSAMD51J19A on the Adafruit Metro M4 Express.

Trying to use macros such as the AVR lib does with DDRD or PORTD to assign pins on the Uno.

From what I have gathered you need to use the macros found at
C:\Users\[your user name here]\AppData\Local\Arduino15\packages\arduino\tools\CMSIS-Atmel\1.2.0\CMSIS\Dev
ice\ATMEL\samd51
which is included when you #include "Arduino.h" in a .ino file

However, I am unsure how to implement it as this chip has offsets from base stacks for many of the chips built-in functionalities, unlike the AVR chipsets. 

I am looking at using this method of bit-manipulation within ISR's to optimize the amount of time the code is stuck in the ISR.

Please let me know if anyone out there has been able to utilize any of the many native functionalities present on the SAMD51 via registers.
Back to top
 
 
IP Logged
 
Visual Micro
Administrator
*****
Offline



Posts: 10395
United Kingdom
Re: Writing to/from Registers for SAMD51 Chip Family
Reply #1 - Jul 9th, 2019 at 12:35pm
 
It's quite an advanced discussion. The best place for this question might be the arduino forum or an Atmel forum.

I can say that often these things are defined in \variants folder of each core. Of you find a single file that could be redefined or changed you can override the core by placing a file of the same name in the project and enabling the vMicro>Compiler>Allow overrides menus.

Alternatively whilst the arduino.h might #include some things you can override the main.cpp by including a copy of the main.cpp in your project.

To see the core more easily use "vMicro>Show hidden files".

Back to top
 
WWW  
IP Logged
 
Phillip A. Gonzales
Junior Member
**
Offline



Posts: 18
Re: Writing to/from Registers for SAMD51 Chip Family
Reply #2 - Jul 9th, 2019 at 3:26pm
 
Thank you for the direction, Tim.
I have found a post https://forum.arduino.cc/index.php?topic=334073.0 that seems to do just the trick for the SAMD21 on the Arduino Zero.

The SAMD21 and SAMD51 should be similar enough to be able to understand the logic for register manipulation.

I will be trying to digest the post further later on today and write back.
Back to top
 
 
IP Logged
 
Visual Micro
Administrator
*****
Offline



Posts: 10395
United Kingdom
Re: Writing to/from Registers for SAMD51 Chip Family
Reply #3 - Jul 9th, 2019 at 3:53pm
 
Yes that looks easier. Thanks
Back to top
 
WWW  
IP Logged
 
Page Index Toggle Pages: 1
Send Topic Print