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


Browsing this Thread:   1 Anonymous Users






如何配置PIC18F458之第二脚RA0/AN0/Cvref为独立参考电压输出?(附程序)
#1
新會員
新會員


查看用戶資訊
如题所示,用意是将输出(代替本应由DAC产生的模拟输出)电压作为外接模拟电路的比较器参考电压,但用万用表测不到PIN2的设定值输出。RA0到底该设为输入还是输出呢?具体应设置的寄存器有什么需要注意的问题吗?还是有些相互的限制约束呢?大侠们出手相救啊,感激ING!

PS:几行控制程序

#include <p18f458.h>

#pragma config OSC = HS
#pragma config WDT = OFF
#pragma config LVP = OFF
#pragma config DEBUG = ON



void main()
{

//ADCON1=0x07;
TRISA=0x01; //TRISA=TRISA&0xf9,or TRISB=0; configure portA to be output

CMCON=0x06;
CVRCON=0xe6; //set RA1 as the reference voltage of 12.5V,a delay needed
while(1)
{
;
}

}

發表於: 2006/3/21 19:25
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部


Re: 如何配置PIC18F458之第二脚RA0/AN0/Cvref为独立参考电压输出?(附程序)
#2
新會員
新會員


查看用戶資訊
有没有高手用过这个功能啊?肯请大大们出手啊

發表於: 2006/3/21 23:36
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部


Re: 如何配置PIC18F458之第二脚RA0/AN0/Cvref为独立参考电压输出?(附程序)
#3
新會員
新會員


查看用戶資訊
顶! 期待高手出招! 感激ING

發表於: 2006/3/22 9:41
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部


Re: 如何配置PIC18F458之第二脚RA0/AN0/Cvref为独立参考电压输出?(附程序)
#4
版主
版主


查看用戶資訊
加一下其它的設定:
1. ADCON1<PCFG3:PCFG0> = 0110 ; disable ADC, AN0 as digital function
2. TRISA<0> = 1 ; set AN0 as input.

發表於: 2006/3/23 17:35
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... ]

教育訓練中心

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