• slider image 442
  • slider image 483
  • slider image 484
  • slider image 485
  • slider image 486
  • slider image 487
  • slider image 488
  • slider image 491
:::


Browsing this Thread:   1 Anonymous Users






Re: 關於 C18 EEPROM範例 的一個小問題
#4
版主
版主


查看用戶資訊
PIC18F EEPROM:
;******************************************************************************
;
EEPROM data
Data to be programmed into the Data EEPROM is defined here with "DE" directive

        ORG    0xf00000

        DE    
"Test Data",0,1,2,3,4,5

Using the relocatable syntax have to follow as below syntax and add 
a section "DATA_EEPROM" into the 18f452.lkr 
;
CODEPAGE   NAME=eedata          START=0xF00000       END=0xF000FF       PROTECTED
SECTION    NAME=DATA_EEPROM     ROM=eedata
;
;
DATA_EEPROM    CODE    0xf00000
;
;        
DE    "Test Data",0,1,2,3,4,5


PIC16Fxxx EEPROM:
;*************     Declare EEPROM Data Byte   ********************
;
Syntax:     [<label>] de <expr> [, <expr>, ..., <expr>]
;
Reserve memory words with 8-bit dataEach <exprmust evaluate
to an 8-bit valueThe upper bits of the program word are zeroes
Each character in a string is stored in a separate word.
Although designed for initializing EEPROM data on the PIC16F877A,
;
; As 
following example code will generated the EEDATA into the Hex file
;
        
org    0x2100        Set EEDATA location at 0x00
;
        
DE    "Microchip Technology"0x00
        DE    
"Firmware Version V2.30"0x00
;
        
org    0x2180        Set EEDATA location at 0x80
;
        
DE    'a','b','c','d'0x0A0x0D0x00,0x00

;----------------------------------------------------------------------
; If 
you are using relocatable syntaxplease use the CODE section 
The section declare have been defined in the 16f877a.lkr
;
;              Declare 
EEDATA in the 16f877a.lkr
CODEPAGE   NAME=eedata   START=0x2100   END=0x21FF   PROTECTED
SECTION    NAME=DEEPROM  ROM=eedata          
;----------------------------------------------------------------------


大小寫有分的。

發表於: 2005/9/15 14:29
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部


Re: 關於 C18 EEPROM範例 的一個小問題
#3
中級會員
中級會員


查看用戶資訊
請問PIC16 或是 PIC18 Assembly 要如何定義?

C18 宣告 EEDATA 與 eedata 是否有大小寫區分?

謝謝!!

發表於: 2005/9/14 16:06
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部


Re: 關於 C18 EEPROM範例 的一個小問題
#2
版主
版主


查看用戶資訊
因為程式前面有直接定義 EEPROM 燒錄資料,所以要特別指定 EEPROM 實際 ICSP 燒錄的位址,LKR 檔就必須加入 EEPROM 的節區位址。
// *****     Define byte data into the Internal EEPROM    *****
//
#pragma romdata EEDATA
rom unsigned char EE_Dara1[] = {0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07};
rom unsigned char EE_Data2[] = {0x08,0x09,0x0a,0x0b,0x0c,0x0d,0x0e,0x0f};
rom unsigned char EE_Data3[] = {'H','i','-','T','e','c','h',0x00,};
rom unsigned int EE_Data4 0xAAA0,EEdata 0xAAA2;
rom unsigned long EE_Data6 0x61626364;
#pragma romdata


EEPROM 節區是指到這個位址的:
CODEPAGE NAME=eedata START=0xF00000 END=0xF000FF PROTECTED

發表於: 2005/9/13 17:44
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部


關於 C18 EEPROM範例 的一個小問題
#1
資深會員
資深會員


查看用戶資訊
範例程式裡有個
如何讀寫 PIC18FXXX 內部 EEPROM 的範例

其中 18f452i_EEDATA.lkr 是把原來的lkr檔加了一行
SECTION NAME=EEDATA ROM=eedata

請問要用EEPROM, 那個修改是必要的動作嗎?
那一行SECTION 定義的意思是啥?

發表於: 2005/9/12 10:41
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... ]

教育訓練中心

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