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] Serial send a string from pic with proteus

Status
Not open for further replies.

ankiterect

Newbie level 4
Joined
Nov 16, 2013
Messages
6
Helped
0
Reputation
0
Reaction score
0
Trophy points
1
Activity points
41
can anyone tell me that why my circuit not giving correct output.

my proteus circuit
21.png
my virtual terminal output
22.png
my mikro c code


Code C - [expand]
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
void newline()
{
UART1_Write(13); // Carriage Return
UART1_Write(10); // Line Feed
}
void main()
{
  do
 {
      UART1_Init(9600);              // Initialize UART module at 9600 bps
      Delay_ms(100);                  // Wait for UART module to stabiliz
      UART1_Write_Text("hello");
     newline();
     Delay_ms(100);
 }  while(1);
}

 
Last edited by a moderator:

The below lines are for UART initialization and should be placed before do{}while loop in the main() function.

Code C - [expand]
1
2
UART1_Init(9600); // Initialize UART module at 9600 bps
Delay_ms(100); // Wait for UART module to stabiliz

 

jayanth now same problem is coming i have intialize my uart before the do while loop

- - - Updated - - -

i am thinking there are some clock frequency problem but i am not recorgnise completely please anyone help me
 

Maybe Compiler is generating wrong baudrate. Change baudrate settings in Proteus and see if you get right output for any other baudrate. Before UART initialization code add

Code C - [expand]
1
TRISC = 0x80;

 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top