极客工坊

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 13972|回复: 6

求助 Leonardo的SPI如何用啊 看官网看的一头雾水

[复制链接]
发表于 2012-11-8 09:28:11 | 显示全部楼层 |阅读模式
求助 Leonardo的SPI如何用啊 看官网看的一头雾水 不知道接到SPI上的3个针如何定义 如何用
回复

使用道具 举报

发表于 2012-11-8 10:53:03 | 显示全部楼层
额,可以参考官方以太库中相关的源码,网络扩展板还有SD卡,都是用SPI通信。
回复 支持 反对

使用道具 举报

发表于 2012-11-8 13:35:58 | 显示全部楼层
SPI: on the ICSP header. These pins support SPI communication using the SPI library. Note that the SPI pins are not connected to any of the digital I/O pins as they are on the Uno, They are only available on the ICSP connector. This means that if you have a shield that uses SPI, but does NOT have a 6-pin ICSP connector that connects to the Leonardo's 6-pin ICSP header, the shield will not work.
回复 支持 反对

使用道具 举报

发表于 2012-11-8 13:38:12 | 显示全部楼层


只能练ICSP上了,具体针脚看上图

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有帐号?注册

x
回复 支持 反对

使用道具 举报

 楼主| 发表于 2012-11-8 13:52:42 | 显示全部楼层
官方说明我看了 具体链接到哪个针我也找到了 只不过不知道 如何在程序里面定义那几个针 直接饮用SPI库 不行啊
回复 支持 反对

使用道具 举报

发表于 2012-11-8 14:57:48 | 显示全部楼层
看了SPI库和pins_arduino.h里的定义
// Map SPI port to 'new' pins D14..D17
static const uint8_t SS   = 17;
static const uint8_t MOSI = 16;
static const uint8_t MISO = 14;
static const uint8_t SCK  = 15;

应该没问题啊,是否选择正确了板子,再检查线序
回复 支持 反对

使用道具 举报

 楼主| 发表于 2012-11-8 15:02:28 | 显示全部楼层
嗯 试过了 放弃了 老老实实用ATmega328
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则 需要先绑定手机号

Archiver|联系我们|极客工坊

GMT+8, 2024-4-25 21:12 , Processed in 0.038628 second(s), 20 queries .

Powered by Discuz! X3.4 Licensed

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表