• slider image 442
  • slider image 492
  • slider image 493
  • slider image 494
  • slider image 495
  • slider image 496
:::


Browsing this Thread:   1 Anonymous Users






Re: dspic要用I2C讀24LC04B要使用PAGE的方式
#9
版主
版主


查看用戶資訊
"dsPIC30F Module Training - I2C 教材及練習 "
可以在這裡下載:
http://www.microchip.com.tw/modules/mydownloads/viewcat.php?cid=4

發表於: 2008/3/18 8:16
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部


Re: dspic要用I2C讀24LC04B要使用PAGE的方式
#8
初級會員
初級會員


查看用戶資訊
太感謝了.......又燃起一線希望...
小弟本來還想乾脆自己寫程模擬I2C出來的...

發表於: 2008/3/17 18:55
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部


Re: dspic要用I2C讀24LC04B要使用PAGE的方式
#7
版主
版主


查看用戶資訊
這些I2C的函數部是已經在 I2CSbus.c 的程式裡嗎? 已經提供了。

發表於: 2008/3/17 9:56
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部


Re: dspic要用I2C讀24LC04B要使用PAGE的方式
#6
初級會員
初級會員


查看用戶資訊
不好意思...問了一個笨問題...
原來函式裡面的code要自己寫的....
謝謝各位大大的幫助....

發表於: 2008/3/16 21:21
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部


Re: dspic要用I2C讀24LC04B要使用PAGE的方式
#5
初級會員
初級會員


查看用戶資訊
不好意思......底下未定義的函式不是都在i2c.h裡面嗎...
不是只要#include "i2c.h"就可以了嗎....
還需要做什麼定義嗎.....救救我呀....

D:\Test_20080315\main.o(.text+0x1e): In function `Init_I2C':
D:\Test_20080315\main.c:36: undefined reference to `ConfigIntI2C1'
D:\Test_20080315\main.o(.text+0x24):D:\Test_20080315\main.c:37: undefined reference to `OpenI2C1'
D:\Test_20080315\main.o(.text+0x32): In function `EEPROM_ByteWrite':
D:\Test_20080315\main.c:47: undefined reference to `IdleI2C1'
D:\Test_20080315\main.o(.text+0x34):D:\Test_20080315\main.c:48: undefined reference to `StartI2C1'
D:\Test_20080315\main.o(.text+0x42):D:\Test_20080315\main.c:53: undefined reference to `MasterWriteI2C1'
D:\Test_20080315\main.o(.text+0x52):D:\Test_20080315\main.c:57: undefined reference to `StopI2C1'
D:\Test_20080315\main.o(.text+0x64):D:\Test_20080315\main.c:61: undefined reference to `MasterWriteI2C1'
D:\Test_20080315\main.o(.text+0x72):D:\Test_20080315\main.c:65: undefined reference to `StopI2C1'
D:\Test_20080315\main.o(.text+0x84):D:\Test_20080315\main.c:69: undefined reference to `MasterWriteI2C1'
D:\Test_20080315\main.o(.text+0x92):D:\Test_20080315\main.c:73: undefined reference to `StopI2C1'
D:\Test_20080315\main.o(.text+0xa2):D:\Test_20080315\main.c:77: undefined reference to `StopI2C1'

發表於: 2008/3/15 22:26
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部


Re: dspic要用I2C讀24LC04B要使用PAGE的方式
#4
版主
版主


查看用戶資訊
到左邊檔案下載裡有 "dsPIC30F Module Training - I2C 教材及練習" 內有 code example 可供參考。
http://www.microchip.com.tw/modules/mydownloads/viewcat.php?cid=4

發表於: 2008/3/14 16:50
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部


Re: dspic要用I2C讀24LC04B要使用PAGE的方式
#3
初級會員
初級會員


查看用戶資訊
不好意思...針對pic我是初學者...
之前在使用MCU時都是用程式模擬出I2C的....
現在使用PIC24FJ32....是否只要設定好I2C的暫存器...
再把要傳的數值寫入傳送暫存器...
PIC IC就會自動產生SDA與SCL把資料寫入到EEPROM了嗎...
因為小弟在I2C方面一直弄不出來.....
還是小弟的I2C暫存器設定有問題....

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


Re: dspic要用I2C讀24LC04B要使用PAGE的方式
#2
版主
版主


查看用戶資訊
http://www.microchip.com.tw/example.htm
程式範例裡的 11.1 就有 PAGE Read & Write 的 code example, 雖然程式是用 C18 寫的但原理與流程是一樣的。

發表於: 2008/2/20 14:18
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部


dspic要用I2C讀24LC04B要使用PAGE的方式
#1
高級會員
高級會員


查看用戶資訊
小弟在使用I2C 讀24LC04B,RANDOM READ 讀取沒有問題
可是想改成PAGE READ的可是卻沒辦法讀取,可否告知小弟那裡程式寫錯了嗎?
謝謝

IdleI2C( ) ;
StartI2C( ) ;
while ( I2CCONbits.SEN) ;
IFS0bits.MI2CIF = 0 ;
MasterWriteI2C(0xA0) ; // Mask bit 0 -> Write command
while(! IFS0bits.MI2CIF ) ;
IFS0bits.MI2CIF = 0 ;
MasterWriteI2C(0x10) ; //資料位置
while(! IFS0bits.MI2CIF ) ;
IFS0bits.MI2CIF = 0 ;
RestartI2C( ) ;
while ( I2CCONbits.RSEN) ;
IFS0bits.MI2CIF = 0 ;
MasterWriteI2C(0xA1) ; // Set bit 0 for "Read" command
while(! IFS0bits.MI2CIF ) ;
IFS0bits.MI2CIF = 0 ;
Temp_Buffer3 = MasterReadI2C( ) ; //第一筆資料
while(! IFS0bits.MI2CIF ) ;
IFS0bits.MI2CIF = 0 ;
Temp_Buffer4 = MasterReadI2C( ) ; //第二筆資料
while(! IFS0bits.MI2CIF ) ;
IFS0bits.MI2CIF = 0 ;
Temp_Buffer5 = MasterReadI2C( ) ; //第三筆資料
while(! IFS0bits.MI2CIF ) ;
IFS0bits.MI2CIF = 0 ;
NotAckI2C( ) ;
while(! IFS0bits.MI2CIF ) ;
IFS0bits.MI2CIF = 0 ;
StopI2C( ) ;
while ( I2CCONbits.PEN ) ;

發表於: 2008/2/19 21:47
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... ]

教育訓練中心

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