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

論壇索引


Board index » All Posts (shiue)




MLA的USB的PC - Driver Management Tool
高級會員
高級會員



發表於: 2014/2/18 15:23
頂部


Re: 發現ADC.h的內容有誤
#2
高級會員
高級會員


#include <p18cxxx.h>
#include <adc.h>

#elif defined (ADC_V4) || defined (ADC_V5) || defined (ADC_V6)
void OpenADC ( unsigned char config,
unsigned char config2,
unsigned char portconfig)
{
ADCON0 = 0;
ADCON2 = 0;

ADCON0 = (config2 >>1) & 0b00111100; // GET CHANNELS
ADCON1 = portconfig | // GET CONFIG
((config2 << 4) & 0b00110000); // GET Vref
ADCON2 = (config & 0b10000000) | // RESULT
((config >> 4) & 0b00000111) | // CONV CLK
((config << 2) & 0b00111000); // ACQ TIME

if( config2 & 0b10000000 ) // ADC INT.
{
PIR1bits.ADIF = 0;
PIE1bits.ADIE = 1;
INTCONbits.PEIE = 1;
}
ADCON0bits.ADON = 1;
}
------------------------------------------------------------
如上為原始檔
我已經測試過
發現錯誤
所以才上來請教
Microchip公司會發生這種錯誤嗎?

發表於: 2009/12/17 9:02
頂部



(1) 2 3 4 ... 9 »



:::

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

教育訓練中心

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