• 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: App026-3 EVM v4.0 搭配 PIC24FJ128GA006 的測試
#5
版主
版主


查看用戶資訊
http://www.microchip.com.tw/modules/wfdownloads/viewcat.php?cid=12

何仁杰有寫好的 Code Example for APP026-3,那裡就有 PMP 的 LCD 函數。

發表於: 2008/2/1 16:50
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部


Re: App026-3 EVM v4.0 搭配 PIC24FJ128GA006 的測試
#4
初級會員
初級會員


查看用戶資訊
Dear ALL:

LCD 可以用了, BUG 如下:
在LCD_BUSY() 中 將PORTE 宣告為 INPUT , 但在 LCD_CMD()終又將PORTE 重新宣告為 OUPUT , 這個動作導致PORTE無法正常WORK, 請問各位前輩這是什麼原因呢???







void LCD_BUSY()
{
    
char flag;

    [
color=000099]TRISE=0xff;//造成BUG 的地方[/color]
    
    
do{
        
LCD_RS=0;LCD_RW=1;LCD_EN=1
        
flag=LCD_DATA_PORT;
        
LCD_EN=0;
    }
    while( (
flag >> 7) & 0x01 );

}

//------------------------------------------------------------
//write command to LCD 
//------------------------------------------------------------

void LCD_CMD(char cmd)
{
    
int i;
    [
color=000099]TRISE=0x00;//造成BUG 的地方[/color]


    
LCD_BUSY();
    
LCD_DATA_PORT=cmd ;                
    
LCD_RS=0;LCD_RW=0;LCD_EN=1;      
                
LCD_RS=0;LCD_RW=0;LCD_EN=0;        
      for(
i=500 ;i++) ;  

}

發表於: 2008/1/28 16:52
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部


Re: App026-3 EVM v4.0 搭配 PIC24FJ128GA006 的測試
#3
初級會員
初級會員


查看用戶資訊
Dear ryan:

謝謝您的回覆, 利用ICD2來做DEBUG小弟已經會用了..
利用ICD2修正完CODE, 搭配LOGIC ANALYZER去看時序, 一切都很正常, 但LCD就是出不來...(持續尋找BUG中...)

不知MICROCHIP是否有提供, APP026-3 for PIC24FJ128GA006 的LCD SAMPLE CODE 可供參考..

網路上找到的文章, 都是以PMP為介面,小弟DOWNLOAD下來後,正在研究中...


謝謝您!!!

發表於: 2008/1/28 14:15
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部


Re: App026-3 EVM v4.0 搭配 PIC24FJ128GA006 的測試
#2
版主
版主


查看用戶資訊
我也使用 APP023-3 PIC24FJ128GA006 來做實驗,Config. 的設定我是用第二組來除錯。燒錄沒問題 Debug 應該會動一下吧! 至少應該會跳到Main( ) 吧!

_CONFIG2(IESO_OFF & FNOSC_PRIPLL & FCKSM_CSDCMD & OSCIOFNC_OFF & POSCMOD_HS)
// HS mode with x4 PLL,
_CONFIG1(JTAGEN_OFF & GCP_OFF & GWRP_OFF & ICS_PGx2 & FWDTEN_OFF)

發表於: 2008/1/25 17:24
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部


App026-3 EVM v4.0 搭配 PIC24FJ128GA006 的測試
#1
初級會員
初級會員


查看用戶資訊
Dear ALL:

底下的測試CODE是小弟由8bits MCU porting 過來, 目前編譯都是正常的, 在Configuration bits 設定內容大致如下:

1. HS Oscillator Enable
2. OSCO pin has clock out...
3. Sw Disable...
4. Primary Oscillator(XT,HS,EC)
5....
...
8. Watch dog : Disable
9. EMUC1/EMUD1 shared with PCG1/PCD1
...
13 JTAG Disable

利用ICD2燒錄到PIC24FJ128GA006 後LCD完全沒訊息..
目前正在了解與學習ICD2 DEBUG 中, 看對 DEBUG CODE能否有點幫助.

不知到設定上是否有錯誤呢??


感謝各位前輩的協助...

#include    <p24FJ128GA006.h>


#define    LCD_DATA_PORT    PORTE
#define LCD_RS            PORTBbits.RB15
#define LCD_RW            PORTDbits.RD5
#define LCD_EN            PORTDbits.RD4     


 
const unsigned char play1[]="LCD ON...";



//-----------------------------------------------------------
//Delay 1*count ms
//-----------------------------------------------------------

void delay1ms(int count)  
{
         
int i,j;
  
        for(
i=0;i<count;i++)     
              for(
j=0;j<2000;j++);
}
//-----------------------------------------------------------
// CHECK BUSY FLAG
//-----------------------------------------------------------
void LCD_BUSY()
{
    
char flag;

    
TRISE=0xff;//input
    
    
do{
        
LCD_RS=0;LCD_RW=1;LCD_EN=1;     
        
flag=LCD_DATA_PORT;
        
LCD_EN=0;
    }
    while( (
flag >> 7) & 0x01 );

}

//------------------------------------------------------------
//write command to LCD 
//------------------------------------------------------------

void LCD_CMD(char cmd)
{
    
int i;

    
TRISE=0x00;//output

    
LCD_BUSY();

    
LCD_DATA_PORT=cmd ;                

    
LCD_RS=0;LCD_RW=0;LCD_EN=1;      

    
LCD_RS=0;LCD_RW=0;LCD_EN=0;        

      for(
i=500 ;i++) ;  

}
//------------------------------------------------------------
// wirte data to LCD
//------------------------------------------------------------
void LCD_DATA(char data1)
{
    
int i;

    
TRISE=0x00;//output

    
LCD_BUSY();    

    
LCD_DATA_PORT=data1;

    
LCD_RS=1;LCD_RW=0;LCD_EN=1;            

    
LCD_RS=1;LCD_RW=0;LCD_EN=0;    

    for(
i=500 ;i++) ;   

}
//-----------------------------------------------------------
// initial LCD
//-----------------------------------------------------------
void Init_LCD()  {
    
    
LCD_EN=0;

    
delay1ms(10) ;         

    
LCD_CMD(0x3F) ; 
    
delay1ms(1) ;  

    
LCD_CMD(0x3F) ; 
    
delay1ms(1) ;  

    
LCD_CMD(0x3F) ; 
    
delay1ms(1) ;  

    
LCD_CMD(0x38) ; 
    
LCD_CMD(0x0C) ; 
    
LCD_CMD(0x01) ; 
    
LCD_CMD(0x02) ; 
    
LCD_CMD(0x06) ; 

    
delay1ms(1) ;      

//-----------------------------------------------------------
void init_IO(void)
{
    
TRISBbits.TRISB15=0;
    
TRISDbits.TRISD4=0;
    
TRISDbits.TRISD5=0;
}
//-----------------------------------------------------------
int main(void)
{
    const 
unsigned char *p1;

    
p1 play1;

    
init_IO();
    
Init_LCD();

    
LCD_CMD(0x80); //display from col. 1
    
while(*p1!=''LCD_DATA(*p1++); 
    
    while(
1);

}
//end main




發表於: 2008/1/25 17:09
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... ]

教育訓練中心

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