当前位置:网站首页>Kv260 single board PS control setting IIC switch chip
Kv260 single board PS control setting IIC switch chip
2022-07-23 17:32:00 【Hard code Nong Er Mao brother】
stay KV260 There is one board IIC The control of the 4 choose 1 Circuit switch chip TAC9546A, Use through IIC Set the chip selection IIC passageway ,PS Output one way IIC Can be controlled 4 road IIC equipment .
IIC agreement
Introducing IIC SWITCH Before , Just a quick introduction IIC agreement , How to use PL Realization IIC Control needs to be right IIC The agreement is very familiar with , If you use PS control IIC, Only need to IIC Just understand the agreement .
IIC Protocols are commonly used , A friend I don't know , It is recommended to refer to two documents, one is Xilinx Of pg090, The other is Philips Semiconductors I2C-bus Specification.
![[ Failed to transfer the external chain picture , The origin station may have anti-theft chain mechanism , It is suggested to save the pictures and upload them directly (img-hxOTvQju-1658546062470)(./pic/2.png)]](/img/38/4856e1aaa7b2e49dd22349575730ca.png)
IIC The communication between bus master and slave devices mainly includes 4 part :
• START
• Slave Address
• Data Transfer
• STOP
Usual IIC In communication Data Transfer Send address first and then send data , but IIC SWITCH chip TAC9546A There are some differences , Finished sending Slave Address Then send data directly , When reading operations , Finished sending Slave Address Then read the data directly , In the next section, I'll talk about .
IIC SWITCH
TAC9546A
stay KV260 adopt HDA Pin connection TAC9546A, Use TAC9546A Output 3 Channels , Connect two ways respectively MIPI Camera and raspberry pie camera .
![[ Failed to transfer the external chain picture , The origin station may have anti-theft chain mechanism , It is suggested to save the pictures and upload them directly (img-7xTukavV-1658546062472)(./pic/1.png)]](/img/2c/96fc8a3e7960beabff622cfe3cda13.png)
Write register
Through to IIC SWITCH Write data in the control register , Choose IIC passageway B3、B2、B1、B0 Respectively corresponding to the channel 3、 passageway 2、 passageway 1 And channel 0 Four way output . For example, select a channel 2 Write on 0x02.
![[ Failed to transfer the external chain picture , The origin station may have anti-theft chain mechanism , It is suggested to save the pictures and upload them directly (img-E9dgITaJ-1658546062474)(./pic/5.png)]](/img/a6/139e78173f0ec1f63497c59faf8483.png)
adopt IIC When sending the write register command , Send... First Slave Address, Then send the value to be written in the control register .Slave Address Middle and high 4 Bit fixation , low 3 position A2A1A0 Configurable , Again KV260 Set in the for 100, therefore Slave Address by 1110100,0x74.
![[ Failed to transfer the external chain picture , The origin station may have anti-theft chain mechanism , It is suggested to save the pictures and upload them directly (img-478Vz2eb-1658546062475)(./pic/3.png)]](/img/36/98e3951a9524e2fe6e0b57770702fa.png)
Read register
After writing the register , To verify whether the writing is normal , Read register value . Send first when reading Slave Address, Then receive the control register value .
![[ Failed to transfer the external chain picture , The origin station may have anti-theft chain mechanism , It is suggested to save the pictures and upload them directly (img-Um6W4bD9-1658546062476)(./pic/4.png)]](/img/0f/b053fb86d1fdc0c60c3497d10e0d7c.png)
PS Add IIC
stay KV260 Use in EMIO, instead of MIO, Need to be in vivado Make the following settings in :
![[ Failed to transfer the external chain picture , The origin station may have anti-theft chain mechanism , It is suggested to save the pictures and upload them directly (img-yqZdflJP-1658546062476)(.\pic\6.png)]](/img/3c/f6e751bf1904163dcbb96f58029026.png)
iic_sda and iic_scl All use IOBUF,iic_scl_io and iic_sda_io Use inout Port settings .
IOBUF iic_scl_iobuf
(.I(iic_scl_o),
.IO(iic_scl_io),
.O(iic_scl_i),
.T(iic_scl_t));
IOBUF iic_sda_iobuf
(.I(iic_sda_o),
.IO(iic_sda_io),
.O(iic_sda_i),
.T(iic_sda_t));
PS Reading and writing IIC SWITCH
Reading and writing IIC when , You can use polling mode and interrupt mode , Because the polling mode is relatively simple , So this design uses polling mode .
Write IIC SWITCH register :
int i2c_switch_write(XIicPs *InstancePtr, u8 IIC_ADDR, u8 Data)
{
int Status;
u8 wr_data = Data;
Status = XIicPs_MasterSendPolled(InstancePtr, &wr_data, 1, IIC_ADDR);
while (XIicPs_BusIsBusy(InstancePtr));
return Status;
}
read IIC SWITCH register :
char i2c_switch_read(XIicPs *InstancePtr, u8 IIC_ADDR)
{
u8 rd_data;
XIicPs_MasterRecvPolled(InstancePtr, &rd_data, 1, IIC_ADDR);
while (XIicPs_BusIsBusy(InstancePtr));
return rd_data;
}
ILA debugging
stay PL Pass through ILA Observe IIC Read write timing .
Write register :Slave Address by 0x74, Start high bit Late onset low bit, Finished sending 7bitSlave Address1110100 after , send out 0, This bit indicates a write operation , wait for IIC SWITCH send out ACK, Then send the data 0x02, wait for ACK Post send stop bit .
![[ Failed to transfer the external chain picture , The origin station may have anti-theft chain mechanism , It is suggested to save the pictures and upload them directly (img-ign8hPzX-1658546062477)(./pic/7.png)]](/img/90/4ff347e5b866f2d7b2ff009bd236be.png)
Read register :Slave Address by 0x74, Start high bit Late onset low bit, Finished sending 7bitSlave Address1110100 after , send out 1, This bit indicates a read operation , wait for IIC SWITCH send out ACK, Then send the data 0x02, No response , Send stop bit .
![[ Failed to transfer the external chain picture , The origin station may have anti-theft chain mechanism , It is suggested to save the pictures and upload them directly (img-8DI1Vlux-1658546062477)(./pic/8.png)]](/img/f5/1eb4e72553f17cb30b0e3e0cb0a771.png)
matters needing attention
Use PS control IIC when , Be especially important SlaveAddress, This use 1110100, Convert to sixteen progressive digits 0x74, Don't write as 8bit11101000, There is no such chip ACK.
边栏推荐
- OpenIM重大升级-群聊读扩散模型发布 群管理功能升级
- 日志瘦身骚操作:从5G优化到1G!
- 爱可可AI前沿推介(7.23)
- 阿里二面:什么是CAS?
- Explication détaillée de l'injection aveugle d'erreur SQL
- C语言·结构体(线性表入门)
- IR drop, EM, noise and antenna
- Pymoo学习 (4): 多标准决策
- Software configuration | Anaconda download, installation, environment configuration and uninstall
- Do you dare to use BigDecimal without mastering these pits?
猜你喜欢
Do you dare to use BigDecimal without mastering these pits?

Pymoo learning (3): use multi-objective optimization to find the set of optimal solutions

详解一次SQL优化

Food safety chocolate is also true or false? How much do you know about it

Mysql: MySQL problem that is not a MySQL problem

KV260单板PS控制设置IIC开关芯片

Program environment and pretreatment

5秒到1秒,记一次效果“非常”显著的性能优化

场景小小记
![[introduction series of redis] redis builds master-slave servers](/img/94/505ec8eeb9a10e09a00f61565cbaba.png)
[introduction series of redis] redis builds master-slave servers
随机推荐
Summary of stock historical data download interface (dynamic update)
PHP 中 try-catch 和 if-else 语句的区别
LeetCode_724_寻找数组的中心下标
Function secondary development / plug-in development of JMeter (detailed version)
Kubernetes Kubelet管理pod核心流程
一加OnePlus 10T的一系列规格在产品发布前被披露
Kubernetes 聚焦Kubelet职责
Food safety | drinking fresh milk may infect tuberculosis? Take you to know what is milk sterilization
General paging implementation
日志瘦身骚操作:从5G优化到1G!
Kubernetes focuses on kubelet's responsibilities
Detailed explanation of SQL error reporting and blind annotation
Investment and finance report this week: Web3 game bear market attracts gold
爱可可AI前沿推介(7.23)
Major upgrade of openim - group chat reading diffusion model release group management function upgrade
使用 PreparedStatement 的 JDBC 程序示例
蓝桥杯真题:卡片[通俗易懂]
Food safety | what is the origin of plant meat that sounds very healthy?
工业物联网中的时序数据
Log slimming operation: from 5g to 1g!