BANKSEL I2C_Addr ; The "BANKSEL" may not necessary if I2C_Addr is @ the same bank with SSPBUF
movf I2C_Addr,W ; The Address you wish to "READ" from
BANKSEL SSPBUF
movwf SSPBUF
call WaitI2C
call RstartI2C ; Restart Condition !!
call WaitI2C ; Wait Until Restart OK !!
BANKSEL SSPBUF
movlw B'10100001' ; Write Read Command
movwf SSPBUF
call WaitI2C
call RecI2C ; Enable I2C Receive
call WaitI2C ; Wait Until Buffer Received
BANKSEL SSPBUF
movf SSPBUF,W ; Save to I2C_Data First !!
声明:本文内容及配图由入驻作者撰写或者入驻合作网站授权转载。文章观点仅代表作者本人,不代表电子发烧友网立场。文章及其配图仅供工程师学习之用,如有内容侵权或者其他违规问题,请联系本站处理。 举报投诉
全部0条评论
快来发表一下你的评论吧 !