GithubHelp home page GithubHelp logo

lenvm / sercomspislave Goto Github PK

View Code? Open in Web Editor NEW
10.0 3.0 4.0 45 KB

Sercom SPI library for ATSAMD21 boards such as Arduino Zero and Adafruit Feather M0

License: GNU General Public License v3.0

C++ 100.00%
spi slave spislave sercom samd21 atsamd21g18a arduino-library cortex-m0 arduino-zero arduino-mkr

sercomspislave's People

Contributors

lenvm avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

sercomspislave's Issues

Example Sercom0SPISlave can't be compiled with Arduino IDE 1.8.19 + Adafruit Feather M0 (SAMD21) board selected

c:/users/user1/appdata/local/arduino15/packages/adafruit/tools/arm-none-eabi-gcc/9-2019q4/bin/../lib/gcc/arm-none-eabi/9.2.1/../../../../arm-none-eabi/bin/ld.exe: core\variant.cpp.o: in function `SERCOM0_Handler':
C:\Users\user1\AppData\Local\Arduino15\packages\adafruit\hardware\samd\1.7.10\variants\feather_m0/variant.cpp:131: multiple definition of `SERCOM0_Handler'; sketch\Sercom0SPISlave.ino.cpp.o:C:\Users\user1\Documents\Arduino\libraries\SercomSPISlave\examples\Sercom0SPISlave/Sercom0SPISlave.ino:53: first defined here
collect2.exe: error: ld returned 1 exit status
exit status 1
Error compiling for board Adafruit Feather M0 (SAMD21).

Sending data to and receiving data from master

Dear lenvm,

Thank you for publishing your repository. I have an issue with using your SERCOM4 code. The pins that I'm using:

  • MISO PA12
  • MOSI PB10
  • SCK PB11
  • SS PA13

The pin configurations:
//Configure SERCOM4 SPI PINS
//Set PB10 as input (MOSI)
//Set PB11 as input (SCK)
//Set PA13 as input (SS)
//Set PA12 as output (MISO)
PORT->Group[PORTB].PINCFG[10].bit.PMUXEN = 0x1; //Enable Peripheral Multiplexing for SERCOM4 SPI PA12 Arduino PIN22
PORT->Group[PORTB].PMUX[6].bit.PMUXE = 0x3; //SERCOM 4 is selected for peripheral use of this pad (0x3 selects peripheral function D: SERCOM-ALT)
PORT->Group[PORTB].PINCFG[11].bit.PMUXEN = 0x1; //Enable Peripheral Multiplexing for SERCOM4 SPI PB09 Arduino PIN16
PORT->Group[PORTB].PMUX[4].bit.PMUXO = 0x3; //SERCOM 4 is selected for peripheral use of this pad (0x3 selects peripheral function D: SERCOM-ALT)
PORT->Group[PORTA].PINCFG[13].bit.PMUXEN = 0x1; //Enable Peripheral Multiplexing for SERCOM4 SPI PB10 Arduino PIN23
PORT->Group[PORTA].PMUX[5].bit.PMUXE = 0x3; //SERCOM 4 is selected for peripheral use of this pad (0x3 selects peripheral function D: SERCOM-ALT)
PORT->Group[PORTA].PINCFG[12].bit.PMUXEN = 0x1; //Enable Peripheral Multiplexing for SERCOM4 SPI PB11 Arduino PIN24
PORT->Group[PORTA].PMUX[5].bit.PMUXO = 0x3; //SERCOM 4 is selected for peripheral use of this pad (0x3 selects peripheral function D: SERCOM-ALT)

Furthermore, I am used to the ATMEGA328 chip. I have established the SPI communication before, but I've never done this on the ATSAMD21 chip. Do you know how to send and receive data from/to the ATSAMD21?

Thanks in advance.

Kind regards,

Cethaka

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.