arduino / arduino/ArduinoCore-sam

Arduino Due - CPU init will run the user into trouble on using SPI-devices

Open
#20 0 comments 0 reactions 0 assignees View on GitHub
Board: Arduino Due Library: SPI Type: Improvement
Dominant language
HTML
Stars
91
Forks
112
PR merge metrics
No merged PRs in 30d

Description

_From @DieterBurandt on January 17, 2017 17:13_

(Arduino 1.6.18.1) Variant.cpp

For Arduino Due ONLY:

The two SPI chip select lines logical pin 4 (sd-card) and logical pin 10 (Ethernet) are also connected to pin 87 and pin 77 respectable. (You can measure it for example with an Ohm-meter.)

All pins from 0 to PINS_COUNT are initialised to digital output low in variant.cpp. If a user takes the standard code and tries work with the SD-card or Ethernet the pins 87 and 77 are still low and the SPI device chip select never reaches a full swing to high.

Curiously it works sometimes but is instable, causing complete failures or slow devices.

Set at least pin 87 and pin 77 to input high. This will not influence the output, not the driver, and works very well.

(It will be great if initialisation of the CPU results in a chip select to disable all potentially connected devices on startup. That is pin 4, 10, 52, 77, 87 to input high. This simplifies using of SD-card and Ethernet devices.)

_Copied from original issue: arduino/Arduino#5869_

Contributor guide

No contributing guide indexed for this repository

Research direction

Inspect Variant.cpp for the Arduino Due initialization loop and how logical pins 4, 10, 52, 77, and 87 are configured. Verify the proposed input-high chip-select state against the reported SPI, SD-card, and Ethernet wiring. Done means those potentially connected chip-select lines are disabled high at startup without changing normal device operation.

Written by the indexing model from the issue text.

Assessment

Tech stack
arduino, cpp
Domain
embedded-iot
Issue type
Bug
Difficulty
3/5
Estimated time
Half a day
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.