Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

PIC24FJ128GA006 serial transmission not working

Status
Not open for further replies.

Shafaq Gul

Junior Member level 1
Junior Member level 1
Joined
Dec 24, 2013
Messages
18
Helped
0
Reputation
0
Reaction score
0
Trophy points
1
Visit site
Activity points
122
Salam every one

I am using mplab C30 and am trying to send data serially but its not working.(p24FJ128GA006):-(...I have tried alot looking for help.

Code:
#include<p24FJ128GA006.h>
   

_CONFIG2(FNOSC_PRI & POSCMOD_HS  )
_CONFIG1(FWDTEN_OFF & JTAGEN_OFF )





//////////////////
int main(void)
{

U1MODEbits.UARTEN=1;//uart enable
//U1MODEbits.STSEL=0;// One Stop bit
U1MODEbits.BRGH=1; //high baud rate
U1MODEbits.ABAUD=0;//Baud rate measurement disabled or completed
U1BRG=51;// as internal oscillator frequency 8Mhz
U1MODEbits.PDSEL0=0;//8-bit data, no parity
U1MODEbits.PDSEL1=0;
U1STAbits.UTXISEL0=0;//Interrupt when a character is transferred to the Transmit Shift Register (this implies there is at least one character open in the transmit buffer)
U1STAbits.UTXISEL1=1; 
U1MODEbits.UEN0=0;// UxTX and UxRX pins are enabled and used; UxCTS and UxRTS/BCLKx pins controlled by PORT latches
U1MODEbits.UEN1=0;
TRISF=0;
TRISD=0xFF;
LATD=0;
LATF=0;

//U1MODE	=	0x8000;
//U1STA	=	0x8400;	

carriage_return();
                                                       
                                                                                                 
                                                                    
while(1);                    //end
return 0;
    //aes256_done(&ctx);
}




                                               /////////////////////////////////////////////////////////////////

void carriage_return(void)
{
U1STAbits.UTXEN=1;
U1TXREG=0x0D;

while(U1STAbits.UTXBF == 1);//wait until all transmitted.

U1STAbits.UTXBF = 1;
}

- - - Updated - - -

Waiting for reply sir...:!:
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top