Commit Graph

22 Commits

Author SHA1 Message Date
Jeff Epler 67d8f108bb Add CAN to SAM E51 clock config 2020-09-21 16:44:26 -05:00
Jeff Epler a2e1867f69 _canio: Minimal implementation for SAM E5x MCUs
Tested & working:

 * Send standard packets
 * Receive standard packets (1 FIFO, no filter)

Interoperation between SAM E54 Xplained running this tree and
MicroPython running on STM32F405 Feather with an external
transceiver was also tested.

Many other aspects of a full implementation are not yet present,
such as error detection and recovery.
2020-09-21 16:44:26 -05:00
Jeff Epler e066448e36 atmel-samd: add same51, feather_m4_can
This is compile-tested, and requires updates in the related submodules:

https://github.com/adafruit/samd-peripherals/pull/35
https://github.com/adafruit/asf4/pull/37

This should not be merged until those can also be merged.
2020-09-08 13:06:45 -05:00
Jeff Epler f496c0b58d atmel-samd: Add SDIO SD card interface 2020-06-26 11:50:42 -05:00
Jeff Epler da733c01da atmel-samd: Add support for SAM E54 family MCUs
This introduces the new macro SAM_D5X_E5X.  This is mostly the same
as SAMD51 before, except in a few places where a special case for
SAME54 is required
2020-06-23 10:41:48 -05:00
jepler 61698eb5d8 AnalogOut / AudioOut: Copy settings from Arduino
Make changes in asf4_conf even though I think in these cases the
"peripherals" submodule is running the show.

Arduino clocks the DAC at 12MHz but uses the CCTRL setting for
clocking < 1.2MHz (100kSPS).

A fresh clock (6) is allocated for the new 12MHz clock.  This matches
the Arduino value, though not the GCLK index.

Modify other settings to more closely resemble Arduino.

In AudioOut, actually clock the waveform data from the timer we set up
for this purpose.

This gives good waveforms when setting AnalogOut full-scale in a loop,
but the rise/fall of waveforms that come from AudioOut are still erratic.
Weirdly, if AudioOut limits its range even slightly (e.g., to 1000..64000)
then the erratic

Note that this will require https://github.com/adafruit/samd-peripherals/pull/26
to be accepted for the submodule update here to work.
2019-09-15 11:30:49 -05:00
Scott Shawcroft 655f223916
Clock the SAMD21 much faster so it can actually convert at its max
sample rate of 350ksps.

Also added an error check of sample rate.

Fixes #1196
2018-09-18 15:29:46 -07:00
Noralf Trønnes f21c2494cb atmel-samd/samd21: Enable OSC32K
Enable OSC32K which is used by the RTC.
For some reason the RTC worked without enabling it.
2018-05-04 13:34:30 +02:00
Scott Shawcroft 898a7d92e3 atmel-samd: Fix M4 RTC and ItsyBitsy M4 definition 2018-04-19 14:42:03 -04:00
sommersoft a0eb51cc97 updated asf4_config: reverted oscillators to use internal vs external for RTC 2018-04-18 03:35:58 +00:00
Noralf Trønnes 8e2080411f atmel-samd: Add rtc module support
Support the rtc module by using hal_calendar.
2018-04-16 13:15:08 +02:00
Dan Halbert d005b12326 WIP: seems to be done 2018-04-02 19:08:18 -04:00
Dan Halbert 4895a9d1d8 Use safe clock freqs for AnalogOut; use DAC REFRESH on SAMD51. 2018-02-27 15:44:27 -05:00
Dan Halbert 9b4477e1dc Implement UART for 3.0 + related fixes.
1. UART: ported to ASF4. Allow rx-only and tx-only. Add .baudrate r/w property.

2. Make NeoPixel timing deterministic by turning off caches during NeoPixel writes.
3. Incorporate asf4 updates:
  a. async USART driver
  b. bringing Atmel START configuration closer to what we use
  c. Clock initialization order now specified by CIRCUITPY_GCLK_INIT_1ST and _LAST.
4. supervisor/port.c: Move commented-out clock-test pin setting to correct location.
2018-02-21 17:18:49 -05:00
Scott Shawcroft 82bc11585e ports/atmel-samd: Re-enable analogio
This introduces SAMD51 support and re-enables SAMD21 support.

Fixes #263
2018-02-08 14:48:08 -08:00
Dan Halbert 6f662e9bbc samd51 peripheral clocks were defined as 12MHz, but were really 120MHz 2017-11-20 21:11:30 -08:00
Dan Halbert 312444bbd2 non-DMA SPI working; adding this now for testing; will continue with DMA
Also, fixed pin mappings for rev B Metro M4:
swap PA12 and PA13 on SPI 2x3 header
swap A3 and A5

Comment out all frozen modules in CPX again to make room while waiting
for SPI flash.
2017-11-16 19:09:35 -05:00
Scott Shawcroft ef9a7f262a atmel-samd: Turn off nvmctl cache and rework active_read. 2017-11-08 16:01:38 -08:00
Dan Halbert 7292984204 Implement busio.I2c.
* Added asf4_conf/samd*/hpl_sercom_config.h
* Adjusted clocks in peripheral_clk_config.h.
* Put some frozen libs back in CPX for testing.
* Implement common-hal I2C
* Add samd*_peripherals.h in parallel with samd*_pins.h for common
  functions and data.
* Store SERCOM index in pins table for convenience.
* Canonicalize some #include guard names in various .h files.

simpler reset of SERCOMs; remove unused routine
2017-11-07 09:59:54 -08:00
Scott Shawcroft 3cfb06042e atmel-samd: update to October 2017 ASF4. 2017-11-02 12:19:50 -07:00
Scott Shawcroft 4aeef100f6 atmel-samd: More USB polish
* Introduce a python script to generate the USB descriptor instead of
  a bunch of C macros. In the future, we can use this dynamically in
  CircuitPython.
* Add support for detecting read-only mass storage mounts.

Fixes #377
2017-10-30 18:29:20 -07:00
Scott Shawcroft 73c15dcf8b Merge commit 'f869d6b2e339c04469c6c9ea3fb2fabd7bbb2d8c' into nrf2_merge
This is prep for merging in the NRF5 pull request.
2017-10-24 22:31:16 -07:00