回到顶部
基于AVR芯片读取探针数据并显示(三)研发实验
2016-12-06 16:44:30
标签: 原创 arduino mega2560 diy 研发
所选硬件对应的库

① SDI-12 库

地址:https://github.com/EnviroDIY/Arduino-SDI-12

###########################
#      COMPATIBILITY      #
###########################
 
 This library requires the use of pin change interrupts (PCINT). 
 Not all Arduino boards have the same pin capabilities. 
 The known compatibile pins for common variants are shown below.
 
 Arduino Uno:     All pins. 

 Arduino Mega or Mega 2560:
 10, 11, 12, 13, 14, 15, 50, 51, 52, 53, A8 (62), 
 A9 (63), A10 (64), A11 (65), A12 (66), A13 (67), A14 (68), A15 (69).

 Arduino Leonardo:
 8, 9, 10, 11, 14 (MISO), 15 (SCK), 16 (MOSI)

上面为示例代码注释,表示2560可以作为探针信号线连接的引脚,我选的是A11-A15

② 显示屏

地址:http://code.google.com/p/u8glib/

③ SD卡

地址:https://github.com/greiman/SdFat/

mega2560引脚图

上图为mega2560引脚定义图,原图地址:https://www.arduino.cc/en/uploads/Hacking/PinMap2560big.png

选取引脚
硬件单元引脚物理编号(上图黑色)引脚逻辑编号(上图红色)备注
显示屏93A4对应LCD屏引脚04,CS (RS) 片选信号,高电平有效
显示屏95A2对应LCD屏引脚05,SID (R/W) 串行数据输入
显示屏94A3对应LCD屏引脚06,SCK (E) 串行时钟输入
按钮4321
按钮4420确认
按钮4519
探针186A11信号
探针285A12信号
SD卡2151SD卡,MOSI
SD卡1953SD卡,SS
SD卡2052SD卡,SCK
SD卡2250SD卡,MISO

注:上述硬件单元未写所需5V和GND连接

开发环境连接图

453170823250765055.jpg