- 1、本文档共39页,可阅读全部内容。
- 2、有哪些信誉好的足球投注网站(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。
- 3、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载。
- 4、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
查看更多
FPPA实习.ppt
I2C 介面實作-AskACK- read ACK bit from slave mI2CAskACK: set1 mSCL; delay I2C_DELAY; set0 mSDA_IO; t0sn mSDA; goto serverNOACK; goto serverACK; serverACK: set1 mSDA_IO; set0 mSCL; delay I2C_DELAY; ret ACK; serverNOACK: set1 mSDA_IO; set0 mSCL; delay I2C_DELAY; ret NOACK; read data after clock I2C 介面實作-ACK/NOACK- write ACK/NOACK bit to slave mI2CACK: set1 mSDA_IO; set0 mSDA; set1 mSCL; delay I2C_DELAY; set0 mSCL; delay I2C_DELAY; ret; mI2CNOACK: set1 mSDA_IO; set1 mSDA; set1 mSCL; delay I2C_DELAY; set0 mSCL; delay I2C_DELAY; ret; write data before clock 24LC04B Write/Read *see 24LC04B datasheet 24LC04B Write/Read 流程(略) wait START Device Addressing Write Mode Read Mode Write Adddress Write Data Read Data (from current address++) (to current address++) STOP STOP restart restart wait START I2C 介面實作-24LC04B-Write START Word Address STOP ACK Control Byte ACK 啟動 I2C BUS 寫入資料(address) 停止 I2C BUS 尋找裝置 Data ACK 寫入資料 (to EEPROM) MASTER(FPPA) SLAVER(24LC04B) *continue redoWrite: call mI2CStart; mov a, mI2C_DEVICE_WRITE; mov mI2CData, a; call mI2CWriteDevice; call mI2CAskACK; mov a, 0x00; mov mI2CData, a; call mI2CWriteData; call mI2CAskACK; mov a, TEST_DATA; mov mI2CData, a; call mI2CWriteData; call mI2CAskACK; call mI2CStop; call Delay10MS; I2C 介面實作-24LC04B-Write START Word Address STOP ACK Control Byte ACK Data ACK *write cycle I2C 介面實作-24LC04B-Read Data ACK/NOACK START STOP Control Byte ACK 啟動 I2C BUS 讀出資料 (from EEPROM) 停止 I2C BUS 尋找裝置 START Word Address ACK Control Byte ACK 啟動 I2C BUS 寫入資料(address) 尋找裝置 MASTER(FPPA) SLAVER(24LC04B) *ACK-Continue *No ACK-Stop * FPPA 實習 七字節-原理 hgfedcba 000111111100000110 201011011 301001111 401100110 501101101 601111101 700100111 801111111 901101111 mov a, 0 /// 0 mov SEG_PORT, a; 七字節-掃描 set1 SEG0_COM; set0 SEG1_COM; /// TODO set0 SEG0_COM; set1 SEG1_COM; /// TODO SEG0_COM SEG1_COM displayLoop: set1 SEG0_COM; set1 SEG1_COM; mov a, 0 // 9 mov SEG_PORT, a;
文档评论(0)