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.

CCS pic compiler uart programming

Status
Not open for further replies.

Noman Yousaf

Full Member level 4
Joined
Nov 19, 2003
Messages
210
Helped
3
Reputation
6
Reaction score
2
Trophy points
1,298
Location
Lahore Pakistan
Activity points
1,774
hi all
i am using CCS pic compiler.
i want to use serial programming.
can someone send me the code in which i will simply send 16 bit int and receive to another MCU (PIC16F886).

thanks in advance.

i am using this code to transmit . it transmits properly but receiving is creating proble


Code C - [expand]
1
2
3
4
5
void transmit (void)
{
    int tmp1=55;
      printf("%u\r\n",tmp1);
}



- - - Updated - - -

and yes receiver must be interrupt based
 
Last edited by a moderator:

FvM

Super Moderator
Staff member
Joined
Jan 22, 2008
Messages
49,138
Helped
14,381
Reputation
29,026
Reaction score
13,135
Trophy points
1,393
Location
Bochum, Germany
Activity points
283,236
Did you review the EX_SISR.C example shipped with CCS C?
 

Aussie Susan

Advanced Member level 4
Joined
Jan 5, 2015
Messages
1,332
Helped
387
Reputation
774
Reaction score
396
Trophy points
83
Activity points
14,396
Not addressing your question but why are you using the printf function? Your MCU has 8K words of program memory and the printf family of functions is well known to be very memory (and processor time) intensive.
You could replace that with the functions that would probably be called (ltoa and strcat to add the "\r\n") and save all of the memory space taken up by the formatting function s that need to be included just in case the format string uses them, plus the format string parser that is always parsing the same literal string. (I assume that you are using the constant 'tmp1' for testing purposes.
Susan
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Top