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.

[PIC] UART not working on PIC16F1704

Status
Not open for further replies.

rudasi

Newbie level 1
Newbie level 1
Joined
Jun 26, 2014
Messages
1
Helped
0
Reputation
0
Reaction score
0
Trophy points
1
Visit site
Activity points
6
Hello,

I am trying to get the UART TX to work but am unable to.

My initialisation code is,

Code:
void configure_TX_port(){
    PPSLOCK = 0x55;
    PPSLOCK = 0xAA;
    PPSLOCK = 0;
    RA2PPS = 0x14;
    PPSLOCK = 0x55;
    PPSLOCK = 0xAA;
    PPSLOCK = 1;
    CREN = 1;
    SYNC = 0;
    SPEN = 1;
    SPBRG = (int)(4000000L/(16UL * 9600) -1);
    TXSTA = (0x4|0x20);
}

My send data to the tx code is

Code:
void putch(unsigned char byte) {
	/* output one byte */
	while (!TXIF) /* set when register is empty */

	TXREG = byte;
}

I am using a logic analyzer on pin RA2 (my pps configured TX pin) but dont see anything. I am not sure where in my setup I am going wrong. Any help would be appreciated.

Rahul
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top