Hi
Max speed of the SPI is 12Mhz.
For obtain 24Mhz I change IDE souces code at line 45
/*
* SPI Master library for Arduino Zero.
* Copyright (c) 2015 Arduino LLC
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef _SPI_H_INCLUDED
This file has been truncated. show original
Exist a way for obtain same speed without changing the IDE file?
Second question.
About Print, ex TFT.print() file.print() serial.print()
https://github.com/arduino/ArduinoCore-samd/blob/master/cores/arduino/Print.cpp
There are 2 function ? One for print String from ram and one from flash ?
This ?
size_t Print::print(const __FlashStringHelper *ifsh)
size_t Print::print(const String &s)
is right if i say:
print("hello")
string is copied from flash to ram, ad startup, then print from ram.
print(F"hello")
string is printed direclty from flash
Naturally, all this is intended with ARM SAMD
No, booth of this are const = Flash.
Explain me.
size_t Print::print(const __FlashStringHelper *ifsh)
size_t Print::print(const String &s)
This post read 880 time and nobody gives me advice?
#define F(string_literal) (reinterpret_cast<const __FlashStringHelper *>(PSTR(string_literal)))
I found this but I do not understand.
westfw
February 23, 2020, 3:42am
4
No, booth of this are const = Flash. Explain me.
size_t Print::print(const __FlashStringHelper *ifsh)
size_t Print::print(const String &s)
They would be different on an AVR, so both versions exist for the sake of compatibility.
As for SPI, the library says:
// New programs should use SPI.beginTransaction to set the SPI clock
See SPI - Arduino Reference
I don't think that the original SPI code had beginTransaction(), so many of the examples don't use it.
Max speeed, using original library is 12mhz