• 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: FJ64GA004 RP14 選Input 不能收
#3
新會員
新會員


查看用戶資訊
修改加入
AD1PCFG = 0xFFFF
測ok

Thanks!

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


Re: FJ64GA004 RP14 選UART RECEIVER 不能收
#2
版主
版主


查看用戶資訊
看起來你的PPS (Peripheral Pin Select) 設定上有錯,底下是我設定 PIC24FJ64GA002 的片斷:[code]
int main(void)
{
CLKDIVbits.RCDIV = 0; // Select Internal FRC as 8MHz, but doesn't use this moment.

// ************* Peripheral Pin Select *********************
//
RPINR18bits.U1RXR = 9; // Set the UART RxD input on the RP9 (pin 18)
RPOR4bits.RP8R = 3; // Set the UART TxD output on the RP8 (pin 17)
RPOR6bits.RP12R = 0; // Disable OC1 output, Set RP12 (pin 23)
RPOR6bits.RP13R = 0; // Set the OC2 output on the RP13 (pin 24)
RPOR7bits.RP14R = 0; // Set the OC3 output on the RP14 (pin 25)
RPOR7bits.RP15R = 0; // Set the OC4 output on the RP15 (pin 26)

AD1PCFG = 0xFFDF; // Enable AN5 (RB3,pin7)as analog input, others for digital I/O

LATB = 0x0000;
TRISB = 0x0FFF; // LED4(RB15) pin as output, OC1~OC3 pins as output (RP12~RP14)[/code]

有關PPS的設定請參考:
http://ww1.microchip.com/downloads/en/DeviceDoc/39711b.pdf
http://www.microchip.com.tw/modules/w ... lefile.php?cid=12&lid=241
http://www.microchip.com.tw/modules/w ... glefile.php?cid=12&lid=69

發表於: 2008/7/4 17:06
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部


FJ64GA004 RP14 選UART RECEIVER 不能收
#1
新會員
新會員


查看用戶資訊
幫幫看一下選其他PORT 都OK 選RP14不能收 謝謝
#include <p24fj64ga002.h>
#include "C:Program FilesMicrochipMPLAB C30srcperipheral_24Fincludeports.h"  /* The header file of I/O PORTS */

void uartvoid)
{
    
config_uart_register();
    
uart_test() ;
}


void uart_test void// test when RX receiver data copy to TX
{
unsigned char x;

while(
1)
   {
        
    if ( 
U1STAbits.URXDA )  // RX buffer is no empty =1
    
{
        
xU1RXREG ;    // receiver Data                
        
if(!U1STAbits.UTXBF // Tx buffer is full =1 , wait
        
U1TXREG x
        }
   }
}

/*------------------------------------------------------------------------------*
* SELECT output table->Input=0 TX1=3 RTS1=4  FOR RPOR REGISTER
* RPOR6= RP13_SELECT *0X100+RP12_SELECT
* RPOR7= RP15_SELECT *0X100+RP14_SELECT 
*---------------------------------------
* SELECT input 4BITS= RP0- TO RP16 FOR RPINR REGISTER
* RPINR18=RX1_sel*0x100+CTS1_sel
*-------------------------------------------------------------------------------*/
void config_uart_register(void)
{
    
unsigned char status;
    
// OUTPUT
    
RPOR6 =  0x0400 ;    //Configure RP13=RTS1 
    
RPOR7 =  0x0300 ;    //Configure RP15=TX1 
    // INPUT
    
RPINR18 0x0c*0x100 0x0e ;    //Configure RP12=CTS1 RP14=RX1

    
U1BRG     383;             // Buadrate is at 9600 crystal is 7.3728MHz BRGH is 1
    
U1MODE    0X8008 ;
    
U1STA    0X0400 ;    
    
status U1RXREG ;     //--- clear RX BUFFER
    
status U1RXREG ;
    
status U1RXREG ;
    
status U1RXREG ;    

    
AD1CON1=0     ;    //close A/D
    
CVRCON=0    ;    //close CVref

}


發表於: 2008/7/4 15:44
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... ]

教育訓練中心

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