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


Browsing this Thread:   1 Anonymous Users






Re: 關於PORTF的問題
#7
高級會員
高級會員


查看用戶資訊
版主真是謝謝你~~~真的可以正常動作了咧~~~
謝謝你常常幫我解決一下很基本的東西~~~
辛苦了~~

發表於: 2005/2/22 8:35
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部


Re: 關於PORTF的問題
#6
版主
版主


查看用戶資訊
再加入一行 CMCON=0x07; 將 PORTF<3:6> 的比較器功能關掉。

發表於: 2005/2/18 18:12
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部


Re: 關於PORTF的問題
#5
高級會員
高級會員


查看用戶資訊
那為什麼我用MPLAB ICD2
做起來卻是不正常的情形ㄋ
一樣的程式碼應該要有一樣的反應啊~~~
我真是想不懂了??
為什麼只要我設DATA的值是HIGH只要遇到WR變成HIGH
DATA就會自動變成LOW勒
用了老半天還是這樣勒

發表於: 2005/2/18 17:18
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部


Re: 關於PORTF的問題
#4
版主
版主


查看用戶資訊
#include <p18f6520.h>
#include <delays.h>

#define CS PORTFbits.RF7
#define RD PORTFbits.RF6
#define WR PORTFbits.RF5
#define LCDDATA PORTFbits.RF4

unsigned i;

void main(void)
{
ADCON1=0xFF,
TRISFbits.TRISF7=0;
TRISFbits.TRISF6=0;
TRISFbits.TRISF5=0;
TRISFbits.TRISF4=0;
while(1)
{
for(i = 0;i<=11;i++)
{
WR = 0;
Delay10TCYx(2);
LCDDATA = 1;
Delay10TCYx(2);
WR = 1;
Delay10TCYx(2);
}
}
}

用 MPLAB SIM 測試起來 一切正常。

發表於: 2005/2/18 16:58
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部


Re: 關於PORTF的問題
#3
高級會員
高級會員


查看用戶資訊
結果還是一樣ㄋ~~還有什麼沒注意到的嗎~~
還是程式該如何改才會正常動作啊??

發表於: 2005/2/18 16:01
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部


Re: 關於PORTF的問題
#2
版主
版主


查看用戶資訊
PORTF 與 AD 輸入共用,而Power-on的 default setting 是AD 輸入。 請先設定一下 ADCON1 暫存器將沒用的AD關掉。

發表於: 2005/2/18 15:27
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部


關於PORTF的問題
#1
高級會員
高級會員


查看用戶資訊
型號:P18F6520

#define CS PORTFbits.RF7
#define RD PORTFbits.RF6
#define WR PORTFbits.RF5
#define LCDDATA PORTFbits.RF4

void main(void)
{
TRISFbits.TRISF7=0
TRISFbits.TRISF6=0
TRISFbits.TRISF5=0;
TRISFbits.TRISF4=0;
while(1)
{
for(i = 0;i<=11;i++)
{
WR = 0;
Delay10TCYx(2);
LCDDATA = 1;
Delay10TCYx(2);
WR = 1;
Delay10TCYx(2);
}
}
在WHILE(1)裡面的那個FOR迴圈
為什麼會有當WR變成HIGH時LCDDATA會變為LOW呢
我有設定錯誤嗎還是PORTF有些特殊的功能呢?

發表於: 2005/2/18 11:22
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... ]

教育訓練中心

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