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

論壇索引


Board index » All Posts (hjlin@nfu.)




Re: dsp33ch的p33CH512MP508.h file不能更改
#1
新會員
新會員


您好

可是像原來
typedef struct tagADMOD0LBITS {
uint16_t SIGN0:1;
uint16_t :1;
uint16_t SIGN1:1;
uint16_t :1;
uint16_t SIGN2:1;
uint16_t :1;
uint16_t SIGN3:1;
uint16_t :1;
uint16_t SIGN4:1;
uint16_t :1;
uint16_t SIGN5:1;
uint16_t :1;
uint16_t SIGN6:1;
uint16_t :1;
uint16_t SIGN7:1;
} ADMOD0LBITS;

是沒有定義 uint16_t DIFF0:1; and uint16_t DIFF1:1;
那我要如何加這兩個定義?否則compilier會有redefine的問題!

typedef struct tagADMOD0LBITS {
uint16_t SIGN0:1;
uint16_t DIFF0:1;
uint16_t SIGN1:1;
uint16_t DIFF1:1;
uint16_t SIGN2:1;
uint16_t :1;
uint16_t SIGN3:1;
uint16_t :1;
uint16_t SIGN4:1;
uint16_t :1;
uint16_t SIGN5:1;
uint16_t :1;
uint16_t SIGN6:1;
uint16_t :1;
uint16_t SIGN7:1;
} ADMOD0LBITS;

thanks

發表於: 2020/5/14 11:19
頂部


dsp33ch的p33CH512MP508.h file不能更改
#2
新會員
新會員


我要用dspic33ch的AD轉換,發現p33CH512MP508.h裡面有一些SFR並沒有定義,例如我在程式裡自己定義ADCORE0H資料結構,如下
#define ADCORE0H ADCORE0H
extern volatile uint16_t ADCORE0H __attribute__((__sfr__));
typedef struct tagADCORE0HBITS {
uint16_t ADCS:7;
uint16_t :1;
uint16_t RES:2;
uint16_t EISEL:3;
} ADCORE0HBITS;

extern volatile ADCORE0HBITS ADCORE0Hbits __attribute__((__sfr__));

/* ADCON1H */
#define _ADCS ADCORE0Hbits.ADCS
#define _RES ADCORE0Hbits.RES
#define _EISEL ADCORE0Hbits.EISEL

#define _ADCORE0H_ADCS_POSITION 0x00000000//BIT POSITION
#define _ADCORE0H_ADCS_MASK 0x0000007F//0111111
#define _ADCORE0H_ADCS_LENGTH 0x00000007//7 BIT

#define _ADCORE0H_RES_POSITION 0x00000008//7TH BIT
#define _ADCORE0H_RES_MASK 0x00000300//0011=8
#define _ADCORE0H_RES_LENGTH 0x00000002//2 BIT

#define _ADCORE0H_EISEL_POSITION 0x0000000A
#define _ADCORE0H_EISEL_MASK 0x00001C00//1 1100
#define _ADCORE0H_EISEL_LENGTH 0x00000003

但是 ADMOD0Lbits.DIFF0和ADMOD0Lbits.DIFF1在p33CH512MP508.h裡ADMOD0L沒有定義到,而我改好p33CH512MP508.h又存不了,請問我該如何克服這些問題?

另外,p33CH512MP508.inc裡也要一起改?

謝謝

發表於: 2020/5/7 20:07
頂部






:::

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... ]

教育訓練中心

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