教育和學習︰ Up《grade》【七下】

此處略說一下,何謂『樹莓派 GPIO 』相容性也。從

mraa  1.9.0
Low Level Skeleton Library for Communication on GNU/Linux platforms

UP Board

UP Board is based on the Intel(R) Atom(TM) x5-Z8350 SoC (formerly Cherry Trail). It includes 1/2/4GB RAM, 16/32/64GB eMMC flash, 6 USB2.0 ports, 1 USB 3.0 OTG port, 1 Gigabit Ethernet, HDMI and DSI/eDP Graphics ports, RTC and a 40-pin I/O header. The form-factor for the board is based on the Raspberry Pi 2, and can be used with many of the add-on HAT boards designed for the Raspberry Pi.

Interface notes

PWM PWM frequency range is from 293 Hz to 6.4 MHz. 8-bit resolution is supported for duty-cycle adjustments, but this reduces for frequencies > 97.6kHz

I2C 2 I2C channels support standard-mode (100kHz) and fast-mode (400kHz). Bus frequency can be selected in BIOS settings. Note that, unlike Raspberry Pi, the I2C controller issues Repeated-START commands for combined transactions (e.g. a write-then-read transaction) which may not be supported by some I2C slave devices. For such devices, it is advisable to use separate write and read transactions to ensure that Repeated-STARTs are not issued.

SPI Bus frequencies up to 25MHz are supported, in steps which are less granular at higher speeds. E.g. Available speeds include: 25MHz, 12.5MHz, 8.33MHz, 6.25MHz, 5MHz, 4.167MHz, 3.571MHz, 3.125MHz, etc. Please be aware that speeds in between those steps will be rounded UP to the next nearest available speed, and capped at 25MHz. 2 chip-selects are available, one natively (SPI CS0) and one by GPIO (SPI CS1).

UART 1 high-speed UART is available, supporting baud rates between 300 and

  1. Hardware flow-control signals are available on pins 11/36 (RTS/CTS).

ADC 1 8-bit single-channel ADC (TI ADC081C021) is available on pin 7.

Please note that a kernel with UP board support is required to enable the I/O interfaces above. Refer to https://up-community.org for more information.

 

說明可知目前沒有『I2S』匯流排,故無法使用『樹莓派聲卡』哩!

再者『I2C 主控端』有操作差異,因此必須修改

GrovePi

 The GrovePi+ from Dexter Industries is a HAT that allows a wide range of Grove sensors to be connected and utilised quickly and easily with the UP board.

“GrovePi+ is an easy-to-use and modular system for hardware hacking with the Raspberry Pi, no need for soldering or breadboards: plug in your Grove sensors and start programming directly. Grove is an easy to use collection of more than 100 inexpensive plug-and-play modules that sense and control the physical world. By connecting Grove Sensors to the Raspberry Pi, it empowers your Pi in the physical world. With hundreds of sensors to choose from Grove families, the possibilities for interaction are endless.” [1]

Compatibility

The GrovePi+ HAT has been verified on UP and UP^2, using each of the sensors available in the GrovePi+ Internet of Things Kit and the GrovePi Python scripts provided by Dexter Industries.

Note: Is suggested to use the latest revision of the Groovepi board (3.1) because earlier revision present an hardware bug on the I2C lines that prevent the board to work reliably with the UP board.

How-Tos

Initial Software Setup

# Install some additional software packages
sudo apt-get update
sudo apt-get install -y git python-smbus
# Download the GrovePi software, complete with Python script modifications for UP
git clone -b up-board https://github.com/emutex/GrovePi.git

 

軟件呦!!

欲追其詳者,宜先知『I2C』點滴串講︰

假使按著 W!o+ 的學法, I2C 光知道維基百科詞條︰

I²CInter-Integrated Circuit)字面上的意思是積體電路之間,它其實是I²C Bus簡稱,所以中文應該叫積體電路匯流排,它是一種串列通訊匯流排,使用內送流量備援容錯機制從架構,由飛利浦公司在1980年代為了讓主機板嵌入式系統手機用以連接低速週邊裝置而發展。I²C的正確讀法為”I-squared-C” ,而”I-two-C”則是另一種錯誤但被廣泛使用的讀法。自2006年11月1日起,使用I²C協定已經不需要支付專利費,但製造商仍然需要付費以取得I²C從屬裝置位址。

425px-I2C.svg

設計概說

I²C只使用兩條雙向漏極開路(Open Drain)(串列資料(SDA)及串列時脈(SCL))並利用電阻將電位上拉。I²C允許相當大的工作電壓範圍,但典型的電壓準位為+3.3V或+5v。

I²C的參考設計使用一個7位元長度的位址空間但保留了16個位址,所以在一組匯流排最多可和112個節點通訊[a]。常見的I²C匯流排依傳輸速率的不同而有不同的模式:標準模式(100 Kbit/s)、低速模式(10 Kbit/s),但時脈頻率可被允許下降至零,這代表可以暫停通訊。而新一代的I²C匯流排可以和更多的節點(支援10位元長度的位址空間)以更快的速率通訊:快速模式(400 Kbit/s)、高速模式(3.4 Mbit/s)。

雖然最大的節點數目是被位址空間所限制住,但實際上也會被匯流排上的總電容所限制住,一般而言為400 pF。

600px-I2C_data_transfer.svg

只是個起步。更需要通盤熟讀

I2C – What’s That?

I2C-Bus: What’s that?

The I2C bus was designed by Philips in the early ’80s to allow easy communication between components which reside on the same circuit board. Philips Semiconductors migrated to NXP in 2006.

The name I2C translates into “Inter IC”. Sometimes the bus is called IIC or I²C bus.

The original communication speed was defined with a maximum of 100 kbit per second and many applications don’t require faster transmissions. For those that do there is a 400 kbit fastmode and – since 1998 – a high speed 3.4 Mbit option available. Recently, fast mode plus a transfer rate between this has been specified.  Beyond this there is the ultra fast mode UFM, but frankly, this is not a real I2C bus.

I2C is not only used on single boards, but also to connect components which are linked via cable. Simplicity and flexibility are key characteristics that make this bus attractive to many applications.

Most significant features include:

  • Only two bus lines are required
  • No strict baud rate requirements like for instance with RS232, the master generates a bus clock
  • Simple master/slave relationships exist between all components
    Each device connected to the bus is software-addressable by a unique address
  • I2C is a true multi-master bus providing arbitration and collision detection

Want to learn more?

Looking for I2C tools and software?

Whether you need a high speed I2C solution or a USB I2C interface, whether you want to monitor the bus or need a software platform for your own application, we can help you!.

───

要還能詳讀

UM10204

I2C-bus specification and user manual

Rev. 6 — 4 April 2014
User manual

大概算是入門了吧!!??

─── 摘自《W!O+ 的《小伶鼬工坊演義》︰ 從下而上‧由上往下

 

然後再踏 GrovePi 硬體、韌體以及軟體

W!O+ 的《小伶鼬工坊演義》︰ 開箱大吉》…

文本序列乎?