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

論壇索引


Board index » All Posts (biko)




Re: 請問陣列中數量的判斷
資深會員
資深會員



發表於: 2010/3/12 18:14
我相信解決問題的方法不只一種,所以我在回答同好的問題時或者提出與主題不同的方案,
請不要以此做為攻擊的目標,畢竟我也只是想和大家討論如何解決問題而已…
解決問題最重要,.....
頂部


Re: 我電腦抓不到 漢堡!!
資深會員
資深會員


不知道您之前是不是正常,還是這次才不正常的?

還是這次是第一次燒錄?

我假設您是之前正常,現在才不正常的(也就是說您的ICD 2 Driver有安裝)。


Step 1:
在MPLAB下按Programer->Select Programer->None

Step 2:
拔掉漢寶

Step 3:
吃掉漢寶(記得加一些酸黃瓜醬,好吃)
PS.此步驟可省略

Step 4:
插上漢寶(插上後等一段時間,讓電腦重新抓ICD 2)

Step 5:
在MPLAB下按Programer->Select Programer->MPLAB ICD 2

Step 6:
再試著與板子連線

發表於: 2009/11/16 16:38
我相信解決問題的方法不只一種,所以我在回答同好的問題時或者提出與主題不同的方案,
請不要以此做為攻擊的目標,畢竟我也只是想和大家討論如何解決問題而已…
解決問題最重要,.....
頂部


Re: 請問用C18要怎麼把浮點數轉換成字串呢?
資深會員
資深會員


看看要不要用HI-TECH的PICC-18,C18我覺得有些難度…

HI-TECH的PICC-18可以讓您選擇是不是要使用float,很方便,至少我現在還沒有遇到問題.

C30是給16Bits MCU用的Compiler,如果您的MCU是18系列的話,那看了手冊也沒用。

我的用法是(HI-TECH PICC18):

extern void lcd_puts(char *s);

void main(void)
{
char buff[17];
float v = 1.234

sprintf(buff, "%02.3f", v);//將v 轉成字串
lcd_puts(buff);//將字串交給LCD顯示

}

發表於: 2009/11/16 15:39
我相信解決問題的方法不只一種,所以我在回答同好的問題時或者提出與主題不同的方案,
請不要以此做為攻擊的目標,畢竟我也只是想和大家討論如何解決問題而已…
解決問題最重要,.....
頂部


Re: Reset 幾次後程式會被改掉
資深會員
資深會員


您的這個程式雖然是官方的,但是蠻怪的。因為您的LCD是用4BITS去控制的,而您已經將它設為Output,但是BusyXLCD()這個函式在Read這幾支腳時,卻沒有將它設為Intput。
所以這四支腳一直處於Output的情況,那麼要怎麼讀取Busy的值呢?


另外,您的這個程式好像是舊版的,因為我跟我的不一樣^^"

參照:

Zenith 寫道:
1. BusyXLCD()內容如下,這是Microchip原有的程式,我沒有改它。
#include <p18cxxx.h>
#include "xlcd.h"

/********************************************************************
* Function Name: BusyXLCD *
* Return Value: char: busy status of LCD controller *
* Parameters: void *
* Description: This routine reads the busy status of the *
* Hitachi HD44780 LCD controller. *
********************************************************************/
unsigned char BusyXLCD(void)
{
RW_PIN = 1; // Set the control bits for read
RS_PIN = 0;
DelayFor18TCY();
E_PIN = 1; // Clock in the command
DelayFor18TCY();
#ifdef BIT8 // 8-bit interface
if(DATA_PORT&0x80) // Read bit 7 (busy bit)
{ // If high
E_PIN = 0; // Reset clock line
RW_PIN = 0; // Reset control line
return 1; // Return TRUE
}
else // Bit 7 low
{
E_PIN = 0; // Reset clock line
RW_PIN = 0; // Reset control line
return 0; // Return FALSE
}
#else // 4-bit interface
#ifdef UPPER // Upper nibble interface
if(DATA_PORT&0x80)
#else // Lower nibble interface
if(DATA_PORT&0x08)
#endif
{
E_PIN = 0; // Reset clock line
DelayFor18TCY();
E_PIN = 1; // Clock out other nibble
DelayFor18TCY();
E_PIN = 0;
RW_PIN = 0; // Reset control line
return 1; // Return TRUE
}
else // Busy bit is low
{
E_PIN = 0; // Reset clock line
DelayFor18TCY();
E_PIN = 1; // Clock out other nibble
DelayFor18TCY();
E_PIN = 0;
RW_PIN = 0; // Reset control line
return 0; // Return FALSE
}
#endif
}

2. RD0~RD3接到LCD的DB4~DB7

發表於: 2009/10/7 13:27
我相信解決問題的方法不只一種,所以我在回答同好的問題時或者提出與主題不同的方案,
請不要以此做為攻擊的目標,畢竟我也只是想和大家討論如何解決問題而已…
解決問題最重要,.....
頂部


Re: Reset 幾次後程式會被改掉
資深會員
資深會員


可以請問BusyXLCD()的內容嗎?
謝謝。
您的RD0是接到LCD的哪裡呢?

參照:

Zenith 寫道:
非常感謝Eigen的指點,我在ResetLCD()前加一行看LED狀態的程式,沒想到問題消失了,應該是如Eigen所言,LCD尚未Ready,加一行程式剛好等候LCD完成Reset,感謝各位先進提供的意見,真的學到不少知識。
TRISB=0xff;
TRISD=0;
TRISB=0;
PORTB=0;
PORTD=0x01; <--增加此行
ResetLCD();
OpenXLCD(FOUR_BIT & LINES_5X7);

發表於: 2009/10/7 12:09
我相信解決問題的方法不只一種,所以我在回答同好的問題時或者提出與主題不同的方案,
請不要以此做為攻擊的目標,畢竟我也只是想和大家討論如何解決問題而已…
解決問題最重要,.....
頂部



« 1 ... 83 84 85 (86) 87 88 89 »



:::

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

教育訓練中心

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