当前位置:网站首页>ZigBee explain in simple terms lesson 2 hardware related and IO operation
ZigBee explain in simple terms lesson 2 hardware related and IO operation
2022-06-26 05:24:00 【Super cute sandwich kids】
1. To master zigbee Basic operating circuit
2.zigbee Wireless module on TI CC2530 What is the difference between the basic operating circuit .
One more reset chip , from CC2530 The chip directly leads to the download related 5 Heel line , by CC2530 Download program , Five wires are : Power Supply 、 Ground wire 、P2_1 35、P2_2 34、RESET_N 20.
3. Learn to control the input and output of all ports as you encounter them
CC2530 Scope of work :2-3.6V( recommend 3.3V)
One has 21 General purpose IO mouth , Respectively :P0_0 To P0_7(8 individual )、P1_0 To P1_7(8 individual )、P2_0 To P2_4(5 individual ), These slots can be used as common or corresponding on-chip peripherals . among P1_0 P1_1 Yes 20mA Output drive capability , The rest is 4mA.
How to configure the output :
Need make P1_0 In ordinary IO Mouth mode , Non on chip peripheral mode , be P1SEL Of the 0 Position as 0.
Manage all IO The mouth is in the ordinary IO Mode or on-chip peripherals by P0SEL、P1SEL、P2SEL decision .PxSEL register (x=0、1) Corresponding one IO, Decided it was normal IO Mouth or on-chip peripherals ,0 It means ordinary IO mouth ,1 Indicates on-chip peripherals . The default interface is 0, So sometimes as an ordinary IO Sometimes I don't write when I speak .
Give Way P1_0 In output state , Non input status . find P1DIR The first 0 position , Make it equal to 1, namely P1_0=1
Manage all IO Whether the port is in the input state or the output state is determined by P0DIR P1DIR P2DIR decision .PxDIR register (x=0、1) Each bit corresponds to a specific IO The corresponding one in the group IO, Decide whether to input or output ,0 Indicates input ,1 Indicative output . The default interface is 0.
Give Way P1_0 In the up and down mode , Non tristate state . find P1INP The first 0 position , Make it equal to 0, namely P1_0=0
Manage all IO Whether the mouth is in the up-down state or the three state state state is determined by P0INP、P1INP、P2INP decision .PxINP register (x=0、1) In the case of input please , Each bit corresponds to a specific IO The corresponding one in the group IO, Decide whether it is a pull-down mode or a three state mode ,0 It means up and down ,1 Represents three states .P2INP The register function is the same , Particular attention : Behind them 3 Bit determines when the configuration is in up / down mode , Group is pull-up , Or pull down ,0 It means pull up ,1 Represents a drop-down . The default interface is 0.
P2INP Register bit 7 6 5 4 3 2 1 0
Px Group corresponding to IO Position of mouth P2 Group P1 Group P0 Group P2_4 P2_3 P2_2 P2_1 P2_0
Give Way P0_6 In ordinary IO mouth , Off chip peripherals , be P0SEL Of the 6 Position as 0
Give Way P0_6 In input state , Non output state , be P0DIR Of the 6 Position as 0
Give Way P0_6 In the pull-up position 、 Pull down or one of the three states ,
#include<iocc2530.h>
void main()
{
P0SEL&=0xEF;//1110 1111 Ordinary IO mouth
P0DIR|=0x10;//0001 0000 Output status
P0_4=1;//P0_4 Output high level
P0SEL&=0xBF;//1011 1111 Ordinary IO mouth
P0DIR&=0xBF;//1011 1111 Input status
P0INP&=0xBF;//1011 1111 Give Way P0_6 In the up and down mode
P2INP&=0xDF;// 1101 1111 Give Way P0 The group is in pull-up mode
while(1);// Dead cycle
if(1==P0_6)
{// detected P0_6 High level
P0_4=0;
}
else
{// detected P0_6 Low level
P0_4=1;
}
}
边栏推荐
- Redis discovery bloom filter
- Sentimentin tensorflow_ analysis_ cell
- 【MYSQL】MySQL 百万级数据量分页查询方法及其优化
- Installation and deployment of alluxio
- Day3 data type and Operator jobs
- 无线网络存在的安全问题及现代化解决方案
- 11 IO frame
- Chapter 9 setting up structured logging (I)
- Thoughts triggered by the fact that app applications are installed on mobile phones and do not display icons
- Fedora alicloud source
猜你喜欢

小小面试题之GET和POST的区别

10 set

The beautiful scenery is natural, and the wonderful pen is obtained by chance -- how is the "wonderful pen" refined?

Replacing domestic image sources in openwrt for soft routing (take Alibaba cloud as an example)

Official image acceleration
The wechat team disclosed that the wechat interface is stuck with a super bug "15..." The context of

Beidou navigation technology and industrial application of "chasing dreams in space and feeling for Beidou"
![C# 39. string类型和byte[]类型相互转换(实测)](/img/33/046aef4e0c1d7c0c0d60c28e707546.png)
C# 39. string类型和byte[]类型相互转换(实测)

As promised: Mars, the mobile terminal IM network layer cross platform component library used by wechat, has been officially open source
![C# 40. Byte[] to hexadecimal string](/img/3e/1b8b4e522b28eea4faca26b276a27b.png)
C# 40. Byte[] to hexadecimal string
随机推荐
Redis discovery bloom filter
C# 39. string类型和byte[]类型相互转换(实测)
[arm] build boa based embedded web server on nuc977
Muke.com actual combat course
[geek] product manager training camp
使用Jedis監聽Redis Stream 實現消息隊列功能
Procedural life
Ai+ remote sensing: releasing the value of each pixel
Tp5.0框架 PDO连接mysql 报错:Too many connections 解决方法
Briefly describe the pitfalls of mobile IM development: architecture design, communication protocol and client
Why does the mobile IM based on TCP still need to keep the heartbeat alive?
Install the tp6.0 framework under windows, picture and text. Thinkphp6.0 installation tutorial
The first gift of the project, the flying oar contract!
Leetcode513.找出树的左下角的值
As promised: Mars, the mobile terminal IM network layer cross platform component library used by wechat, has been officially open source
Supplementary course on basic knowledge of IM development (II): how to design a server-side storage architecture for a large number of image files?
【MYSQL】MySQL 百万级数据量分页查询方法及其优化
Command line interface of alluxio
Happy New Year!
data = self._ data_ queue. get(timeout=timeout)