Before logging an issue, please update to the latest release of Visual Micro from the Downloads Page.

When Logging a Support Issue in the Forum, please ensure you have also:-

  • Enabled vMicro > Compiler > Show Build Properties
  • Re-Compile your program with these settings enabled
 
Save the new Output to a Text File and....
  • Click the Reply button and attach as .txt file OR
  • Click here to Email us with the file attached, and a link to your post
Support requests without the output above may be impossible to answer, so please help us to help you
 
Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Writing to/from Registers for SAMD51 Chip Family (Read 2125 times)
Phillip A. Gonzales
Junior Member
**
Offline


Posts: 18
Joined: Jun 19th, 2019
Writing to/from Registers for SAMD51 Chip Family
Jul 9th, 2019 at 1:20am
Print Post  
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 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
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12076
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Writing to/from Registers for SAMD51 Chip Family
Reply #1 - Jul 9th, 2019 at 11:35am
Print Post  
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
Joined: Jun 19th, 2019
Re: Writing to/from Registers for SAMD51 Chip Family
Reply #2 - Jul 9th, 2019 at 2:26pm
Print Post  
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
 
Tim@Visual Micro
Administrator
*****
Offline


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