• 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 (Phoenix)




Error [800]是什麼 ??
初級會員
初級會員



發表於: 2010/5/12 18:25
頂部


Re: 美國原廠樣品無法再申請了?
#2
初級會員
初級會員


參照:

Ryang 寫道:
剛到 microchipsample.com 網站,通通都被關起來不能申請了。那就透過代理商申請,Direct Account 找負責貴公司的 FAE or Sales。
學校單位就請發 e-mail 給 CAE (Calvin Ho & Richard Yang) 來申請。


版主:

請問這兩位CAE的Mail是什麼呢??
有用edu.tw的信寄過去,但是好像寄錯地方了~
如果申請樣品的話,還需要附上那些資料呢??

謝謝

發表於: 2009/4/27 11:48
頂部


Re: 程式編譯後產生Error[984]的錯誤
#3
初級會員
初級會員


我了解了~~原來是這樣啊~~

謝謝版主及各位先進的解說~讓我又上了一課~

真是太感謝了~

發表於: 2009/4/17 15:00
頂部


Re: 程式編譯後產生Error[984]的錯誤
#4
初級會員
初級會員


參照:

nicecookie 寫道:
void PWM( int Data)
改成
void PWM( unsigned int Data)
試看看



先謝過這位先進~
我試過 (unsigned int Data)
還是有同樣的錯訊息~

但是我發現一個很有趣的地方~
只要我MPLAB IDE 用8.0的,第一次編譯會錯誤,但是再編譯一次就ok了~錯誤就消失,而且編譯無誤~

但是用8.30版就會一直錯誤,再編譯一次還是存在那錯誤~

發表於: 2009/4/16 21:38
頂部


程式編譯後產生Error[984]的錯誤
#5
初級會員
初級會員


各位先進~
我寫了一個小程式,編譯後錯產生了這錯誤~
程式如下:

#include <pic18.h>

#define SW3 RA4
#define SW2 RB2
#define ENB RC0


unsigned int temp;
unsigned int temp2;

void Delay_x_mS(int);
void Delay_1mS(void);
void Delay_x_uS(int);
void Delay_1uS(void);


void init(void); //初始化

/*==============================================
Main
==============================================*/
void main(void)
{

init();

while(1)
{
PORTD = 0x00;
PWM(0x55);
PORTD = temp2;
Delay_x_mS(2000);
PORTD = 0x00;
Delay_x_mS(1000);
RA1 = 0;

}
}

/*==============================================
init
==============================================*/

void init(void)
{

TRISA = 0b11111100; //設定PortA
TRISD = 0b00000000; //設定PortD
TRISB = 0b11111110; //設定PortB
TRISC = 0b11111111; //設定PortB
PORTD = 0x00; //清除PORTD

}



/*==============================================
Data
==============================================*/

void PWM( int Data)
{
unsigned int i;
temp2 = 0x00;

for( i =7;i>=0;i-- )
{
temp = ( Data >> i) & 0x01;
Delay_x_mS(125);
RA0 = temp;
RB0 = temp;

temp2 = temp2 << 1;
NOP();NOP();
if(RC0==1) temp2 |= 0x01;
NOP();NOP();
RA0 = 0;
RB0 = 0;
}
}







/*==============================================
delay_ms
==============================================*/
void Delay_x_mS( int N_mS )
{
unsigned int Loop_mS ;

for ( Loop_mS = 0 ; Loop_mS < N_mS ; Loop_mS++ )
{
Delay_1mS();
}

}

//*** Delay 1mS with 16MHz crystal

void Delay_1mS(void)
{
unsigned int Del_1mS;

for (Del_1mS = 0 ; Del_1mS < 350 ; Del_1mS ++ )
{
asm("nop");
asm("nop");
}
}


-----------------------------------------------------------------

但是編譯後,卻發生了錯誤分別是:
Warning [361] D:\C-project\test.c; 42.1 function declared implicit int
Error [984] D:\C-project\test.c; 74.1 type redeclared

但是,找了許久,改了又改,還是一直有這問題存在一直無法編譯~

警告的那一行是 PWM(0x55);

而錯誤的另一行的位置很奇怪,是在:
void PWM( int Data)
{<---------Error

不曉得,問題出在那個地方,還請各位先進及版主幫幫忙~
萬分感謝~

發表於: 2009/4/16 20:39
頂部


Re: 使用PIC18F4550軟體I2C讀不到EEPROM資料的問題
#6
初級會員
初級會員


感謝版主的回覆~

我是利用萬用燒錄器,將EEPROM中的資料讀出~
合對EEPROM中的位置,是否與寫入之值相同~
所以才得知,資料有寫進EEPROM之中~

版主,我以分析儀的圖擷取出也以上傳了~
謝謝~

如果各位大大 有相關的意見,也拜託給我一點建議~謝謝~

Attach file:



jpg  (0.00 KB)


jpg  (0.00 KB)


發表於: 2008/10/16 10:04
頂部


使用PIC18F4550軟體I2C讀不到EEPROM資料的問題
#7
初級會員
初級會員


各位大大~
我用了AN997還有之前版上一位前輩的範例~整合一個程式~
已經成功的將EEPROM寫入資料了~
可是目前卻是遇到讀不出資料的問題~

貼上讀取EEPROM的程式~還請各位大大幫忙~
程式中是否出錯~

==============================

/*=============================================
腳位定義: RA0 ===> SCL
RA1 ===> SDA
PORTD ===> All LED
==============================================*/
#define SW3 RA4
#define SW2 RB2
#define SCL RA0 //PORTA.RA0==>SCL
#define SDA RC0 //PORTA.RA1==>SDA
#define SDA_TRIS TRISC0 //SDA tris bit, PORTA pin 1
#include <pic18.h> //#include <pic18f4550.h>


void init(void);
void delay(void);

void I2C_start(void);
void I2C_write(void);
void I2C_read(void);
void I2C_stop(void);
void I2C_RecData(void);

unsigned char I2cRecData( void );

unsigned int ee_data;
unsigned int ee_temp;
unsigned int address;
unsigned char address_High;
unsigned char address_Low;

unsigned char temp;

/*==============================================
Main Program
==============================================*/
void main(void)
{

unsigned char temp1;
unsigned char i;
init();
while(1)
{
if(!SW3)
{

Delay_x_mS(100);
I2C_read();

}

}

}


/*==============================================
init
==============================================*/
void init(void)
{
TRISA = 0b00010000; //設定PortA
TRISD = 0b00000000; //設定PortD
TRISB = 0b00000100; //設定PortB
PORTD = 0x00; //清除PORTD

}

/*==============================================
I2C_start
==============================================*/
void I2C_start(void)
{

SDA_TRIS = 1; // Ensure SDA is high
SCL = 1; // Ensure SCL is high
SDA = 1;
SDA_TRIS = 0; // Configure SDA as an output
SDA = 0; // Pull SDA low
SCL = 0; // Pull SCL low



}

/*==============================================
I2C_data
==============================================*/

void I2C_data( unsigned char Data )
{
signed char i;
SDA_TRIS = 0;


for( i =7;i>=0;i-- )
{
SCL = 0;

temp = ( Data >> i) & 0x01;
SDA = temp;
SCL = 1;

}
SDA_TRIS = 1;

NOP();
SCL = 0;
NOP();
SCL = 1;
NOP();
SCL = 0;

SDA_TRIS = 0;
}



/*==============================================
I2C_address
==============================================*/
void I2C_address(unsigned char SlaveAddr, unsigned char Mode) // Write : Mode = 0, Read : Mode = 1
{
unsigned char Addr;
signed char i;
SDA_TRIS = 0;
SCL = 0;
Addr = SlaveAddr | Mode;
SDA = 0;
for( i=7;i>=0;i-- )
{

SCL = 0;

temp = ( Addr >> i ) & 0x01;
SDA = temp;

SCL = 1;

}

SDA_TRIS = 1;

SCL = 0;
NOP();
NOP();
SCL = 1;
NOP();
SCL = 0;
SDA_TRIS = 0;
SDA = 0;

}

/*==============================================
I2C_stop
==============================================*/
void I2C_stop(void)
{

SCL = 0; // Ensure SCL is low
SDA_TRIS = 0; // Configure SDA as an output
SDA = 0; // Ensure SDA low
SCL = 1; // Pull SCL high
SDA = 1;
SDA_TRIS = 1; // Allow SDA to be pulled high

}



/*==============================================
I2C_write
==============================================*/
void I2C_write(void)
{

signed char i;
signed char u;
i=0x20;
I2C_start();
NOP();
I2C_address(0xA0,0);
NOP();
I2C_data(0x01);
NOP();
I2C_data(0x00);
NOP();
for(u=63;u>=0;u--)
{
NOP();
I2C_data(i);
i++;

}

NOP();
NOP();

I2C_stop();



}

/*==============================================
I2C_read
==============================================*/
void I2C_read(void)
{
unsigned char temp1;

I2C_start();
NOP();
I2C_address(0xA0,0);
NOP();
I2C_data(0x00);
NOP();
I2C_data(0x02);
NOP();
I2C_start();
NOP();
I2C_address(0xA0,1);
NOP();
temp1 = I2cRecData();

NOP();
I2C_stop();

PORTD = temp1;
Delay_x_mS(2000);
}

/*==============================================
I2C_recdata
==============================================*/
unsigned char I2cRecData( void )
{

signed char i;
unsigned char temp2;
temp2 = 0x00;
SDA_TRIS = 1;
NOP();
for( i=7;i>=0;i-- )
{
SCL = 0;
NOP();NOP();
SCL = 1;
NOP();NOP();
temp2 << 1;
NOP();NOP();
if(SDA==1) temp2 |= 0x01;
NOP();NOP();
}
SDA_TRIS = 0;

SCL = 0;
SCL = 1;
SDA = 1;



SDA = 0;
SCL = 0;
return temp2;

}


==================================

目前的問題,讀不到EEPROM中資料~

用邏輯分析儀看波形,所有的波形都有出來~~

但是在最後的讀取部分,SDA大部份都是低準位,完全沒有丟出EEPROM之中的0x55~

還請各位大大幫忙~謝謝~

發表於: 2008/10/15 22:02
頂部


Re: 關於PICDEM Z實驗版上IC之問題
#8
初級會員
初級會員


有嗎??我的PICDEM Z只有一顆PIC18LF4620~
而在PIC18F的正下方有預留一組28腳的DIP插槽~~

在我的 PICDEM Z 上沒有多一顆PIC18LF2620的IC~
只有預留腳位~~沒看到PIC IC~~


發表於: 2007/9/29 14:56
頂部



(1) 2 3 4 »



:::

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

教育訓練中心

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