Questions tagged [samd21]
47 questions
1
vote
0 answers
SAMD21 or any other SAMx MCU : Pulse count in sleep mode
I have three external pins connected from the sensor to the SAMD21G18 MCU.
The output of the sensor is voltage pulses on these three pins.
I want to count the number of pulses with the timers peripherals.
I want to count while sleeping.
I want to…

Salvatore
- 21
- 2
1
vote
0 answers
SAMD21 serial console cannot be used after sketch upload
I bought this SAMD21 module and am having trouble with the serial console.
I have set up the IDE as follows:
Board=Arduino M0
Port=COM10 (Arduino Zero (Native USB port))
Programmer=AVR ISP
Once I slowly double-press Reset on the SAMD21, I am…

nickD
- 141
- 1
- 4
1
vote
1 answer
Pause SAMD21 TCC counter
The Atmel SAMD21 TCC peripheral provides a STOP command, which pauses the counter. The counter can be resumed with a RETRIGGER command.
When STOP is issued, the TCC enters a fault state, in which the outputs are either tristated, or driven to…

Jeremy
- 5,055
- 1
- 28
- 44
1
vote
1 answer
'ClassName' and 'ClassInstance' was not declared in this scope
I am attempting to program an Atmel SAM D21 microcontroller using C++ in Atmel Studio. I'm trying to create periodic hardware interrupts using one of the on-chip timers.
I created Timer4 class to set up the timer from main.cpp. I tried to create a…

TimNJ
- 29
- 2
1
vote
1 answer
Ardunio Uart class & Libraries
I am trying and failing to covert a sketch into a library.
Using an Arduino Zero.
In sketch form:
Variable of type Uart is defined as follows:
Uart* serPort = &serial2;
There is a function that switches between &serial1 and &serial2.
This…

Jeremy
- 111
- 1
- 5
- 11
0
votes
0 answers
Multiple definition error while attempting to edit bootloader of SAMD51
I am currently working on adding some new functionality to a SAMD51 bootloader. The original bootloader code I am basing this off of is the Adafruit UF2 bootloader for SAMD microcontrollers, found here: https://github.com/adafruit/uf2-samdx1
I am…

David
- 1,847
- 4
- 26
- 35
0
votes
0 answers
Clearing or preventing pending interrupts in an ISR
Summary:
An ISR necessarily causes its own trigger pin to toggle randomly multiple times. These toggles (during the ISR) should be ignored, but aren't, and result in another interrupt to be set as pending and get executed afterwards.
I have a…

aulven
- 521
- 3
- 14
0
votes
1 answer
Interrupts on SAMD21 with ASF
I am starting on learning programming Atmel SAMD devices using ASF, and trying to do a simple test interrupt application. I have found this source from Microchip about interrupts.
In this code snippet, it populates a configuration struct and then…

aulven
- 521
- 3
- 14
0
votes
0 answers
Issues with EEPROM functions not saving data for board type (Arduino)
I am trying to work on an Arduino project and for some reason, I cannot get it to store the data on the Adafruit Metro M4 controller or data logger shield (saving so that when reconnected, the data entered would still be there).
I have an SD card…
user15881691
0
votes
2 answers
Emulate CP210x USB-FTDI chip using SAMD21
The dev boards for the ESP32 family of MCU use CP210x (or similar) "FTDI" chips to communicate with the MCU when flashing. CP210x presents a COM port to the host computer which runs esptool.py, a script which implements the Esressif communication…

Marchingband
- 489
- 1
- 7
- 14
0
votes
1 answer
Change LED intencity through 74HC595 shift register
I'm currently working on a project for which I need to control 13 white LEDs and one RGB LED with two shift registers 74HC595 in cascade.
I work on windows with a SAMD21 XPLAINED PRO board (µC samd21j18a) and ATMEL Studio as IDE.
For the moment I…

Fanch
- 44
- 7
0
votes
1 answer
Low-level bit shift register class using port manipulation for Arduino Zero
I'm currently trying to code a lower-lever bit shift register (74HC595) for Arduino Zero (that is based on SAMD21 Cortex M0).
I've already done a higher-level class with looks like that :
BitRegister.h
#ifndef BitRegister_h
#define…

Fanch
- 44
- 7
0
votes
0 answers
SERCOM (USART) driver for the continuous read and write for ATSAMD21
I am using ATSAMD21 microcontroller as a slave which is connected to a Master MCU(ESP32) through UART.
OS- For ATSAMD21 - FreeRTOS (IDE- MPLAB) and for ESP32 (FreeRTOS).
One of my application in SAMD21 controller is to read and write in a "while"…

Murlidhar Roy
- 29
- 7
0
votes
2 answers
C++ placement new alignment of classes (on a SAMD21 microcontroller)
I am working on an application which is running on a SAMD21 microcontroller. For those unfamiliar with the SAMD21, it contains an ARM Cortex-M0+ processor. The specific model I am using has 32 kB of RAM. My application is running up to the limits of…

David
- 1,847
- 4
- 26
- 35
0
votes
1 answer
Use Systick on samd21e15b
I'am working with Systick for the first time with an samd21e15b, so my objective is to be able to count time between delay for example. So here is what I've try to do
SysTick->CTRL = 0;
SysTick->LOAD = 0x7A11FFul;
SysTick->VAL = 0;
SysTick->CTRL =…

simon
- 1,180
- 3
- 12
- 33