Voting resources, early voting, and poll worker information - VOTE. ... Adafruit is open and shipping.
0

HELP PLEASE!M4 Express, Project Ready, Need to change assign
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

HELP PLEASE!M4 Express, Project Ready, Need to change assign

by SebNad on Mon Aug 10, 2020 2:11 pm

Good Day everyone

I Prototype a project on the Metro M4 Express Dev boards, Now the project has the SAMD51J19 chip soldered on it, I need to change the assigned pins to proper pins on the new board, for example I'm using 16 pin on the chip as ADC different I2C, UART and SPI pins, tried to dig in the header files but I don't even know If it's worth the time or maybe the pins are pre-defined in the boot-loader. can someone guide me here please and thank you.

SebNad
 
Posts: 11
Joined: Tue Jun 30, 2020 9:48 am

Re: HELP PLEASE!M4 Express, Project Ready, Need to change as

by User_UMjT7KxnxP8YN8 on Tue Aug 11, 2020 11:52 pm

variant.h is the file you want. On Windows you can find it in C:\Users\[your_user_name]\AppData\Local\Arduino15\packages\adafruit\hardware\samd\1.5.14\variants\metro_m4
Attachments
variant.h
(7.93 KiB) Downloaded 1 time

User_UMjT7KxnxP8YN8
 
Posts: 153
Joined: Tue Jul 17, 2018 1:28 pm

Re: HELP PLEASE!M4 Express, Project Ready, Need to change as

by SebNad on Wed Aug 12, 2020 9:01 am

Adafruit_UMjT7KxnxP8YN8 wrote:variant.h is the file you want. On Windows you can find it in C:\Users\[your_user_name]\AppData\Local\Arduino15\packages\adafruit\hardware\samd\1.5.14\variants\metro_m4

thank you Very much for your answer, do you know in the defined PIN_LED_13 (13u) , what 13u refer exactly, I'm trying to have a reference point where I can start changing stuff here.

SebNad
 
Posts: 11
Joined: Tue Jun 30, 2020 9:48 am

Re: HELP PLEASE!M4 Express, Project Ready, Need to change as

by User_UMjT7KxnxP8YN8 on Wed Aug 12, 2020 9:24 am

13u = 13 as an "unsigned" integer.

User_UMjT7KxnxP8YN8
 
Posts: 153
Joined: Tue Jul 17, 2018 1:28 pm

Re: HELP PLEASE!M4 Express, Project Ready, Need to change as

by SebNad on Wed Aug 12, 2020 9:30 am

thanks and sorry for not clarifying that I know its as an int, but how does 13 relate to PA16 or pin 35 in the SAMD51.

SebNad
 
Posts: 11
Joined: Tue Jun 30, 2020 9:48 am

Re: HELP PLEASE!M4 Express, Project Ready, Need to change as

by User_UMjT7KxnxP8YN8 on Wed Aug 12, 2020 10:30 am

Not sure; I'm an Adafruit customer, same as you. I've never had to make any changes and so never investigated that.

I'd suggest finding pins you know the location of and looking at how they're defined in variant.h. The "SPI Interfaces" section might be a good place to start.

User_UMjT7KxnxP8YN8
 
Posts: 153
Joined: Tue Jul 17, 2018 1:28 pm

Re: HELP PLEASE!M4 Express, Project Ready, Need to change as

by SebNad on Wed Aug 12, 2020 11:21 am

User_UMjT7KxnxP8YN8 wrote:Not sure; I'm an Adafruit customer, same as you. I've never had to make any changes and so never investigated that.

I'd suggest finding pins you know the location of and looking at how they're defined in variant.h. The "SPI Interfaces" section might be a good place to start.


Thank you, I appreciate your effort to help, hopefully someone from adafruit team or expert can give further details. meanwhile I will take your advice and investigate the pins starting from SPI

SebNad
 
Posts: 11
Joined: Tue Jun 30, 2020 9:48 am

Re: HELP PLEASE!M4 Express, Project Ready, Need to change as

by westfw on Sat Aug 22, 2020 2:43 pm

Variant.cpp contains a big array that maps PIN number (as array index) to the hw info (port, bit, timer, ADC mux setting, etc)
Variant.h generally contains higher level info (so many total pins, serial1 is on SERCOM4 and pins 0,1, etc)

westfw
 
Posts: 1720
Joined: Fri Apr 27, 2007 1:01 pm
Location: SF Bay area

Please be positive and constructive with your questions and comments.