• slider image 442
  • slider image 477
  • slider image 479
  • slider image 480
  • slider image 481
  • slider image 482
:::


Browsing this Thread:   1 Anonymous Users






18F 請問是否有讀寫本身EEPROM C 的函式
#1
中級會員
中級會員


查看用戶資訊
18F 請問是否有讀寫本身EEPROM C 的函式

發表於: 2004/6/21 18:25
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部


Re: 18F 請問是否有讀寫本身EEPROM C 的函式
#2
初級會員
初級會員


查看用戶資訊
沒有。但是這裡的401/WAP002教材範例程式中有。

發表於: 2004/6/22 11:22
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部


Re: 18F 請問是否有讀寫本身EEPROM C 的函式
#3
版主
版主


查看用戶資訊
答案應該是有的,Microchip 的 MPLAB C18 有提供完整的 EEPROM 存取函數給24LCxx的元件使用。請參考C18 Libraries user' guide (c:\mcc18\doc 目錄下 ) 章節2.4.2

另外W401的第六章有詳細的說明如何使用I2C來讀取EEPROM的範例程式。

------------------------------------------------------------------------------------------------------------------------------------------------
答案是..... 我看錯主題,誤為外部的EEPROM,沒注意到本身這兩個字, sorry,

僅附上 Internal EEPROM 讀寫函數供參考用(copy from WAP002 workshop)

//************************************************************
//* Internal EEPROM Access Function *
//************************************************************

void EE_Write (unsigned char EE_Address, unsigned char EE_Data)
{
PIR2bits.EEIF = 0;
EEADR = EE_Address;
EEDATA = EE_Data;
EECON1bits.EEPGD = 0;
EECON1bits.WREN = 1;
INTCONbits.GIE = 0;

_asm
MOVLW 0X55
MOVWF EECON2,0
MOVLW 0XAA
MOVWF EECON2,0
BSF EECON1,1,0
_endasm

INTCONbits.GIE = 1;
while (!PIR2bits.EEIF);
PIR2bits.EEIF = 0;
EECON1bits.WREN = 0;
}

unsigned char EE_Read (unsigned char EE_Address)
{
EEADR = EE_Address;
EECON1bits.EEPGD = 0;
EECON1bits.RD = 1;
return EEDATA;
}

發表於: 2004/6/23 13:31
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部


Re: 18F 請問是否有讀寫本身EEPROM C 的函式
#4
初級會員
初級會員


查看用戶資訊
Hi! You can refer to any one PIC18 data sheet, you'll see some statement to access with internal EEprom, make
sure your code are wrote closely (no other gabbage between you code), I suggest you use in-line assembly code to make the code as a function in your project.
If you still have problem on it, please contact with me.
Weikeng(Microchip Distributor)/Tony Fu (02-26590202 #315)

發表於: 2004/6/23 14:24
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... ]

教育訓練中心

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