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

論壇索引


Board index » All Posts (yaung_168)




PIC18F4550之AD使用的請教
#1
新會員
新會員


版主好:
請問一下,可以提供CDC class下,PIC18F4550之AD轉換的簡單範例嗎? Thanx U~

發表於: 2005/10/12 11:38
頂部


CDC 執行的請教!
#2
新會員
新會員


大家好:
我在使用APP013及PIC18F4550燒錄MCHPFSUSB\fw\CDC\MCHPUSB.mcp時,發生下列問題,想請問大家,是哪裡有錯阿,Build All都OK!

MPLAB ICD 2 Ready
Programming Target...
...Validating configuration fields
...Erasing Part
...Programming Program Memory (0x0 - 0x19FF)
Verifying...
...Program Memory
ICD0161: Verify failed (MemType = Program, Address = 0x0, Expected Val = 0xEFED, Val Read = 0xEF31)
ICD0275: Programming failed.
MPLAB ICD 2 Ready

發表於: 2005/10/12 11:26
頂部


idata_Main.o' length=0x000001b6
#3
新會員
新會員


大家好, 請問以下的問題, 有人能幫我解答一下嗎, 拜託大家啦, 謝謝!


MPLINK 3.90, Linker
Copyright (c) 2004 Microchip Technology Inc.
Error - section '.idata_Main.o' can not fit the section. Section '.idata_Main.o' length=0x000001b6
Errors : 1

BUILD FAILED: Wed Jun 01 12:03:59 2005

發表於: 2005/6/1 12:16
頂部


使用 C18 (PIC18FXXX) 製作一儲存裝置
#4
新會員
新會員


大家好,有人使用C18來製作一儲存裝置嗎,像是SD card或是CF card等,可否留下E-mail,大家交流一下,謝謝喔~~~

發表於: 2005/4/17 23:23
頂部


The example of the SD card of the PIC18F4550
#5
新會員
新會員


大家好,之前上W401的課程時,老師說Microchip的美國網站上,有SD card的範例,可是我還是沒有找到呢,請各位前輩指點一下,告訴我是在哪裡阿?謝謝喔~~~

發表於: 2005/4/17 23:11
頂部


PIC18 A/D convert 的請教
#6
新會員
新會員


大家好,我是使用PIC18F452,目前利用RA0/AN0當作類比輸入,並將2次之轉換結果,進行比較,最後把比較結果顯示於LCD.
燒錄成功後,卻沒有任何顯示,請問是A/D程式有問題嗎?多謝賜教! Thanx~
或是誰有更多有關A/D的參考程式,可否提供一下!

...
char e1, e2;

void main (void)
{
...

InitializeAD( );
ConvertADC();
while(BusyADC( ));
e1=ADRESH;
...

InitializeAD( );
ConvertADC();
while(BusyADC( ));
e2=ADRESH;

if(e1<e2)
{
OpenLCD( );
LCD_Set_Cursor(0,0);
LCD_L_Delay() ;
putsLCD('1');
LCD_L_Delay();
Delay10KTCYx(CPU_SPEED / 200000) ;
}

else
{
OpenLCD( );
LCD_Set_Cursor(0,0);
LCD_L_Delay() ;
putsLCD('0');
LCD_L_Delay();
Delay10KTCYx(CPU_SPEED / 200000) ;
}
}

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



發表於: 2005/4/11 3:22
頂部


APP001 REV.2 的 LCD 顯示問題
#7
新會員
新會員


大家好, 由於 APP001 REV.2 的 LCD module 為:
LCD E => PORTAbits.RA2
LCD R/W => PORTDbits.RD5
LCD RS => PORTDbits.RD4
LCD DATA => RD4 .. RD7 as LCD Data
可是我在 dubug OK 之後, 卻不會顯示想要之結果!
可否告訴我, 是哪裡的問題阿? 謝謝~~

*************************************

#include <p18f452.h>
#include <delays.h>
#include "p18LCD.h"
#define LCD_DATA PORTD
#define LCD_CMD PORTD

void InitializePORT(void);
void OpenLCD (void) ;

unsigned char TAB2[]="yang";

void main (void)
{
InitializePORT();
OpenLCD();
LCD_Set_Cursor(0,0);
putcLCD(TAB2);
}

void InitializePORT(void)
{
TRISD=0;
PORTD=0x00;
}

*************************************
void OpenLCD(void)

{
LCD_CTRL = LCD_CTRL & 0b11001111 ;
// Set LCD E,R/W,RS to Low
LCD_DATA = LCD_DATA & 0b11110000 ;
// LCD DB[4:7] to Low
DIR_LCD_CTRL &= 0b11001111 ;
// E,R/,RS are Output pin
DIR_LCD_DATA &= 0b11110000 ;
// LCD DB[4:7} are output

LCD_DATA = 0b00000011 ;
LCD_CMD_W_Timing() ;
LCD_L_Delay() ;

LCD_DATA = 0b00000011 ;
LCD_CMD_W_Timing() ;
LCD_L_Delay() ;

LCD_DATA = 0b00000011 ;
LCD_CMD_W_Timing() ;
LCD_L_Delay() ;

LCD_DATA = 0b00000010 ;
LCD_CMD_W_Timing() ;
LCD_L_Delay() ;

WriteCmdLCD(DISP_2Line_4Bit) ;
LCD_S_Delay() ;

WriteCmdLCD(DISP_ON) ;
LCD_S_Delay() ;

WriteCmdLCD(ENTRY_INC) ;
LCD_S_Delay() ;

WriteCmdLCD(CLR_DISP) ;
LCD_L_Delay() ;
}

void LCD_Set_Cursor(unsigned char CurY, unsigned char CurX)
{
WriteCmdLCD( 0x80 + CurY * 0x40 + CurX) ;
LCD_S_Delay() ;
}

void WriteCmdLCD( unsigned char LCD_CMD)
{
Temp_CMD = (LCD_CMD & 0xF0)>>4 ;
// Send high nibble to LCD bus
LCD_DATA= (LCD_DATA & 0xF0)|Temp_CMD ;
LCD_CMD_W_Timing () ;

Temp_CMD = LCD_CMD & 0x0F ;
// Send low nibble to LCD bus
LCD_DATA= (LCD_DATA & 0xF0)|Temp_CMD ;
LCD_CMD_W_Timing () ;
LCD_S_Delay() ;
// Delay 100uS for execution
}

void WriteDataLCD( unsigned char LCD_CMD)
{

Temp_CMD = (LCD_CMD & 0xF0)>>4 ;
// Send high nibble to LCD bus
LCD_DATA= (LCD_DATA & 0xF0)|Temp_CMD ;
LCD_DAT_W_Timing () ;

Temp_CMD = LCD_CMD & 0x0F ;
// Send low nibble to LCD bus
LCD_DATA= (LCD_DATA & 0xF0)|Temp_CMD ;
LCD_DAT_W_Timing () ;

LCD_S_Delay() ;
// Delay 100uS for execution
}

void putcLCD(unsigned char LCD_Char)
{
WriteDataLCD(LCD_Char) ;

}

void LCD_L_Delay(void)
{
Delay10KTCYx(CPU_SPEED / 2) ;
}


發表於: 2005/4/5 16:51
頂部


主程式與指令程式的問題
#8
新會員
新會員


大家好,我是使用C18來進行Build All,在source files加入主程式與指令程式,但卻顯示:

Error - symbol 'F_Delay' has multiple definitions.

請各位前輩,告訴我,是哪裡出錯阿! 謝謝~~~

主程式:
#include <p18cxxx.h>
#include "delay.c"
#define LEFT 0
#define RIGHT 1
void F_Initial ( void );
void main (void)
{
int I_Direction=LEFT;
F_Initial();
while ( 1 )
{
F_Delay ( 5000 );
switch ( I_Direction )
{
case LEFT:
PORTD <<= 1;
if ( PORTD == 128 )
I_Direction = RIGHT;
break;
case RIGHT:
PORTD >>= 1;
if ( PORTD == 1 )
I_Direction = LEFT;
break;
default:
break;
}
}
}

void F_Initial ()
{
TRISD = 0;
PORTD = 1;
}

指令程式:
#include <p18cxxx.h>
#include <delays.h>
#define LCD_CMD PORTE
#define LCD_DATA PORTB
void F_LCD_Clear(void);
void F_LCD_Home(void);
void F_LCD_Entry(unsigned char);
void F_LCD_Display(unsigned char);
void F_LCD_Cursor(unsigned char);
void F_LCD_Function(unsigned char);
void F_LCD_Set_CGA(unsigned char);
void F_LCD_Set_DDA(unsigned char);
unsigned char F_Check_LCD_Busy(void);
void F_LCD_Put_Cmd(unsigned char);
void F_LCD_Put_Data(unsigned char);
void F_LCD_Initial(void);
void F_LCD_Clear(void)
{
F_LCD_Put_Cmd(0x01);
Delay10TCYx(200);
}

void F_LCD_Home(void)
{
F_LCD_Put_Cmd(0x02);
}

void F_LCD_Entry(unsigned char UC_LCD_CMD)
{
F_LCD_Put_Cmd(0x04 | (0x03 & UC_LCD_CMD));
}

void F_LCD_Display(unsigned char UC_LCD_CMD)
{
F_LCD_Put_Cmd(0x08 | (0x07 & UC_LCD_CMD));
}

void F_LCD_Cursor(unsigned char UC_LCD_CMD)
{
F_LCD_Put_Cmd(0x10 | (0x0c & UC_LCD_CMD));
}

void F_LCD_Function(unsigned char UC_LCD_CMD)
{
F_LCD_Put_Cmd(0x20 | (0x1c & UC_LCD_CMD));
}

void F_LCD_Set_CGA(unsigned char UC_LCD_CMD)
{
F_LCD_Put_Cmd(0x40 | (0x3F & UC_LCD_CMD));
}

void F_LCD_Set_DDA(unsigned char UC_LCD_CMD)
{
F_LCD_Put_Cmd(0x80 | (0x7F & UC_LCD_CMD));
}

unsigned char F_Check_LCD_Busy(void)
{
unsigned char UC_LCD_Temp;
TRISB = 0xFF;
LCD_CMD = 0x06;
UC_LCD_Temp = (0x80 & LCD_DATA);
TRISB = 0;
if ( UC_LCD_Temp == 1 )
return (1);
else
return (0);
}

void F_LCD_Put_Cmd(unsigned char UC_LCD_CMD)
{
while ( F_Check_LCD_Busy() );
LCD_CMD = 0x04;
LCD_DATA = UC_LCD_CMD;
LCD_CMD = 0x00;
Delay10TCYx(50);
}

void F_LCD_Put_Data(unsigned char UC_LCD_Data)
{
while ( F_Check_LCD_Busy() );
LCD_CMD = 0x05;
LCD_DATA = UC_LCD_Data;
LCD_CMD = 0x01;
Delay10TCYx(50);
}

void F_LCD_Initial(void)
{
F_LCD_Put_Cmd(0x30);
F_LCD_Put_Cmd(0x30);
F_LCD_Put_Cmd(0x30);
F_LCD_Function(0x38);
F_LCD_Display(0x0e);
F_LCD_Clear();
F_LCD_Entry(0x06);
}

發表於: 2005/3/30 10:01
頂部


Target not in debug mode 的問題
#9
新會員
新會員


各位前輩,我在進行ICD 2燒錄時,不論是使用MPASM或C18,都一直顯示下面的句子,可否告訴晚輩是哪裡的問題阿,謝謝大家!


MPLAB ICD 2 Ready
.............
ICDWarn0013: Low Voltage Programming cannot be
enabled when ICD 2 is used as a
debugger. Disable Low Voltage
Programming?
ICDWarn0014: Watchdog Timer cannot be enabled when
ICD 2 is enabled as a debugger. Disable
Watchdog Timer?
..............
ICD0083: Target not in debug mode, unable to perform
operation

發表於: 2005/3/30 2:11
頂部


Application to USB from RS-232 UART (for PIC18F4550)
#10
新會員
新會員


請問一下,是否有人知道,PIC18F4550將RS-232轉成USB的使用方法嗎?或是可以提供C18程式的範例?

謝謝大家的幫忙!

網頁:
http://www.microchip.com/stellent/idc ... Id=1335&dDocName=en010300

PDF檔案:
http://ww1.microchip.com/downloads/en/AppNotes/00956b.pdf

yaung.joe@msa.hinet.net ........ 這是我的信箱,歡迎指教!

發表於: 2005/3/29 17:26
頂部






:::

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

教育訓練中心

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