• slider image 514
  • slider image 516
  • slider image 517
  • slider image 518
  • slider image 519
:::


Browsing this Thread:   1 Anonymous Users






Re: PIC16F689 I2C模組 Slave mode第一次接收R或W的command不正常...?
#5
新會員
新會員


查看用戶資訊
感謝Ryang的回覆,不過我用的是PIC24,等實驗過後再回覆問題是否解決,謝謝!

發表於: 2009/6/21 23:55
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部


Re: PIC16F689 I2C模組 Slave mode第一次接收R或W的command不正常...?
#4
版主
版主


查看用戶資訊
請看一下 PIC16F689 Errata 的 2.1 SSP 的說明及解決方式;
http://ww1.microchip.com/downloads/en/DeviceDoc/80243J.pdf

2. ModuleSSP (PIC16F687/689/690 only)

2.1 SSP module does not recognize firstStart bit received.

In any of the I2C™ modes, the SSP module will fail
to recognize the first Start bit received after a
transition from module disable to module enable
.
Subsequent Stop bits and Start bits are detected properly.

Work around:
Enable the SSP module in SSPMSK Access mode
before changing the mode to the desired I2C operation
.

EXAMPLE 1CODE EXAMPLE
MOVLW B’00111001’ 
;Module enableclock
MOVWF SSPCON 
;enableSSPMSK access.
;
Optionally load
;address mask value
;into SSPMSK register.

MOVLW B’00110110’ ;Module enableclock
MOVWF SSPCON 
;enable7-bit address;I2C slave.


Fix
Rev
A6 Silicon and later revisions.

發表於: 2009/5/14 12:15
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部


Re: PIC16F689 I2C模組 Slave mode第一次接收R或W的command不正常...?
#3
新會員
新會員


查看用戶資訊
您好,

我也遇到相同問題,第一次I2C進行R/W就會失敗,第二次以後就都會正常。

請問您怎麼解決這個問題?

謝謝

發表於: 2009/5/14 11:16
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部


PIC16F689 I2C模組 Slave mode第一次接收R或W的command不正常...?
#2
新會員
新會員


查看用戶資訊
請教各位前輩:
我在使用PIC16F689時發現I2C模組在Slave mode時,第一次收到Write command或Read Command時,不會進入中斷裡面,要第二次收到指令(W or R)後才會中斷並且之後I2C slave動作都會正常,實在想不到是何種原因 ????
以下秀出小弟在I2C Slave模組的設定

banksel SSPBUF
movlw b'00000000'
movwf SSPBUF

banksel SSPCON
;movlw b'00110110'
movlw b'00111110'
movwf SSPCON

banksel SSPSTAT
clrf SSPSTAT

banksel SSPADD
movlw b'10100000'
movwf SSPADD

banksel INTCON
movlw b'11000000'
movwf INTCON


banksel PIE1
bsf PIE1,SSPIE

在Interrupt裡面,我也沒有設定任何動到I2C相關的暫存器,但在第二次接收到指令後就都會正常....實在難以理解?盼請各位前輩指導,謝謝!!!

發表於: 2006/10/1 8:35
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部







You can view topic.
不可以 發起新主題
You cannot reply to posts.
You cannot edit your posts.
You cannot delete your posts.
You cannot add new polls.
You cannot vote in polls.
You cannot attach files to posts.
You cannot post without approval.
You cannot use topic type.
You cannot use HTML syntax.
You cannot use signature.
You cannot create PDF files.
You cannot get print page.

[進階搜尋]


:::

Microchip連結

https://www.facebook.com/microchiptechnologytaiwan/
http://www.microchip.com.tw/modules/tad_uploader/index.php?of_cat_sn=13
https://mu.microchip.com/page/tmu
http://elearning.microchip.com.tw/modules/tad_link/index.php?cate_sn=1
https://page.microchip.com/APAC-PrefCenters-TW.html
http://www.microchip.com/
http://www.microchip.com/treelink
http://www.microchipdirect.com/
http://www.microchip.com.cn/newcommunity/index.php?m=Video&a=index&id=103
http://www.microchip.com.tw/modules/tad_uploader/index.php?of_cat_sn=2
http://www.microchip.com.tw/Data_CD/eLearning/index.html
http://www.microchip.com.tw/RTC/RTC_DVD/
https://www.microchip.com/development-tools/
https://www.youtube.com/user/MicrochipTechnology
[ more... ]

教育訓練中心

!開發工具購買
辦法說明 [業界客戶] [教育單位]
----------------------------------
!校園樣品申請
辦法說明 [教師資格] [學生資格]
----------------------------------