• slider image 442
  • slider image 497
  • slider image 498
  • slider image 499
  • slider image 500
  • slider image 502
:::


Browsing this Thread:   1 Anonymous Users






Re: 在dsPIC30F4011上使用I2C模組問題>
#5
資深會員
資深會員


查看用戶資訊
參照:

百年 寫到:
因為ICD2 PGC PGD,與I2C SDA,SCL 共用接腳,而ICD 2 好像沒有完全切離訊號


感謝兩位回覆!完全忘記這回事,當初也沒有注意到和ICD2的腳位共用了。抓到PGC PGD信號時,邏輯分析宜分析不出IIC的封包時,我就應該要警覺了。Orz果然一語點醒夢中人。

唉!!我該被打屁屁了....Orz

發表於: 2006/10/16 15:13
不要問我哪裡來,我只是個流浪天涯的工程師
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部


Re: 在dsPIC30F4011上使用I2C模組問題>
#4
資深會員
資深會員


查看用戶資訊

發表於: 2006/10/16 15:11
不要問我哪裡來,我只是個流浪天涯的工程師
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部


Re: 在dsPIC30F4011上使用I2C模組問題>
#3
資深會員
資深會員


查看用戶資訊
你 I2C bus 上的總 pull-up 電阻是多少?

ICD2 的 PGC, PGD 上固定接有 4.7K pull down 電阻,我想它的原意是在 ICD2 放開訊號時也能將此兩接腳拉到確定的固定電位。

當 ICD2 雖然拉高 MCLR, 放開 PGC, PGD,讓 PIC/dsPIC 全速執行,一般情形下,當此接腳被圖騰式驅動為 high 或 low 時,pull down 電阻影響甚微,但由於 dsPIC4011 的 PGD/PGC 恰好與 I2C 共用,因此只要 ICD2 插著, I2C 的 pull high 與 ICD2 4.7K pull down 合成結果會使 I2C 的 high 不夠 high ,尤其 pull up 電阻較大時更嚴重。

附記: ICD2 斷電時在 VPP/MCLR 腳上的 pull down 電阻為 9K


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


Re: 在dsPIC30F4011上使用I2C模組問題>
#2
新會員
新會員


查看用戶資訊
因為ICD2 PGC PGD,與I2C SDA,SCL 共用接腳,而ICD 2 好像沒有完全切離訊號

發表於: 2006/10/16 9:37
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部


在dsPIC30F4011上使用I2C模組問題>
#1
資深會員
資深會員


查看用戶資訊
使用I2C模組時出現問題。
問題不在程式碼,而是燒錄後我直接在MPLAB中直接將Reset
拉起,一般來說程式應該就開始執行,不過在這程式中不會開
始執行,而且I2C的Bus變成低電位。

當我把ICD2接線拿起來時,程式就開始執行。邏輯分析宜也正
確抓到bus正寫入資料,24C64正確回應ACK了。寫入結束後也
正確的將Bus拉到High,不知道有沒有人有碰到一樣的問題?可
否請教。

用過其他專案試過,已經排除是ICD2的問題。只是一接上ICD2
,Bus電位就被拉下來。

程式碼如下:
#include <p30F4011.h>
#include <i2c.h>

#define    FCY        (7372800)
#define SCL         100000

      
_FOSC(CSW_FSCM_OFF XT);   
       
_FWDT(WDT_OFF);                        
        
_FBORPOR(PBOR_OFF MCLR_EN);   
       
_FGS(CODE_PROT_OFF);           

void I2C_Init()
{
    
I2CCON 0xA91E//b1010 1001 0001 1110
    
I2CBRG 0x10;
    
I2CADD 0x50;
}

int main(void )
{

    
I2C_Init();
    
IdleI2C();
    
StartI2C();
/* Wait till Start sequence is completed */
    
while(I2CCONbits.SEN );
/* Write Slave address and set master for transmission */
    
MasterWriteI2C(0xA0);
/* Wait till address is transmitted */
    
while(I2CSTATbits.TBF);
    while(
I2CSTATbits.ACKSTAT);
/* Transmit string of data */
//"AB" <-- EEPROM ADD "C" <--- Data
    
MasterputsI2C("ABC");
    
StopI2C();
/* Wait till stop sequence is completed */
    
while(I2CCONbits.PEN);
    
CloseI2C();
    return 
0;
}

發表於: 2006/10/13 2:38
不要問我哪裡來,我只是個流浪天涯的工程師
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... ]

教育訓練中心

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