树莓派2B启用I2C

树莓派自带I2C控制器,但是默认没有启用,我们需要手工启用,具体操作如下:

I2C is a very commonly used standard designed to allow one chip to talk to another. So, since the Raspberry Pi can talk I2C we can connect it to a variety of I2C capable chips and modules.Here are some of the Adafruit projects that make use of I2C devices and modules:

The I2C bus allows multiple devices to be connected to your Raspberry Pi, each with a unique address, that can often be set by changing jumper settings on the module. It is very useful to be able to see which devices are connected to your Pi as a way of making sure everything is working.

To do this, it is worth running the following commands in the Terminal to install the i2c-tools utility.

Installing Kernel Support (with Raspi-Config)

继续阅读树莓派2B启用I2C

Python异步通信模块asyncore

Python的asyncore模块提供了以异步的方式写入套接字服务的客户端和服务器的基础结构。

模块主要包括:

asyncore.loop(…) - 用于循环监听网络事件。loop()函数负责检测一个字典,字典中保存dispatcher的实例。

asyncore.dispatcher类 - 一个底层套接字对象的简单封装。这个类有少数由异步循环调用的,用来事件处理的函数。

dispatcher类中的writable()和readable()在检测到一个socket可以写入或者数据到达的时候被调用,并返回一个bool值,决定是否调用handle_read或者handle_write。
asyncore.dispatcher_with_send类 - 一个 dispatcher的子类,添加了简单的缓冲输出能力,对简单的客户端很有用。

参考链接


TI Designs:TIDA-01469 采用无线振动传感器并支持预防性维护的电机监控参考设计

采用无线振动传感器并支持预防性维护的电机监控参考设计
继续阅读TI Designs:TIDA-01469 采用无线振动传感器并支持预防性维护的电机监控参考设计

Implementing Fast Fourier Transform Algorithms of Real-Valued Sequences With the TMS320 DSP Platform

TI芯片上FFT转换计算相关。

Implementing Fast Fourier Transform Algorithms of Real-Valued Sequences With the TMS320 DSP Platform

继续阅读Implementing Fast Fourier Transform Algorithms of Real-Valued Sequences With the TMS320 DSP Platform

巩固理解I2C协议(MCU,经验)

1.Abstract

前些天借用他人的一块MCS-51开发板来做实验,不想这块板子与我刚开始接触MCS-51的板子一样,实在是太亲切了!现在回过来看这块板子,功能算不上是太强大,麻雀虽小五脏俱全,该有的功能都有。于是又忍不住捣腾这块板子,倒不是写小程序一块,看着电路图,到处连线测试一下功能,从中体会下最初的学习兴奋感觉。

最初板子里边最难学会的有两处,一处是由I2C上挂上的一些器件,另外一处是基于DS18B20的一线传输协议,当初花了好大气力去学习,仍旧一头雾水的情景仍记忆犹新。现在回过来看,觉得当时最大的问题是不注重对时序的分析,不能完全理解总线传输协议,毕竟理解是随着时间的增加而逐步深刻的。看到这两大部分,虽然是几个小小的芯片,但心底有不少的辛酸感。现在的理解也不能算完全,我想尽可能的用现在的所学将这两大部分分别写下来,权当是一个巩固学习的过程。

继续阅读巩固理解I2C协议(MCU,经验)