• slider image 514
  • slider image 516
  • slider image 517
  • slider image 518
  • slider image 519
:::


Browsing this Thread:   1 Anonymous Users






Re: 用C語言練習APP001 ADC
#4
初級會員
初級會員


查看用戶資訊
感謝兩位前輩的指導...
讓我可以把問題順利解決~~~
十分感謝~~~

發表於: 2007/5/14 10:46
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部


Re: 用C語言練習APP001 ADC
#3
版主
版主


查看用戶資訊
OpenADC
All Other Processors
Function: Configure the A/D convertor.
Include: 
adc.h
Prototype
void OpenADC(unsigned char config,
unsigned char config2 ,
unsigned char portconfig);


有找到嗎? 在 C:\mcc18\doc 目錄下,DS51297F-page 14

發表於: 2007/5/14 9:44
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部


Re: 用C語言練習APP001 ADC
#2
資深會員
資深會員


查看用戶資訊
你用的 OpenADC 的參數
是pic18f452的參數
和 pic18f4520 有點不一樣, 且該函式需有3個引數
請打開 adc.h 來研究一下就知道了

兩個方式

1. 使用pic18f452 IC 並改用p18f452.h 18f452i.lkr
2. 使用pic18f4520 IC 並修改OpenADC 函數的參數


發表於: 2007/5/12 21:32
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部


用C語言練習APP001 ADC
#1
初級會員
初級會員


查看用戶資訊
各位前輩
最近想轉成C語言的寫法...可是在自學時遇到了些問題~

在W401的課程中有一個是ADC的範例~
在OpenADC那一部份不太了解~

OpenADC( ADC_FOSC_32
& ADC_LEFT_JUST
& ADC_1ANA_0REF,
ADC_CH0
& ADC_INT_OFF );

而且在那一部份的編譯也出現了問題...邊譯後會出現下列的錯誤~

D:\W401 Answer\Ans3-1\ex3-1.c:31:Error [1105] symbol 'ADC_1ANA_0REF' has not been defined
D:\W401 Answer\Ans3-1\ex3-1.c:31:Error [1203] too few arguments in function call

請問我在程式的部份有那些問題呢??

下列附上範例程式..使用IC為18F4520

#include <p18f4520.h>
#include <adc.h>

void InitializeAD(void);

void main(void)
{
TRISD=0; // Set PORTD for LED output
InitializeAD( ); // Initial A/D module

while(1)
{
ConvertADC(); // Convert A/D
while(BusyADC( )); // Waiting A/D until done
PORTD=ADRESH; // Put A/D result on LEDs
}
}


void InitializeAD(void)
{
OpenADC( ADC_FOSC_32
& ADC_LEFT_JUST
& ADC_1ANA_0REF,
ADC_CH0
& ADC_INT_OFF );
}

麻煩各位前輩幫忙解答..謝謝~

發表於: 2007/5/12 17:09
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... ]

教育訓練中心

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