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


Browsing this Thread:   1 Anonymous Users






Re: 请教,SOS!!!
#5
版主
版主


查看用戶資訊
看了你的匯編程序,網建議你應該再將資料手冊有關 Internal EEPROM 的部分在讀清楚些,EECON2 是個解鎖用的寄存器你忘了寫 0x55及0xAA給它了。

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


Re: 请教,SOS!!!
#4
版主
版主


查看用戶資訊
這是用 C 寫的 Internal EEPROM Access for PIC18F452, 程式可以動作的。要注意一下的是用 ICD2 debug 時,EEPROM 的視窗是不會自動更新的,你必須用讀取device的動作才能將EEPROM的資料更新。

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/9/24 22:10
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部


Re: 请教,SOS!!!
#3
初級會員
初級會員


查看用戶資訊
我是向18F452自带的EEPROM里面写入数据啊,而且我也调试过右边的范例程式,发现也出现的是同样的情况。

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


Re: 请教,SOS!!!
#2
版主
版主


查看用戶資訊
您想寫那一顆呢?

發表於: 2004/9/24 15:12
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部


请教,SOS!!!
#1
初級會員
初級會員


查看用戶資訊
我有下面的程式向EEPROM里面写入数据,通过SIM调试和实际电路运行,都没有发现数据被写入,请问我下面的程序有什么问题吗? 我也调试过右边的范例程式,发现取出的数值是正确的,但是往EEPROM里面写数值就观察不到了
WREE
MOVF POINTER0, W
MOVWF EEADR
MOVF DAT0, W
MOVWF EEDATA
MOVLW 0X41
MOVWF EEDATA
BCF EECON1, EEPGD
BCF EECON1, CFGS
BSF EECON1, WREG
NOP
NOP
NOP
NOP
BCF EECON1, WREG
INCF POINTER0,F
INCF DAT0, F
DECFSZ CNT0,F ;初始执CNT=20H
GOTO WREE
GOTO

發表於: 2004/9/21 9:17
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... ]

教育訓練中心

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