• 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: 新手問題_P18f4520.h
#2
版主
版主


查看用戶資訊
access bank = 0x00 ~ 0x7F (RAM) + 0xF80 ~0xFFF (SFR共 256 Bytes。
PORTA & PORTAbits 在 H 檔裡並沒有關係,但他們在 P18F4520.o (p18F4520.asm) 裡都定義成相同的位址,所以就是相同的
詳細請看 W401 C18 第三章的說明。
LIST     P=18F452
              NOLIST
;------------------------------------------------
$Id$
MPLAB-Cxx PIC18F452 processor definition module
;
; (
cCopyright  Microchip Technology,  
;------------------------------------------------
SFR_UNBANKED0 UDATA_ACS   H'F80'
[color=ff0000]
PORTA
PORTAbits     RES 1         
0xF80 [/color]
PORTB
PORTBbits     RES 1         
0xF81
PORTC
PORTCbits     RES 1         
0xF82
PORTD
PORTDbits     RES 1         
0xF83
PORTE
PORTEbits     RES 1         
0xF84
              RES 4
LATA
LATAbits      RES 1         
0xF89
LATB
LATBbits      RES 1         
0xF8A
:
:

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


新手問題_P18f4520.h
#1
新會員
新會員


查看用戶資訊
對暫存器位址的定義有些問題,下面是部分定義
--------------------------------------------------------
extern volatile near unsigned char PORTA;
extern volatile near union {
struct {
unsigned RA0:1;
unsigned RA1:1;
unsigned RA2:1;
unsigned RA3:1;
unsigned RA4:1;
unsigned RA5:1;
unsigned RA6:1;
} ;
struct {
unsigned AN0:1;
unsigned AN1:1;
unsigned AN2:1;
unsigned AN3:1;
unsigned T0CKI:1;
unsigned SS:1;
unsigned OSC2:1;
} ;
struct {
unsigned :2;
unsigned VREFM:1;
unsigned VREFP:1;
unsigned :1;
unsigned AN4:1;
unsigned CLKOUT:1;
} ;
struct {
unsigned :5;
unsigned LVDIN:1;
} ;
} PORTAbits ;
--------------------------------------------------------
1.請問一下,我知道'near'應該是指將暫存器名稱位址定義到RAM中的Access Bank中,但是為什麼是從F80h開始安排呢?

2.暫存器PORTA和PORTAbits的定義不是兩個不同敘述嗎?PORTAbits不會另外有空間嗎?

初學問題可能很無聊
先謝過看完小弟問題的版友!

發表於: 2008/6/21 1:12
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... ]

教育訓練中心

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