66AK2H14多核通信实验

1. dsp和arm通过配置ipc中断寄存器进行通信。
程序路径:
/home/lr/workspace_v6_0/ARM_DSP/ARM_DSP_Communication_ARM
/home/lr/workspace_v6_0/ARM_DSP/ARM_DSP_Communication_DSP
程序输出:
[C66xx_0] Initialize DSP main clock = 122.88MHz/4x39 = 1198MHz
Waiting for interrupt from ARM Core0!
[CortexA15_1] Interrupt init success
Trigger the IPCGR0 to generate the interrupt to DSP Core0!
Waiting for interrupt from DSP Core0!
[C66xx_0] Received interrupt from ARM Core0!
Trigger the IPCGR8 to generate the interrupt to ARM Core0!
结论和问题:DSP可以接收到ARM发出的中断。ARM不能接收DSP发出的中断。

2.dsp核间通过Transportshm进行通信。
程序路径:
/home/lr/workspace_v6_0/multicore_66ak2h14
程序输出:
Core 0 Trace...
2 Resource entries at 0x800000
enter main() , localQueueName is CORE0 , nextQueueName is CORE1
 Ipc_Start begain
 IPC_Start success
--> enter task
MultiProc_self is 0
HeapBufMp_create success
MessageQ_create success
MessageQ_open success
Start the main loop
Sending a message #1 to CORE1
Sending a message #2 to CORE1
The test is complete
-----------------------------------------
Core 1 Trace...
2 Resource entries at 0x800000
enter main() , localQueueName is CORE1 , nextQueueName is CORE2
 Ipc_Start begain
 IPC_Start success                                                              
--> enter task                                                                  
MultiProc_self is 1                                                             
HeapBufMp_open begin                                                            
HeapBufMp_open success                                                          
MessageQ_create success                                                         
MessageQ_open success                                                           
Start the main loop                                                             
Get Message 10                                                                  
Sending a message #1 to CORE2                                                   
Get Message 10                                                                  
Sending a message #2 to CORE2                                                   
The test is complete                                                            
-----------------------------------------                                       
Core 2 Trace...                                                                 
2 Resource entries at 0x800000                                                  
enter main() , localQueueName is CORE2 , nextQueueName is CORE3                 
 Ipc_Start begain                                                               
 IPC_Start success                                                              
--> enter task                                                                  
MultiProc_self is 2                                                             
HeapBufMp_open begin                                                            
HeapBufMp_open success                                                          
MessageQ_create success                                                         
MessageQ_open success                                                           
Start the main loop                                                             
Get Message 10                                                                  
Sending a message #1 to CORE3                                                   
Get Message 10                                                                  
Sending a message #2 to CORE3                                                   
The test is complete                                                            
-----------------------------------------                                       
Core 3 Trace...                                                                 
2 Resource entries at 0x800000                                                  
enter main() , localQueueName is CORE3 , nextQueueName is CORE4                 
 Ipc_Start begain                                                               
 IPC_Start success                                                              
--> enter task                                                                  
MultiProc_self is 3                                                             
HeapBufMp_open begin                                                            
HeapBufMp_open success                                                          
MessageQ_create success                                                         
MessageQ_open success                                                           
Start the main loop                                                             
Get Message 10                                                                  
Sending a message #1 to CORE4                                                   
Get Message 10                                                                  
Sending a message #2 to CORE4                                                   
The test is complete                                                            
-----------------------------------------                                       
Core 4 Trace...                                                                 
2 Resource entries at 0x800000                                                  
enter main() , localQueueName is CORE4 , nextQueueName is CORE5                 
 Ipc_Start begain                                                               
 IPC_Start success                                                              
--> enter task                                                                  
MultiProc_self is 4                                                             
HeapBufMp_open begin                                                            
HeapBufMp_open success                                                          
MessageQ_create success                                                         
MessageQ_open success                                                           
Start the main loop                                                             
Get Message 10                                                                  
Sending a message #1 to CORE5                                                   
Get Message 10                                                                  
Sending a message #2 to CORE5                                                   
The test is complete                                                            
-----------------------------------------                                       
Core 5 Trace...                                                                 
2 Resource entries at 0x800000                                                  
enter main() , localQueueName is CORE5 , nextQueueName is CORE6                 
 Ipc_Start begain                                                               
 IPC_Start success                                                              
--> enter task                                                                  
MultiProc_self is 5                                                             
HeapBufMp_open begin                                                            
HeapBufMp_open success                                                          
MessageQ_create success                                                         
MessageQ_open success                                                           
Start the main loop                                                             
Get Message 10                                                                  
Sending a message #1 to CORE6                                                   
Get Message 10                                                                  
Sending a message #2 to CORE6                                                   
The test is complete                                                            
-----------------------------------------                                       
Core 6 Trace...                                                                 
2 Resource entries at 0x800000                                                  
enter main() , localQueueName is CORE6 , nextQueueName is CORE7                 
 Ipc_Start begain                                                               
 IPC_Start success                                                              
--> enter task                                                                  
MultiProc_self is 6                                                             
HeapBufMp_open begin                                                            
HeapBufMp_open success                                                          
MessageQ_create success                                                         
MessageQ_open success                                                           
Start the main loop                                                             
Get Message 10                                                                  
Sending a message #1 to CORE7                                                   
Get Message 10                                                                  
Sending a message #2 to CORE7                                                   
The test is complete                                                            
-----------------------------------------                                       
Core 7 Trace...                                                                 
2 Resource entries at 0x800000                                                  
enter main() , localQueueName is CORE7 , nextQueueName is CORE0                 
 Ipc_Start begain                                                               
 IPC_Start success                                                              
--> enter task                                                                  
MultiProc_self is 7                                                             
HeapBufMp_open begin                                                            
HeapBufMp_open success                                                          
MessageQ_create success                                                         
MessageQ_open success                                                           
Start the main loop                                                             
Get Message 10                                                                  
Sending a message #1 to CORE0                                                   
Get Message 10                                                                  
Sending a message #2 to CORE0                                                   
The test is complete
结论和问题:dsp之可以使用Transportshm进行通信。
3.dsp和arm通过Transportmsg进行通信。
程序路径:
/home/lr/ti/mcsdk_bios_3_01_03_06/demos/image_processing/ipc/evmtci6638k2k/master
/home/lr/ti/mcsdk_bios_3_01_03_06/demos/image_processing/ipc/evmtci6638k2k/slave
程序输出:
3 Resource entries at 0x800000
registering rpmsg-proto service on 61 with HOST
Hello
DDR_MEM_MGMT: created MessageQ: SLAVE_DDR_CORE0; QueueID: 0x10000
Awaiting message from host...
Start core task
Core_Task: created MessageQ: core1_queue; QueueID: 0x10001
Waiting for message from master
[t=0x00000009:5f821273] ti.ipc.rpmsg.RPMessage: RPMessage_send: no object for endpoint: 53
[t=0x00000009:5fad3615] ti.ipc.rpmsg.RPMessage: RPMessage_send: no object for endpoint: 53
Received msg from (procId:master_messageQ): 0x0:0x1
    payload: 16 bytes.
Allocating 10395598 bytes of memory at 0xa1000000
Awaiting message from host...
Received msg from (procId:master_messageQ): 0x0:0x1
    payload: 16 bytes.
Allocating 10388502 bytes of memory at 0xa19ea000
Awaiting message from host...
[t=0x0000000a:96d5a6ec] ti.ipc.rpmsg.RPMessage: RPMessage_send: no object for endpoint: 53
Received msg from (procId:master_messageQ): 0x0:0x1
    payload: 16 bytes.
Allocating 1304514 bytes of memory at 0xa23d3000
Awaiting message from host...
Received msg from (procId:master_messageQ): 0x0:0x1
    payload: 16 bytes.
Allocating 434838 bytes of memory at 0xa2512000
Awaiting message from host...
Received msg from (procId:master_messageQ): 0x0:0x1
    payload: 16 bytes.
Allocating 434838 bytes of memory at 0xa257d000
Awaiting message from host...
Received msg from (procId:master_messageQ): 0x0:0x1
    payload: 16 bytes.
Allocating 1314036 bytes of memory at 0xa25e8000
Awaiting message from host...
Received msg from (procId:master_messageQ): 0x0:0x1
    payload: 16 bytes.
Allocating 438012 bytes of memory at 0xa2729000
Awaiting message from host...
Received msg from (procId:master_messageQ): 0x0:0x1
    payload: 16 bytes.
Allocating 438012 bytes of memory at 0xa2794000
Awaiting message from host...
Received msg from (procId:master_messageQ): 0x0:0x1
    payload: 16 bytes.
Allocating 1314036 bytes of memory at 0xa27ff000
Awaiting message from host...
Received msg from (procId:master_messageQ): 0x0:0x1
    payload: 16 bytes.
Allocating 438012 bytes of memory at 0xa2940000
Awaiting message from host...
Received msg from (procId:master_messageQ): 0x0:0x1
    payload: 16 bytes.
Allocating 438012 bytes of memory at 0xa29ab000
Awaiting message from host...
Received msg from (procId:master_messageQ): 0x0:0x1
    payload: 16 bytes.
Allocating 1314036 bytes of memory at 0xa2a16000
Awaiting message from host...
Received msg from (procId:master_messageQ): 0x0:0x1
    payload: 16 bytes.
Allocating 438012 bytes of memory at 0xa2b57000
Awaiting message from host...
Received msg from (procId:master_messageQ): 0x0:0x1
    payload: 16 bytes.
Allocating 438012 bytes of memory at 0xa2bc2000
Awaiting message from host...
Received msg from (procId:master_messageQ): 0x0:0x1
    payload: 16 bytes.
Allocating 1314036 bytes of memory at 0xa2c2d000
Awaiting message from host...
Received msg from (procId:master_messageQ): 0x0:0x1
    payload: 16 bytes.
Allocating 438012 bytes of memory at 0xa2d6e000
Awaiting message from host...
Received msg from (procId:master_messageQ): 0x0:0x1
    payload: 16 bytes.
Allocating 438012 bytes of memory at 0xa2dd9000
Awaiting message from host...
Received msg from (procId:master_messageQ): 0x0:0x1
    payload: 16 bytes.
Allocating 1314036 bytes of memory at 0xa2e44000
Awaiting message from host...
Received msg from (procId:master_messageQ): 0x0:0x1
    payload: 16 bytes.
Allocating 438012 bytes of memory at 0xa2f85000
Awaiting message from host...
Received msg from (procId:master_messageQ): 0x0:0x1
    payload: 16 bytes.
Allocating 438012 bytes of memory at 0xa2ff0000
Awaiting message from host...
Received msg from (procId:master_messageQ): 0x0:0x1
    payload: 16 bytes.
Allocating 1314036 bytes of memory at 0xa305b000
Awaiting message from host...
Received msg from (procId:master_messageQ): 0x0:0x1
    payload: 16 bytes.
Allocating 438012 bytes of memory at 0xa319c000
Awaiting message from host...
Received msg from (procId:master_messageQ): 0x0:0x1
    payload: 16 bytes.
Allocating 438012 bytes of memory at 0xa3207000
Awaiting message from host...
Received msg from (procId:master_messageQ): 0x0:0x1
    payload: 16 bytes.
Allocating 1304514 bytes of memory at 0xa3272000
Awaiting message from host...
Received msg from (procId:master_messageQ): 0x0:0x1
    payload: 16 bytes.
Allocating 434838 bytes of memory at 0xa33b1000
Awaiting message from host...
Received msg from (procId:master_messageQ): 0x0:0x1
    payload: 16 bytes.
Allocating 434838 bytes of memory at 0xa341c000
Awaiting message from host...
Received message
Image Information:
    rgb_in: 0xa19ea000
    color_table: 0x0
    bitspp: 24
    width: 1587
    height: 274
    out: 0xa23d3000
    scratch_buf[0]: 0xa2512000
    scratch_buf_len[0]: 434838
    scratch_buf[1]: 0xa257d000
    scratch_buf_len[1]: 434838
Sending reply...
Shuting down
Received msg from (procId:master_messageQ): 0x0:0x1
    payload: 16 bytes.
Allocating 3462834 bytes of memory at 0xa3487000
Awaiting message from host...
Received msg from (procId:master_messageQ): 0x0:0x1
    payload: 16 bytes.
Allocating 3466094 bytes of memory at 0xa37d5000
Awaiting message from host...
Received msg from (procId:master_messageQ): 0x0:0x1
    payload: 16 bytes.
Freeing 10388502 bytes of memory at 0xa19ea000
Awaiting message from host...
Received msg from (procId:master_messageQ): 0x0:0x1
    payload: 16 bytes.
Freeing 1304514 bytes of memory at 0xa23d3000
Awaiting message from host...
Received msg from (procId:master_messageQ): 0x0:0x1
    payload: 16 bytes.
Freeing 438012 bytes of memory at 0xa319c000
Awaiting message from host...
Received msg from (procId:master_messageQ): 0x0:0x1
    payload: 16 bytes.
Freeing 438012 bytes of memory at 0xa3207000
Awaiting message from host...
Received msg from (procId:master_messageQ): 0x0:0x1
    payload: 16 bytes.
Freeing 1314036 bytes of memory at 0xa25e8000
Awaiting message from host...
Received msg from (procId:master_messageQ): 0x0:0x1
    payload: 16 bytes.
Freeing 1314036 bytes of memory at 0xa27ff000
Awaiting message from host...
Received msg from (procId:master_messageQ): 0x0:0x1
    payload: 16 bytes.
Freeing 1314036 bytes of memory at 0xa2a16000
Awaiting message from host...
Received msg from (procId:master_messageQ): 0x0:0x1
    payload: 16 bytes.
Freeing 1314036 bytes of memory at 0xa2c2d000
Awaiting message from host...
Received msg from (procId:master_messageQ): 0x0:0x1
    payload: 16 bytes.
Freeing 1314036 bytes of memory at 0xa2e44000
Awaiting message from host...
Received msg from (procId:master_messageQ): 0x0:0x1
    payload: 16 bytes.
Freeing 1314036 bytes of memory at 0xa305b000
Awaiting message from host...
Received msg from (procId:master_messageQ): 0x0:0x1
    payload: 16 bytes.
Freeing 1304514 bytes of memory at 0xa3272000
Awaiting message from host...
Received msg from (procId:master_messageQ): 0x0:0x1
    payload: 16 bytes.
Freeing 434838 bytes of memory at 0xa33b1000
Awaiting message from host...
Received msg from (procId:master_messageQ): 0x0:0x1
    payload: 16 bytes.
Freeing 434838 bytes of memory at 0xa341c000
Awaiting message from host...
Received msg from (procId:master_messageQ): 0x0:0x1
    payload: 16 bytes.
Freeing 3462834 bytes of memory at 0xa3487000
Awaiting message from host...
[t=0x0000000a:d5884b16] ti.ipc.rpmsg.RPMessage: RPMessage_send: no object for endpoint: 53
Received msg from (procId:master_messageQ): 0x0:0x1
    payload: 16 bytes.
Freeing 10395598 bytes of memory at 0xa1000000
Awaiting message from host...
Received msg from (procId:master_messageQ): 0x0:0x1
    payload: 16 bytes.
Freeing 3466094 bytes of memory at 0xa37d5000
Awaiting message from host...
[t=0x0000000a:e0289f4e] ti.ipc.rpmsg.RPMessage: RPMessage_send: no object for endpoint: 53
[t=0x0000000a:e0417f7f] ti.ipc.rpmsg.RPMessage: RPMessage_send: no object for endpoint: 53
结论和问题:
    必须使用版本号为03.0 1 .0 2 .0 5的mcsdk提供的image才能完成通信。使用3_01_03_06和3_01_04_07版本的会出现arm端不能接受到dsp端发送过来的MessageQ信息。
4、arm核间使用TransportQmss进行通信。
程序路径:
/home/lr/build/ipc-transport/linux/qmss/test
程序输出:
********************************************************
******** TransportQmss Linux Multi-Process Test *********
*********************************************************
TransportQmss Version : 0x01000000
Version String: Linux IPC Transports Revision: 01.00.00.00:Jun  3 2015:14:15:10
Process 1 : Initialized RM_Client1
Process 2 : Initialized RM_Client2
Process 0 : Initialized RM_Client0
Process 3 : Initialized RM_Client3
Process 1 : Creating TransportQmss instance
Process 2 : Creating TransportQmss instance
Process 0 : Creating TransportQmss instance
Process 3 : Creating TransportQmss instance
Process 1 : Local MessageQ: Process_1_MsgQ, QId: 0x89
Process 1 : Attempting to open remote queue: Process_2_MsgQ
Process 2 : Local MessageQ: Process_2_MsgQ, QId: 0x8a
Process 2 : Attempting to open remote queue: Process_3_MsgQ
Process 0 : Local MessageQ: Process_0_MsgQ, QId: 0x8b
Process 0 : Attempting to open remote queue: Process_1_MsgQ
Process 3 : Local MessageQ: Process_3_MsgQ, QId: 0x8c
Process 3 : Attempting to open remote queue: Process_0_MsgQ
Process 0 : Opened Remote queue: Process_1_MsgQ, QId: 0x89
Process 0 : Allocating round trip test MessageQ msg
Round Trip -    1
Process 0 : Sending msg to Process 1
Process 3 : Opened Remote queue: Process_0_MsgQ, QId: 0x8b
Process 1 : Opened Remote queue: Process_2_MsgQ, QId: 0x8a
Process 1 : Received msg with good data from Process 0
Process 1 : Sending msg to Process 2
Process 2 : Opened Remote queue: Process_3_MsgQ, QId: 0x8c
Process 2 : Received msg with good data from Process 1
Process 2 : Sending msg to Process 3
Process 3 : Received msg with good data from Process 2
Process 3 : Sending msg to Process 0
Process 0 : Received msg with good data from Process 3
Round Trip -    2
Process 0 : Sending msg to Process 1
Process 1 : Received msg with good data from Process 0
Process 1 : Sending msg to Process 2
Process 2 : Received msg with good data from Process 1
Process 2 : Sending msg to Process 3
Process 3 : Received msg with good data from Process 2
Process 3 : Sending msg to Process 0
Process 0 : Received msg with good data from Process 3
Round Trip -    3
Process 0 : Sending msg to Process 1
Process 1 : Received msg with good data from Process 0
Process 1 : Sending msg to Process 2
Process 2 : Received msg with good data from Process 1
Process 2 : Sending msg to Process 3
Process 3 : Received msg with good data from Process 2
Process 3 : Sending msg to Process 0
Process 0 : Received msg with good data from Process 3
Round Trip -    4
Process 0 : Sending msg to Process 1
Process 1 : Received msg with good data from Process 0
Process 1 : Sending msg to Process 2
Process 2 : Received msg with good data from Process 1
Process 2 : Sending msg to Process 3
Process 3 : Received msg with good data from Process 2
Process 3 : Sending msg to Process 0
Process 0 : Received msg with good data from Process 3
Round Trip -    5
Process 0 : Sending msg to Process 1
Process 1 : Received msg with good data from Process 0
Process 1 : Sending msg to Process 2
Process 2 : Received msg with good data from Process 1
Process 2 : Sending msg to Process 3
Process 3 : Received msg with good data from Process 2
Process 3 : Sending msg to Process 0
Process 0 : Received msg with good data from Process 3
Round Trip -    6
Process 0 : Sending msg to Process 1
Process 1 : Received msg with good data from Process 0
Process 1 : Sending msg to Process 2
Process 2 : Received msg with good data from Process 1
Process 2 : Sending msg to Process 3
Process 3 : Received msg with good data from Process 2
Process 3 : Sending msg to Process 0
Process 0 : Received msg with good data from Process 3
Round Trip -    7
Process 0 : Sending msg to Process 1
Process 1 : Received msg with good data from Process 0
Process 1 : Sending msg to Process 2
Process 2 : Received msg with good data from Process 1
Process 2 : Sending msg to Process 3
Process 3 : Received msg with good data from Process 2
Process 3 : Sending msg to Process 0
Process 0 : Received msg with good data from Process 3
Round Trip -    8
Process 0 : Sending msg to Process 1
Process 1 : Received msg with good data from Process 0
Process 1 : Sending msg to Process 2
Process 2 : Received msg with good data from Process 1
Process 2 : Sending msg to Process 3
Process 3 : Received msg with good data from Process 2
Process 3 : Sending msg to Process 0
Process 0 : Received msg with good data from Process 3
Round Trip -    9
Process 0 : Sending msg to Process 1
Process 1 : Received msg with good data from Process 0
Process 1 : Sending msg to Process 2
Process 2 : Received msg with good data from Process 1
Process 2 : Sending msg to Process 3
Process 3 : Received msg with good data from Process 2
Process 3 : Sending msg to Process 0
Process 0 : Received msg with good data from Process 3
Round Trip -   10
Process 0 : Sending msg to Process 1
Process 1 : Received msg with good data from Process 0
Process 1 : Sending msg to Process 2
Process 2 : Received msg with good data from Process 1
Process 2 : Sending msg to Process 3
Process 3 : Received msg with good data from Process 2
Process 3 : Sending msg to Process 0
Process 0 : Received msg with good data from Process 3
Test PASSED
Cleaning up
Test Complete!
结论和问题:arm多线程使用messageQ通信完成,底层通过qmss方式。

时间: 2024-10-10 18:24:07

66AK2H14多核通信实验的相关文章

IDC通信实验

[背景]模拟下IDC机房通信流程,其实就是根据自己的想法来做的实验,有不对之处,请指正! 在这里我们假设有两种流量,应用与管理流量,我们想让其管理流量与应用流量分开,但以下实验并没有完全将应用流量与管理流量分开,因我们有内网的应用如DB,那么,我们应该使用其管理口来使流量分开,此次实验没有做,而且内网还可以再细化,如不同部门应用服务器不同,他们之间应该也需要做相应的限制,而且网段过大的话,也会造成广播风暴,还会因arp攻击造成全局的问题,所以后期,我还会做上相应的vlan划分,并且此处没有做Ha

51单片机学习笔记【六】——串口通信实验

一.串口通信基础 1.串行通信 串行通信将数据字节分成一位一位的形式在一条传输线上逐个传送.单片机采用串行通信.特点是:传输线少,长距离传送成本低,但数据传送控制复杂. 串行通信的传输的传输方向:单工(数据传输只能沿一个方向),办双工(传输数据和接受数据分布进行),全双工(传输和接受同步进行). 单片机采用异步通信,发送和接受设备使用各自的时钟频率,容易实现,但传输效率不高,数据格式 2.MAX232 实验通过MAX232电平转换芯片,可把计算机串口电平(-12V~+12V)转换为单片及TTL电

bbblack的网络socket通信实验

1. 本次用bbblack作网络的通信实验,对了,这个板子必须装SD卡才能启动吗?板载的4GB eMMC Flash 存储器,eMMC (Embedded Multi Media Card) 为MMC协会所订立的,eMMC 相当于 NandFlash+主控IC ,对外的接口协议与SD.TF卡一样,主要是针对手机或平板电脑等产品的内嵌式存储器标准规格.eMMC的一个明显优势是在封装中集成了一个控制器,它提供标准接口并管理闪存,使得手机厂商就能专注于产品开发的其它部分,看下原理图,果然是SD卡的接口

【单片机实验】串口通信实验

实验三:串口通信实验 内容: (1)利用电脑串口与实验台串口进行连接: (2)根据帧格式定义.波特率定义,编程配置串口,并编写控制程序: (3)实现从电脑上输入控制字符,由单片机通过串口接收,并控制LED显示的功能: (4)对所编程序进行调试及验证. 要求: (1)掌握波特率的概念.学会编程设置波特率和工作方式: (2)掌握串口通信的编程控制方法: (3)理解解MAX232串口通信的硬件电路结构. 注意实验三,需要同学们自己编写程序,实现从电脑串口助手(利用单片机下载软件提供的串口调试助手),发

不同网段相互通信实验

1.实验目的   实现不同网段之间相互通信. 2.实验拓扑图 1.实验步骤 步骤一:给两台主机分配IP地址 C1: C2: 步骤2:配置路由器R1:如下图: 步骤3:配置路由器R2.如下图: 步骤4:配置路由器R3.如下图: 步骤5:配置路由器R4.如下图: 4.实验结果:

模拟主机跨路由通信实验

实验器材: 五台虚拟机,其中两台作为通信双方主机,三台主机作为路由器使用 通信主机使用的是centOS6.9. 另外三台也是centOS6.9,但是是最小化安装的. 本实验使用命令请参考网络配置之基本网络配置 我们以下图为例,来实现我们这次实验: 在试验中,我们需要四个网段,所以,我们需要在虚拟机上添加四个网段,以便我们可以完成实验:VMnet11,VMnet12,VMnet13,VMnet14 由于我们只是独立的环境进行模拟,所以我们使用的全部都是仅主机模式,这一点一定要清楚,然后,我们要做的

SPI通信实验---verilog(FPGA作为从机,使用可读可写)

本实验讲究实用性,故设计思想为:主机先向从机发送地址,若是向从机写入数据,则向从机发送数据,若是读取从机数据,则向从机发送时钟,然后在时钟下降沿读取数据即可.cs信号上升沿作为SPI通信的结束信号.rom程序只是做测试使用. 每次发送16个时钟信号,前八个是地址和命令,后八个是数据.其中:前8个时钟接受的数据的最高位决定着这次通信是读取数据还是写入数据,最高位为1,则是读取数据,为0则是写入数据. 程序: /********************************Copyright***

配置单臂路由实现vlan间通信实验报告

实验环境: 实验要求:PC1在192.168.10.0/24网段       PC2在192.168.20.0/24网段       PC3在192.168.30.0/24网段     路由器f0/0.1网关为192.168.10.1/24     路由器f0/0.2网关为192.168.20.1/24     路由器f0/0.3网关为192.168.30.1/24 实验过程: 1.    去除交换机sw1路由功能 sw1#conf t Enter configuration commands,

51单片机学习笔记【九】——红外通信实验

一.红外通信基础 1.红外线原理 红外线是波长在760nm~1mm之间的非可见光.红外通信装置由红外发射管和红外接受管组成,红外发射管是能发射出红外线的发光二极管,发射强度随着电流的增大而增大:红外接受管是一个具有红外光敏感特征的PN节的光敏二极管,只对红外线有反应,产生光电流. 2.信号调制原理 基带信号:从信号源发出没有经过调制的原始信号,特点是频率较低,信号频率从0开始,频谱较宽. 调制:就是用待传送信号去控制某个高频信号的幅度.相位.频率等参量变化的过程,即用一个信号去装载另一个信号.